Skip to content

feat: 🚧 publish llms.txt and the twin registry on designsystemet.no - #5177

Draft
sorensensig wants to merge 21 commits into
digdir:test-ai-registryfrom
sorensensig:feat/ai-registry-publish
Draft

feat: 🚧 publish llms.txt and the twin registry on designsystemet.no#5177
sorensensig wants to merge 21 commits into
digdir:test-ai-registryfrom
sorensensig:feat/ai-registry-publish

Conversation

@sorensensig

Copy link
Copy Markdown
Contributor

Summary

Third PR of the stack proposed in #5166 (AI-readiness), stacked on #5176. It adds:

  • the www build generates the twin registry into public/twins/ and the llms.txt index at the site root, so designsystemet.no serves /llms.txt and /twins/components/<Name>.json
  • the document head advertises the index (<link rel="alternate" type="text/plain" href="/llms.txt"> plus a llms-txt meta): in trials, discovery went from 4/8 to 7/8 agents when advertised there
  • merge:twins is reworked for build use: the default run is offline and deterministic, merging the verification state stored in scripts/twins-authored.json; --verify is the maintenance mode that fetches the cited docs pages, rechecks every quote and writes the result back to the data file
  • generated site output is gitignored, consistent with the build-time stance stated on feat: 🚧 machine-readable component contracts (twins) generated from source #5167

The per-PR preview deployment should serve /llms.txt and the twins as soon as it builds, which makes this PR the natural place to try the whole thing in a test environment.

🚧 Draft on purpose: stacked on #5176 (the branch contains the earlier stack commits; the diff specific to this PR is the www wiring and the offline/verify split). Not ready for merge until the stack's shape is agreed on #5166.

Checks

  • I have read the contribution guidelines
  • I have added a changeset (run pnpm changeset if relevant): not relevant, no package changes

🤖 Generated with Claude Code

sorensensig and others added 4 commits August 12, 2026 16:12
Adds scripts/generate-twins.mjs: one JSON contract per documented component
export (real import name, emitted class and data attributes, design tokens,
JSDoc summary), plus an llms.txt index for agent discovery. Extracted fields
regenerate from source and cannot drift; documentation-prose fields (a11y,
composition, relations) are stubbed as authored, never invented.

Output (./registry) is gitignored pending a decision on committed-vs-build-time
generation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…gistry

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds the rules that exist only as documentation prose to the twins:
accessibility requirements, relations and composition rules for 44 components,
each backed by a verbatim quote from designsystemet.no, plus three pattern
twins (form validation, required/optional marking, field guidance) that the
generator now copies into the registry and inverts into component twins.

pnpm merge:twins fetches every cited page and verifies each quote still
appears there. A quote that fails drops the component's reviewed status and
lands on registry/REVIEW.md, so documentation changes surface on the next run
instead of going silently stale. reviewedAgainst in the data records the
package version of the human sign-off.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The www build now generates the registry into public/twins/ and the llms.txt
index at the site root, and the document head advertises it with
link rel=alternate + a llms-txt meta (discovery went from 4/8 to 7/8 agents
in trials when advertised there).

merge-authored-twins.mjs is reworked for build use: the default run is
offline and deterministic, merging the verification state stored in
twins-authored.json; --verify is the maintenance mode that fetches the cited
pages, rechecks every quote and writes the result back to the data file.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fef5585

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mimarz
mimarz changed the base branch from main to test-ai-registry August 13, 2026 12:01
sorensensig and others added 11 commits August 13, 2026 14:36
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Review findings: two of three pattern files keyed components by capitalized
name while the generator matches directory slugs, silently emptying the
pattern backlinks on five component twins (verified restored for all).
Dangling $schema and links.md pointers removed (targets do not exist here),
generator metadata reduced to 'authored', and one boundaries sentence
referencing an internal brief pruned. merge script gets the same
absolute-path fix as the generator.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The rel/type/href carry the discovery signal; the title attribute was
Norwegian-only in an otherwise localized head.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant