@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,114 @@
1
+ ---
2
+ policy: minpriv
3
+ title: Privacy, MinPriv, cookies, and the Data Risk Assessment
4
+ reviewed: 2026-09-01
5
+ ---
6
+
7
+ # Privacy
8
+
9
+ Stanford's policy name is **MinPriv**. This file also covers the cookie question
10
+ and the Data Risk Assessment, because in practice people meet all three at once.
11
+
12
+ ## No cookie consent banner is required
13
+
14
+ **And that is the whole claim. Not required is not the same as forbidden.**
15
+
16
+ The disclosure obligation is satisfied by the **Privacy link in the Stanford
17
+ Global Footer**, whose upstream title is literally "Privacy and cookie policy."
18
+ The Cookie Policy lives centrally on `www.stanford.edu`; individual sites do not
19
+ restate it.
20
+
21
+ So a banner is never the default, and a site without one is fully compliant.
22
+
23
+ **A developer may still add one.** Units have reasons this project cannot see: an
24
+ analytics posture, a European audience, a decision taken above them. Nothing here
25
+ prohibits it, and an agent that tells someone they cannot have a cookie banner is
26
+ interpreting policy on the university's behalf, which the escalation rules
27
+ explicitly forbid.
28
+
29
+ What to say instead, if someone adds one:
30
+
31
+ - **It is a deliberate addition, so write it down.** Record it in
32
+ `.sws/manifest.yml` under `privacy.consent_tooling` with the reason. Both
33
+ consent checks pass once it is declared, and neither blocks anything.
34
+ - **It is now yours to keep accessible.** A banner is a focus trap, a contrast
35
+ surface and a keyboard target that nobody upstream maintains for you.
36
+ - **The vendor question is not ours.** No consent vendor is centrally licensed,
37
+ so do not evaluate or rank them. Send it to the University Privacy Office.
38
+
39
+ Two checks cover this and both are advisory: `privacy.consent-ui-declared` for
40
+ markup written in the repo, and `privacy.consent-tooling-declared` for a
41
+ third-party package. Each flags an **undeclared** choice, never the choice
42
+ itself.
43
+
44
+ ## MinPriv: transparency before collection
45
+
46
+ **A transparency notice is required before collection.** Any form needs to say,
47
+ in plain language and *before* the reader fills it in:
48
+
49
+ - what is collected,
50
+ - why,
51
+ - and what happens to it.
52
+
53
+ Plus **purpose limitation**: data collected for one stated purpose is not
54
+ repurposed silently.
55
+
56
+ This applies to research too. A survey collecting anything personal needs a
57
+ transparency notice, purpose limitation, and appropriate storage. Introducing a
58
+ third-party survey tool may trigger a DRA.
59
+
60
+ **Ask for the minimum.** Every field on a form is a MinPriv question about why
61
+ you need it. See [`../patterns/forms.md`](../patterns/forms.md).
62
+
63
+ ## Analytics is a privacy decision
64
+
65
+ Two Stanford specifics that invert the usual assumption:
66
+
67
+ 1. **Siteimprove registration is required. Google Analytics is not.**
68
+ 2. Because MinPriv requires a transparency notice before collection, "add GA4" is
69
+ **a choice with obligations attached**, not a default.
70
+
71
+ Write the measurement plan during discovery, when it can still change what gets
72
+ built. See [`minweb.md`](minweb.md) for the Siteimprove requirement itself.
73
+
74
+ ## The Data Risk Assessment
75
+
76
+ A **DRA is required before deploy** when the site collects personal information
77
+ or introduces third-party services, and unconditionally at `high` tier. See
78
+ [`minsec.md`](minsec.md) for the tiers.
79
+
80
+ The triggers, concretely:
81
+
82
+ - Personal information is collected or displayed.
83
+ - A new third-party service is introduced.
84
+ - Regulated data or payments are involved.
85
+ - Authentication is added, which is itself a tier change.
86
+
87
+ DRA has a lead time and it is a pre-deploy gate, so it belongs in discovery. A
88
+ **Privacy and Security consult** is recommended pre-launch at `moderate` tier and
89
+ above.
90
+
91
+ **To find the third parties a site actually contacts, run `sws perf`.** It lists
92
+ every third-party origin the built pages request, which is the concrete input to
93
+ this question and is easy to be wrong about from memory. A font CDN counts. This
94
+ project's own docs site turned out to contact two Google Fonts origins for 157 KB,
95
+ which nobody had decided — it is Decanter's default, since Decanter ships no font
96
+ assets. Self-hosting fonts removes the origin and is usually faster.
97
+
98
+ Route per [`escalation.md`](escalation.md). The DRA route there is still marked as
99
+ needing confirmation, so use the general contact and say that is what you are
100
+ doing rather than inventing a door.
101
+
102
+ ## Required content that is not yours to reword
103
+
104
+ - The **Privacy** link in the Global Footer. Immutable.
105
+ - The **Accessibility** link in the Global Footer. Immutable.
106
+ - Both are byte-exact in `standards/fragments/global-footer.yml`. See
107
+ [`brand.md`](brand.md).
108
+
109
+ ## The line
110
+
111
+ An agent can explain what MinPriv requires, draft a transparency notice, and flag
112
+ a DRA trigger. It **cannot** decide that a DRA is unnecessary, approve a data
113
+ collection, or interpret privacy policy on the university's behalf. State the
114
+ obligation, name the office, stop.
@@ -0,0 +1,79 @@
1
+ ---
2
+ policy: procurement
3
+ title: Procurement, VPATs, and accessibility conformance reports
4
+ reviewed: 2026-09-01
5
+ ---
6
+
7
+ # Procurement
8
+
9
+ Short file, one rule that matters, and a warning about how that rule gets
10
+ satisfied on paper without being satisfied in fact.
11
+
12
+ ## The 12-month rule
13
+
14
+ **Any purchased product needs a VPAT or ACR dated within the past 12 months**,
15
+ assessed against the required WCAG level.
16
+
17
+ - **VPAT** is the template. **ACR** is the completed report produced from it.
18
+ - "Within the past 12 months" is about the **report's date**, not the purchase
19
+ date. A 2019 VPAT for a product that has shipped forty releases since is not
20
+ evidence of anything.
21
+ - The scope is set by Admin Guide 6.8.1, which covers **purchases and major
22
+ revisions**, not only new builds. See [`accessibility.md`](accessibility.md).
23
+
24
+ ## Read it, do not file it
25
+
26
+ This is the thinnest part of Stanford web compliance in practice: the reports get
27
+ collected and nobody reads them.
28
+
29
+ **Vendors routinely self-report "Supports" for criteria they only partially
30
+ meet.** The ratings column is marketing. **The remarks column is where the truth
31
+ lives.** A VPAT review worth the name checks the remarks.
32
+
33
+ What to actually look for:
34
+
35
+ | Signal | What it usually means |
36
+ |---|---|
37
+ | "Supports" with an empty remarks cell | Nobody tested it. Ask what was tested and how |
38
+ | "Partially Supports" with a specific remark | Honest, and more trustworthy than a blanket "Supports" |
39
+ | "Not Applicable" on criteria that clearly apply | The report was filled in by someone who did not understand the product |
40
+ | No mention of assistive technology actually used | The evaluation was automated only, so expect the 30 percent ceiling |
41
+ | Report predates a major version change | Out of date regardless of its stated date |
42
+
43
+ Record the review, with findings, in `docs/a11y/procurement/`. A dated review with
44
+ honest findings is worth more at audit than a folder of unread PDFs.
45
+
46
+ ## Temporary exceptions
47
+
48
+ A **temporary exception** exists where conformance is **not technically feasible**
49
+ or would **fundamentally alter the service**.
50
+
51
+ That is a request to ODA. It is not a decision an agent, a developer, or a
52
+ project team makes, and "the vendor says it's hard" is not the same as not
53
+ technically feasible.
54
+
55
+ ## Do not recommend vendors
56
+
57
+ **This is a hard line, not a preference.** For anything with legal, policy, or
58
+ procurement implications:
59
+
60
+ > State the obligation. Name the office. Stop.
61
+
62
+ That means no recommending or ranking of accessibility remediation vendors,
63
+ consent management platforms, security scanning products, hosting vendors beyond
64
+ naming what SWS already runs and why, or survey tools.
65
+
66
+ The reasoning is simple: a recommendation from a tool carries an implication of
67
+ institutional endorsement that this project cannot give, and procurement decisions
68
+ have contractual consequences that a person has to own.
69
+
70
+ Route per [`escalation.md`](escalation.md). ODA is worth consulting on
71
+ accessibility conformance in a purchase even though procurement is a different
72
+ process from a review.
73
+
74
+ ## What the compliance function is missing today
75
+
76
+ Named honestly, because the gap is real: nobody is currently reading VPATs
77
+ carefully, and there is no portfolio view across projects. `.sws/acknowledged.yml`
78
+ and `docs/` are the right places for the evidence. The missing piece is someone
79
+ looking at them across projects rather than one at a time.
@@ -0,0 +1,205 @@
1
+ # Prior art
2
+
3
+ **SWS has built a lot of websites. The agent should look at them before inventing something.**
4
+
5
+ This directory is how that happens without vendoring anyone's code, and without dragging superseded standards into new work.
6
+
7
+ ## Scope note: most of this prior art is CMS-backed, and the CMS is not in scope
8
+
9
+ **Read this before copying anything.** `standards/scope.md` scopes this package
10
+ to **static content authored in the repo, with no CMS.** Six SWS repos run
11
+ Storyblok and five run decoupled Drupal, so most of the record below is
12
+ CMS-backed work.
13
+
14
+ That record is **not rewritten to match the current scope**, because it is
15
+ evidence rather than instruction. It is still correct about what SWS built.
16
+
17
+ So when prior art shows you a Storyblok or Drupal pattern:
18
+
19
+ - It is **still true** about what SWS did, and the work is not wrong.
20
+ - It is **not a recipe you can follow here**, because there is no tested CMS
21
+ path in this package.
22
+ - Cite it for the **shape of the problem** — content modelling, IA, component
23
+ composition, host wiring — and not for the content plumbing.
24
+
25
+ This is the ordinary precedence rule doing its job: prior art tells you how we
26
+ solved a shape of problem, standards tell you what to build it with, and when
27
+ they disagree, standards win.
28
+
29
+
30
+ ## The precedence rule
31
+
32
+ This is the whole design, and everything below serves it:
33
+
34
+ > **Prior art tells you _how we solved a shape of problem_.**
35
+ > **Standards tell you _what to build it with_.**
36
+ > **When they disagree, standards win. Always. No exceptions.**
37
+
38
+ An SWS site from 2023 is a legitimate reference for information architecture, content modelling, navigation patterns, component composition, form flows, and the hundred small editorial decisions that make a Stanford site feel like one. It is never a reference for Decanter version, Tailwind syntax, WCAG target, build tooling, or hosting config.
39
+
40
+ Without this rule, prior art actively makes the output worse. Most existing SWS sites encode Decanter 6 SCSS/BEM or Decanter 7's Tailwind 3 preset, WCAG 2.0 rather than 2.1, and build tooling that predates Astro. An agent that treats "how we did it last time" as authoritative will confidently produce a 2023 site. So every reference carries an era, and the skill that consults them states the rule before it states the findings.
41
+
42
+ ### The distinction that makes the rule usable
43
+
44
+ The rule above is necessary but incomplete, and the first inspection pass proved it. Applied naively it would have thrown away the most valuable findings of the whole exercise. Two things look alike in a repo and are not:
45
+
46
+ **Dated execution is drift. Standards win.**
47
+ A repo on Decanter 7 and Tailwind 3 is not a CSS reference. A repo on Next 13 is not a framework reference. Note the era, take the problem shape, leave the implementation.
48
+
49
+ **Repeated independent choices are knowledge. Standards should change.**
50
+ Five repos choosing `sa11y`, seven pinning the same `cnbuilder` version, and zero choosing pnpm are not drift. They are facts about how SWS works that no amount of research or reasoning would have surfaced. When production repos consistently agree with each other and disagree with our standards, **our standards are probably wrong.** Eleven production repos outrank one author's assumption.
51
+
52
+ The test: *is this repo doing something old, or is the org doing something consistently?* One repo on Decanter 7 is dated. Nine repos avoiding a tool we recommend is a signal about the tool.
53
+
54
+ **Count lineages, not repos.** This clause said "independent" from the start, and the word is load-bearing. An earlier version of this section cited *"four opting out of Turbopack"* alongside the examples above. That example was **wrong, and it was checked with SWS on 2026-09-01**: the four decoupled-Drupal repos run `--webpack` because of one point-in-time decision to not adopt Turbopack, and Turbopack is in fact the forward choice for Next.js. The four repos are **one family**, so the flag was copied along with everything else.
55
+
56
+ This is the failure mode copy-forking creates, and copy-forking is a practice this project explicitly endorses: `csp-nextjs` was made by copying `cardinalsites-nextjs`, deliberately and correctly. The consequence for inspection is that **N repos in one lineage agreeing is one data point, not N.** Four sibling repos sharing a flag is weaker evidence than two unrelated repos sharing one.
57
+
58
+ So before treating agreement as a convention, ask whether the repos are siblings. If they are, you have found a **frozen decision**, which is a fact about the past. Whether it is still the intent needs the third clause below — a person.
59
+
60
+ ### Third clause: prior art cannot tell you why, or where the org is going
61
+
62
+ **This is the clause that matters most, and it was learned the hard way.**
63
+
64
+ The first inspection pass produced four proposed corrections to our standards. **Three were wrong**, and each failed in a way an agent will reliably reproduce:
65
+
66
+ - **`sa11y` in five repos** looked like a developer tooling convention. It is a **content-author** tool used in Visual Editor overlays. The dependency data said *what*, and I supplied a *why* that was wrong. Acting on it would have put an authoring tool into a CI pipeline where it does nothing, while leaving the real gap (accessibility of content published after launch) unaddressed.
67
+ - **Cypress in three repos, Playwright in zero** looked decisive. SWS is moving to Playwright. Lockfiles record decisions already executed and say nothing about direction, so the correct answer was invisible to the analysis by construction.
68
+ - **`sws-astro` on Astro 6** looked like a version constraint to adopt. The actual answer was to stop naming versions anywhere in the recipes. A version mismatch is often a design smell rather than a decision.
69
+
70
+ So:
71
+
72
+ > **Prior art establishes what the org does. It cannot establish why, and it cannot establish where the org is going. Both require asking a person.**
73
+
74
+ Practical obligations on the agent:
75
+
76
+ 1. **Never infer purpose from presence.** If a dependency's role is not obvious from how it is used, say "five repos include `sa11y`, purpose unconfirmed" rather than "SWS uses `sa11y` for X."
77
+ 2. **Never present current practice as intent.** "Three repos use Cypress" is a fact. "SWS standardises on Cypress" is a claim about a decision, and it needs a human.
78
+ 3. **Watch for questions that should be dissolved instead of answered.** If prior art and standards disagree on a version, first ask whether the version needed specifying at all.
79
+ 4. **End step 0 with a check, not a conclusion.** Report findings as findings, flag which are facts and which are inferences, and let the person confirm before any of it hardens into a standard.
80
+
81
+ ### Era is not a timeline: lineage matters
82
+
83
+ The `era` field implies a straight line, decanter-6 to 7 to 8, where newer is better. That model broke on the first repo that mattered.
84
+
85
+ **`www.stanford.edu` does not consume Decanter.** It is its own design system, heavily derived from Decanter, and it is currently *influencing Decanter 8*. It sits **upstream** of the design system, not downstream. So it is simultaneously ahead of Decanter 8 in some respects and incompatible with it in others, and no single `era` value can express that.
86
+
87
+ Three relationships to the design system, not one axis:
88
+
89
+ | Lineage | Meaning | How to use it |
90
+ |---|---|---|
91
+ | **Consumer** | Installs Decanter at some version | Era applies normally. Newer is better |
92
+ | **Derived** | Its own system, descended from Decanter | Brand furniture still authoritative, because brand is brand. Tokens and CSS are a **parallel vocabulary**, not Decanter's |
93
+ | **Upstream** | Feeding patterns back into Decanter | A preview of where the system is going. Adopt ideas, not implementations |
94
+
95
+ `www.stanford.edu` is derived *and* upstream at once.
96
+
97
+ The trap this creates is specific and worth naming: copying CSS from a derived system into a Decanter project produces something that **looks approximately right and does not use the design system**. It will pass a visual review and fail every token-level check, and the failure is invisible in a screenshot. An agent must therefore check lineage, not just era, before borrowing anything at the CSS or token layer.
98
+
99
+ This also means "the design system" is not a single source of truth at any given instant. There is a live feedback loop from a flagship project into Decanter, which is healthy and how design systems should actually evolve, but it means the honest answer to "what does Stanford's design system say?" is sometimes "Decanter 8 says X, and the homesite is piloting Y."
100
+
101
+ ### Copy-forking is the incumbent, and it works
102
+
103
+ `cardinalsites-nextjs` and `csp-nextjs` are intentional sibling instances: two clients, one repo copied to make the other. Not divergence to reconcile.
104
+
105
+ That is worth sitting with, because **copy-forking a previous client site is the existing solution to the problem this project is trying to solve.** It is not a bad practice. It is fast, it carries real working code, and it preserves decisions no document captured. Any agent that treats a near-duplicate repo as a problem to flag has misunderstood the shop.
106
+
107
+ What copy-forking does not do is carry standards forward or tell you what changed since. A fork made 18 months ago inherits that era's Decanter, that era's a11y target, and that era's dependency set, silently and permanently. So the honest positioning for this project is not "stop copy-forking," it is: keep the reuse, add a way to know what has moved. Recipes are the diff that a fork cannot give you.
108
+
109
+ Practically: when the agent finds two near-identical repos, `relationship: sibling-instance` is a **recognised, legitimate pattern**, not a finding. Report it as context, never as drift.
110
+
111
+ ### Correlations are the most seductive trap `sa11y` correlated **perfectly** with Storyblok across all 11 repos, five for five and six for six. That pattern was the answer, and I reported the count instead. A strong correlation with another dependency usually means the tool belongs to *that* dependency's domain, so look at what it co-occurs with before deciding what it is for.
112
+
113
+ The mirror-image trap is an *absence*. `www.stanford.edu` had no `decanter` dependency, and I logged it as a gap to explain. It was a deliberate architectural fact: a derived design system. A missing dependency is a design decision at least as often as it is an oversight, so ask before calling it either.
114
+
115
+ Full record in `standards/patterns/sws-conventions.md`, kept deliberately as a record of error rather than tidied up, because the pattern of failure is more reusable than the conclusions.
116
+
117
+ ## Three tiers, cheapest first
118
+
119
+ Curation is the expensive part, so the tiers are ordered so that the free ones carry most of the load.
120
+
121
+ ### Tier 1: local scan. Zero curation.
122
+
123
+ Most SWS people have ten to fifty Stanford repos already on disk. That is the highest-signal, lowest-effort corpus available and it never leaves the machine.
124
+
125
+ ```bash
126
+ sws prior-art scan
127
+ ```
128
+
129
+ Walks the roots configured in `.sws/config.yml` (defaults: the parent of the current directory, plus `~/Sites`, `~/Projects`, `~/code` if they exist), and indexes anything that looks like Stanford web work: a `decanter` dependency, a `stanford.edu` string in a footer or config, a `stanford_basic` theme, or an `su-` class prefix. Writes `.sws/prior-art.local.yml`, which is **gitignored** and never transmitted.
130
+
131
+ For each project it records path, detected stack, detected Decanter major, last commit date, and which recognisable patterns it contains. It does not copy code. When the agent needs an implementation it reads the file from disk at that moment.
132
+
133
+ Privacy matters here: client work and private repos are on these disks. The scan records paths and metadata only, the index stays local, and nothing in this system uploads project contents anywhere.
134
+
135
+ ### Tier 2: the org catalog. Light curation, highest value.
136
+
137
+ `catalog.yml` in this directory. A hand-maintained list of SWS repos with the one thing no automated system can supply: **judgment**. Which one is the good one. Which one is a cautionary tale. Which one everybody copies and shouldn't.
138
+
139
+ No code, just metadata and file pointers. Small enough that one person can keep it honest, and it is the only place where "this is how we do it" carries authority.
140
+
141
+ ### Tier 3: live search. Zero curation, fallback.
142
+
143
+ When tiers 1 and 2 have nothing, the MCP tool `sws_prior_art(query)` runs a code search across the `SU-SWS` GitHub org. Always current, no maintenance, but uncurated: results carry no signal about whether the code found is exemplary or abandoned. Treat as a lead, not an answer, and check the era before borrowing anything.
144
+
145
+ ### Live exemplars: a different kind of reference
146
+
147
+ Most of SWS's best work is not reachable as source. [Awesome-Decanter](https://github.com/SU-SWS/Awesome-Decanter) lists 17 shipped Stanford sites as **URLs**, and for many of them there is no public repo. That is not a gap, it is a distinct and in some ways better reference type, because a live site shows what actually survived launch.
148
+
149
+ What a live exemplar can teach:
150
+
151
+ - **Rendered page furniture.** The Identity Bar and Global Footer as actually shipped, which is the most compliance-relevant markup in the system.
152
+ - **Information architecture.** Navigation depth, labelling, URL structure, how a large Stanford unit organises itself.
153
+ - **Content patterns.** Page types, hierarchy, editorial voice, how long a real Stanford page is.
154
+ - **Decanter in the wild.** Which utilities and components get used, and which get worked around.
155
+ - **A shipped accessibility baseline.** Run axe against a peer site to see what Stanford sites actually achieve, not what a spec says.
156
+
157
+ What it cannot teach: build config, dependency versions, component source, or CSS architecture. Those come from the recipe, always. The precedence rule applies with extra force here, because a rendered page gives no signal at all about which Decanter era produced it.
158
+
159
+ **The Global Footer verification corpus.** This is the most valuable single use of the live exemplars. Our `standards/fragments/global-footer.yml` is the highest-stakes normative fragment we maintain and it is currently unverified. Rather than trusting one source, `sws prior-art verify-footer` can fetch the rendered footer from all 17 exemplars, extract the link sets, and report the consensus plus any outliers. `www.stanford.edu` is the canonical reference among them. A link set that agrees across seventeen shipped Stanford sites is far stronger evidence than a documentation page, and the outliers are informative in their own right, since they are either drift to report or legitimate variants we do not know about.
160
+
161
+ ## The pattern ledger, harvested not authored
162
+
163
+ `patterns/` holds distilled write-ups of recurring solved problems. The important design decision is **how entries get there**: nobody sits down to write them.
164
+
165
+ When a role skill solves something and the user confirms it worked, `sws harvest` offers to append an entry pointing at the implementation just written:
166
+
167
+ ```
168
+ That event listing pattern isn't in the ledger. Add it? (y/n)
169
+ → patterns/event-listing.md, pointing at this repo and file
170
+ ```
171
+
172
+ Prior art then accumulates as a byproduct of use, which is the only model that survives contact with a busy team. It also follows the nagging-not-blocking rule: `harvest` offers, never demands, and declining costs nothing.
173
+
174
+ Each pattern is short on purpose: the problem, the shape of the solution, the canonical implementation to look at, the era it was written in, and what to watch out for. It is a signpost, not documentation.
175
+
176
+ ## Lookup order
177
+
178
+ ```
179
+ sws prior-art find "<what you are building>"
180
+
181
+ 1. patterns/INDEX.md distilled, fastest, has judgment
182
+ 2. .sws/prior-art.local.yml the user's own disk, free, private
183
+ 3. catalog.yml curated org work
184
+ 4. sws_prior_art(query) live org search, uncurated
185
+ 5. nothing found say so plainly and generate from the recipe
186
+ ```
187
+
188
+ Step 5 matters. "No prior art found" is a legitimate and common answer, and saying it plainly is better than returning a weak match that sends the agent down the wrong path. A tool that always finds something is a tool that is sometimes wrong without telling you.
189
+
190
+ ## What the agent must do with the results
191
+
192
+ 1. **State the era** of anything it borrows from, and what it is therefore not borrowing.
193
+ 2. **Reconcile against current standards** before writing anything, not after.
194
+ 3. **Record what it reused** in `.sws/manifest.yml` under `prior_art`, so the next person can trace where a pattern came from.
195
+ 4. **Never copy build config, dependency versions, or CSS architecture** from prior art. Those come from the recipe, always.
196
+
197
+ ## Files
198
+
199
+ | File | Maintained by | Contents |
200
+ |---|---|---|
201
+ | `README.md` | SWS | This document. The precedence rule lives here |
202
+ | `catalog.yml` | SWS, by hand | Curated repos with era and judgment |
203
+ | `patterns/INDEX.md` | `sws harvest` | One line per pattern |
204
+ | `patterns/*.md` | `sws harvest`, edited by humans | Distilled solutions |
205
+ | `.sws/prior-art.local.yml` | `sws prior-art scan` | Local index. Gitignored, never transmitted |