Repository navigation
fix: scaffold and pipeline follow-through from the screenshot run - #151
Merged
Merged
Conversation
The /build-from-screenshot run in issue #145 had to leave the documented path on a fresh `setup-project.sh my-app --vite` scaffold. PR #146 already made the app its own pnpm root and pinned the coverage provider (items 1 and 2). This takes the rest of the scaffold's share: - Playwright (item 4): the shared config derives baseURL and webServer.url from one PORT constant (E2E_PORT, falling back to 3000), and the scaffold sets that fallback per framework (Vite, Vue and SvelteKit 5173, Astro 4321). `@playwright/test` is installed with the other tooling; the browsers stay a one-time `pnpm exec playwright install chromium`, printed at the end. - Storybook (item 3): the shared, Vue and SvelteKit .storybook templates move to Storybook 10, which supports the scaffold's Vite 8 since 10.3: docs and a11y addons only (essentials and interactions are in core since 9), Preview typed from the framework package. generate-stories.js imports Meta and StoryObj from the framework package named in .storybook/main.ts (@storybook/react-vite when none is found) and the MDX blocks from @storybook/addon-docs/blocks. When the app's package.json lists no Storybook package it exits 0 with `status: skipped` and the install command instead of writing stories that break tsc and the build. The scaffold still copies the config and prints the install command rather than installing Storybook. - SEO (item 6): the scaffold ships public/robots.txt, which Lighthouse's SEO audit wants and no design supplies. - App root (item 1): common_app_root() in lib/common.sh is the current directory when it holds a package.json, else the repo root. check-responsive.sh installs @playwright/test there, resolves it from the app's package.json (a /tmp script cannot import it on its own), uses `pnpm exec` instead of npx, and keeps its screenshots under the Aurelius checkout's .claude/visual-qa/. mktemp --suffix is GNU-only; mktemp -d is not. Tests run the scaffold's port function on a copy of the template, check the dry-run tooling list, the Storybook 10 package names and the install hint, run the generator with and without a Storybook dependency, and run check-responsive.sh with a fake pnpm from a sibling app directory. Refs #145 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The screenshot in issue #145 was a crop starting about 180 px below the top of the page, 1265 px wide (a 1280 px window minus a scrollbar), so the component-lanes visual stage could only fail by construction and the run had to redo the bounded loop by hand with a cropped capture (item 5). visual-diff.js takes `--crop x,y,w,h`, compares only that region of the actual capture and reports `crop` with the capture's full size; a box that reaches outside the capture is a usage error (exit 2). A page reference in the component-lanes workflow may now be `{ path, renderWidth, crop }` as well as a path: the visual check captures at renderWidth and passes --crop, so a partial screenshot is diffed inside the workflow. Plain path references work as before. Refs #145 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The pipeline skills describe what the scripts now do (issue #145): - screenshot-intake asks for a page title and a one-line description (Q7, with defaults from the vision pass) and writes them to pages[].seo; a screenshot taken at a non-standard width or covering part of the page gets a `reference` with renderWidth and crop. - build-from-screenshot passes `reference` into the component-lanes args as an object reference, writes the title, meta description and robots.txt in Phase 4 (the SEO floor applies to a screenshot build too; the report lists them as additions), and records Phase 4.5 as skipped when Storybook is not installed. - build-from-figma documents the object form of a reference and the Storybook skip; parallel-orchestration says to run Bash dispatches from the app directory when the app lives beside the framework. - storybook-story-generation and the skills README say Storybook 10 and the framework-package imports; e2e-test-generator explains the E2E_PORT fallback instead of hand-editing baseURL per framework. Refs #145 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Two plain "write tests for the X component" requests in issue #145 (item 7) were handled by the main session; no agent ran. The README, the quickstart and the agents guide promised automatic selection. The test-writer-fixer description now names the plain request, covers unit, integration and E2E tests, and says it must be used instead of writing tests in the main session. The three docs say that Claude Code delegates when a request matches an agent's description, may handle a small task itself, and that naming the agent makes the delegation certain; the quickstart example names it. Refs #145 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Description
Follow-through on the seven findings from the
/build-from-screenshotrun on a fresh--vitescaffold (#145). PR #146 already covered item 2 and the workspace half of item 1; this PR takes the rest. The issue left the option choices to me, so each row names the decision.check-responsive.shwould have installed Playwright therecommon_app_root()inscripts/lib/common.sh: the current directory when it holds apackage.json, else the repo root.check-responsive.shinstalls@playwright/testthere, resolves it from the app'spackage.json(a script in/tmpcannot import it on its own), usespnpm execinstead ofnpx, and keeps its screenshots under the Aurelius checkout's.claude/visual-qa/.parallel-orchestrationsays to run the Bash dispatches from the app directory.check-dark-mode.sh,regression-test.sh,capture-baselines.sh,cross-browser-baseline.sh) stillcdto the repo root; untouched here..storybooktemplates move to Storybook 10, which supports Vite 8 since 10.3:addon-docsandaddon-a11yonly, since essentials and interactions are core since 9.generate-stories.jsimports from the framework package named in.storybook/main.ts(@storybook/react-viteby default) and from@storybook/addon-docs/blocks; whenpackage.jsonlists no Storybook package it exits 0 withstatus: skippedand the install command instead of writing stories that breaktscand the build. The pipelines record the phase as skipped.pnpm devfrom the wrong root;@playwright/testand browsers missingPORTconstant (E2E_PORT, with a fallback the scaffold sets per framework: Vite, Vue and SvelteKit 5173, Astro 4321).@playwright/testis installed with the tooling.pnpm exec playwright install chromium, printed at the end, rather than a download during every scaffold.visual-diff.js --crop x,y,w,h; a reference in the component-lanes args may be{ path, renderWidth, crop }; the intake recordsreferencefor a partial or odd-width screenshot andbuild-from-screenshotpasses it through.crop.ycan be measured in visual round 1 when the intake does not know it.public/robots.txt; the intake asks for a title and a one-line description per page (Q7, defaults from the vision pass, written topages[].seo); Phase 4 writes them and the report lists them as additions.Related Issue
Closes #145. Refs #141, #146.
Type of Change
Verification
Repo checks
pnpm vitest run --config scripts/__tests__/vitest.config.js scripts/__tests__/./scripts/lint-and-format.sh --checknode scripts/claude-code-conformance.js./scripts/check-doc-counts.shNew tests, each watched failing before the change:
--cropand its bounds invisual-diff.test.js; render width and crop in the visual-check prompt incomponent-lanes.test.js; framework and blocks imports plus the skip without Storybook ingenerate-stories.test.js; Playwright installed in the app directory, with a fakepnpm, incheck-responsive.test.js;@playwright/testin the tooling, the port function on a copy of the template, the Storybook 10 package names and the robots.txt copy insetup-project.test.js. One existing assertion changed: the MDX test asserted the old four separate@storybook/blocksimport lines and now checks the blocks come from@storybook/addon-docs/blocks.A real scaffold,
./scripts/setup-project.sh my-app --vitein a scratch directory (exit 0):playwright.config.tshasconst PORT = Number(process.env.E2E_PORT) || 5173;and no.bakfile;pnpm exec playwright test --listloads the config ("No tests found", as there is noe2e/yet).public/robots.txtpresent;@playwright/test^1.65.0in devDependencies;.storybook/main.tsis the Storybook 10 config; no Storybook package installed.../scripts/check-types.shfrom the app: "No type errors found."../scripts/check-responsive.sh http://localhost:5173from the app: Playwright is resolved from the app'spackage.jsonand the run fails only on the missing browser binary, pointing at the app directory for the install.../scripts/generate-stories.sh --jsonfrom the app: nothing to generate yet (the scaffold has nosrc/components), so the Storybook check is reached only once components exist; the unit tests cover that path.Not run here: the
--vue,--svelte,--astroand--nextscaffolds (their Storybook templates and the port fallback changed too), and a full pipeline run.Left for later: the visual-QA scripts listed in row 1 still act on the repo root, and
check-dark-mode.shimportsplaywrightfrom a/tmpscript, which Node's ESM resolution cannot satisfy.packages/pipeline/src/react/emit.ts(the InDesign pipeline) and thereact-testing-workflowsskill example still import from@storybook/react.Checklist
pnpm vitest run --config scripts/__tests__/vitest.config.js scripts/__tests__/)./scripts/lint-and-format.sh --check)pnpm tsc --noEmit): not applicable, the TypeScript changed lives intemplates/, which the repo's type check does not cover; the scaffolded app type-checksscripts/README.md,templates/README.md,CLAUDE.md, the pipeline skills, README, quickstart, agents guide)🤖 Generated with Claude Code