Repository navigation
feat(site): add /setup.md and a setup prompt, and jump to the findings on phones - #179
Merged
Merged
Conversation
…s on phones /setup.md is the recipe an agent follows to set onsystem up: look at the project, `init --yes` for the config and baseline, the plugin or MCP config for the agent it runs in, the GitHub Action, then `check .` and a report. Its configs and workflow come from docs/rollout.md and docs/required-check.md. llms.txt points to it, and the home page's first screen and step 2 of the quickstart give the prompt that sends an agent there: "Read https://onsystem.vercel.app/setup.md and set up onsystem in this project." Below lg, the playground's status in the editor bar becomes a "Jump to N findings" link to the findings, which on a 390x844 screen start at y=1,989, under a 1,355 px editor.
…and show the prompt on phones Quickstart step 1 has the user run `init` by hand, which only offers the baseline. /setup.md then had the agent keep that config, and its step 5 said `check . --require-design-system` exits 0. On a copy of examples/shadcn-demo with its config and no baseline, it exits 1 with 10 findings. Step 2 now says to run `npx -y onsystem check . --update-baseline` when there is no onsystem.baseline.json beside the config, and step 5 says what codes 0, 1 and 2 mean: with 1, list the new findings for the user and leave them. test/setup-steps.test.ts runs that path on the demo. Touch screens never show the hero prompt's title, so below sm the label now shows the prompt it copies, on the line under the control. From sm up it is hidden, and the 1440x900 first screen is unchanged. The Codex commands move to CODEX_COMMANDS in lib/site.ts, which the home page and /setup.md both use. The root test no longer reads site/lib/llms.ts as text: site/test/setup.test.ts checks the commands /setup.md names.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Roadmap item: OS2-34 (findings os-site/os-agent-setup-prompt and os-site/os-playground-phone-findings). Site and docs only: no release, no changeset. The roadmap schedules it for Fri 23, not Thu 22.
What was wrong
init. https://onsystem.vercel.app/setup.md returns 404.next devon main.)What changed
/setup.md(site/app/setup.md/route.ts, built fromsetupMd()insite/lib/llms.ts, static): the steps an agent follows.npx -y onsystem init --yesfor the config and the baseline. If a config already exists, keep it (no--force), and if there is noonsystem.baseline.jsonbeside it, record one withnpx -y onsystem check . --update-baseline. This is the case after quickstart step 1, where the user runsinitby hand and it only offers the baseline. If no design system is found,inspect --explain, then--components/--tokens..claude/settings.json,.cursor/mcp.json,.vscode/mcp.json, the Codex plugin commands, the stdio command for any other client, and theAGENTS.mdline.check . --require-design-system, with what each exit code means: 0 passes; 1 means errors that are not in the baseline, which the agent lists for the user and does not fix; 2 means no design system or an unreadable config, so back to step 2. Then the report to the user.The configs and the workflow are taken from the titled blocks in
docs/rollout.mdanddocs/required-check.mdat build time, so they cannot drift from the docs. The Codex commands areCODEX_COMMANDSinsite/lib/site.ts, which the home page's Codex tab and /setup.md both use, and tests check them againstdocs/clients.md. Every command usesnpx -y: without it, npx asks before it installs, and an agent's terminal cannot answer.The prompt,
Read https://onsystem.vercel.app/setup.md and set up onsystem in this project., is in:<label>wraps the text and theCopyButton, so a click on either copies, and the full prompt is the label'stitleand in the button's accessible name. Touch screens never show a title, so belowsm(640 px) the label also shows the prompt it copies, in quotes, on the line under the control. Fromsmup that line is hidden and the control stays on one line.docs/quickstart.md), as a titled block to copy, before the per-agent options.Playground on phones (
site/components/playground.tsx): belowlg, when the check has findings, the editor bar's status becomes a "Jump to 11 findings ↓" link to#findings, which is now the Findings section's id. It lands with the section 80 px from the top, below the sticky header, and "Apply 9 fixes" at 125 px. Fromlgup the bar still shows the counts, since the findings sit beside the editor. While a check runs, with no findings, or after an error, the bar shows the status as before.First screen, measured on
next startagainst main (fed7086):On a phone the row wraps and the prompt takes two lines, so the card starts 68 px lower, still inside the first screen. From
smup the prompt stays in the title and the button's name only, which keeps the 1440x900 first screen as it was.How it was tested
New tests. The site tests fail on main, where /setup.md and the prompt do not exist; the baseline and exit-code cases also fail on this PR's first commit. The root test checks that the commands /setup.md gives do what it says.
site/test/setup.test.ts: /setup.md is static Markdown; its five steps; the commands it gives (init --yes,inspect --explain,check . --update-baseline,check . --require-design-system,check . --ignore-baseline); the--update-baselineline for a config with no baseline, and what exit codes 0, 1 and 2 mean; one entry per agent; nonpxwithout-yin the prose; the configs, the workflow and the plugin and Codex commands word for word as the docs have them; absolute links that resolve to docs pages and their headings; the prompt in quickstart step 2 and in llms.txt.site/test/first-screen.test.ts: the prompt control comes after "Try it in the browser" and before the card, in the same flex-wrap row, and copies the prompt; belowsmit shows the prompt in full (sm:hidden, on its own line).site/test/playground.test.ts: the editor bar links to#findingswith "Jump to 11 findings" and islg:hidden; the counts aremax-lg:hidden; the Clean draft has no link.test/setup-steps.test.ts: runs the commands /setup.md gives on copies of the demo app, with no terminal, as an agent would:init --yeswrites the config and the baseline and prints the counts by rule;check . --require-design-systemthen exits 0;--ignore-baselinelists the findings; a secondinit --yesexits 2 and says the config exists.initby hand and declined the baseline):init --yesexits 2 ("already exists"),check . --require-design-systemexits 1,check . --update-baselineexits 0 and records 10 findings in 1 file, and the check then exits 0.init --yesexits 2, and--components/--tokensthen work.Gate, all passing:
pnpm install --frozen-lockfile --prefer-offline,pnpm format:check,pnpm lint,pnpm typecheck,pnpm test(72 files passed, 1 skipped; 943 tests passed, 3 skipped),pnpm build. Site, as CI runs it:pnpm --filter site generate,test(16 files, 269 tests),typecheck,lint,build. The build lists/setup.mdas static.pnpm smokewas not run: the MCP server and tools are unchanged.In a real browser (Chromium 1248 through playwright-core 1.64.1, on
next startof the production build), at 390x844 (touch) and 1440x900, light and dark, for this revision:text/markdown; charset=utf-8.From the first commit, for the playground, which this revision does not change: the jump link shows below 1024 px and the counts from 1024 px (checked at 1023 and 1024), and the editor bar stays 36 px tall through a re-check ("Checking…", then the link again).
Not part of this change: at 320 px, the How it works cards on the home page overflow by 8 px. They were not touched here.