feat: add boundaries gallery demo + harden scaffold-sync skill (#848 follow-up)#854
Merged
Conversation
The #848 file-routing parity work documented forbidden()/unauthorized() and the global-error/global-not-found boundaries in the scaffold rule files but shipped no gallery demo for them, only the await-params demo. The gallery is the primary teaching surface, so an undemoed thrower is invisible to a scaffolding agent. Add a change-type row so a new control-flow throw or routing boundary file requires a runnable gallery demo, not just an app-tree bullet, and note the root-only carve-out.
…files) Close the scaffold teaching gap from #848. The full-stack and saas scaffolds now ship an app/features/boundaries demo: an index page teaching the four control-flow throws (notFound/redirect/forbidden/ unauthorized) and their boundary files, plus two live sub-routes, gated/ (throws forbidden(), caught by the nearest forbidden.ts at 403) and private/ (throws unauthorized(), caught by the nearest unauthorized.ts at 401). Root-only global-error/global-not-found are taught in prose since they cannot mount under a feature folder. Wired into the home features array (full-stack + saas), cross-linked from the routing demo, added to the scaffold rule-file feature lists, and asserted in scaffold-gallery.test.js. Verified by generating a full-stack app, booting it, and confirming /features/boundaries/gated renders 403 and /private renders 401.
This was referenced Jul 9, 2026
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.
Why
Follow-up to the Next.js 16 file-routing parity work (#848). That PR added
forbidden()/unauthorized(),global-error/global-not-found, and nearest-winsnot-found, and it updated the scaffold rule files (AGENTS.md/CONVENTIONS.mdapp-tree bullets) plus theawait paramsgallery demo. But it shipped no gallery demo for the new control-flow throws. The gallery is webjs's primary teaching surface for AI agents, so an undemoed thrower is effectively invisible to an agent scaffolding an app.The scaffold-sync hook floor passed (the PR did stage scaffold surfaces), so nothing flagged the miss. Root cause: the
webjs-scaffold-syncskill had no change-type row for a new control-flow throw / routing boundary file.What
webjs-scaffold-syncrequiring a runnable gallery demo (a route that throws + its nearest boundary file) for any new control-flow throw or boundary file, not just an app-tree bullet. Notes the root-only carve-out.app/features/boundariesgallery demo (full-stack + saas):notFound/redirect/forbidden/unauthorized+ the boundary files;gated/throwsforbidden(), caught by the nearestforbidden.ts(403);private/throwsunauthorized(), caught by the nearestunauthorized.ts(401);global-error/global-not-foundtaught in prose (cannot mount under a feature folder).Cross-linked from the routing demo; added to the home features array, the rule-file feature lists, and
scaffold-gallery.test.js.Verification
/features/boundaries→ 200,/features/boundaries/gated→ 403 (nearestforbidden.ts),/features/boundaries/private→ 401 (nearestunauthorized.ts).webjs check: only the expectedno-scaffold-placeholdermarkers, no other violations.scaffold-gallery.test.js: 8/8.Definition of done
AGENTS.md+CONVENTIONS.mdfeature lists. Updated.webjs-scaffold-synchardened.