Nuxt: preserve requirements through advanced agent edits
Work through TypeScript examples of real application boundaries: Keep Nuxt API mutations scoped to the server-verified session; Use Nuxt request-scoped state instead of a shared SSR ref. Each recipe includes implementation code, integration prerequisites, failure-path tests to add, a Perch rule, and the captured broken/fixed source checks.
Download the Nuxt rule pack ZIP · Inspect the YAML rules
TypeScript
Nuxt route middleware controls navigation, while a server/api endpoint can be called directly. Require the server session in the endpoint and carry its identity into the database predicate. Do not replace that scope with a tenant supplied in JSON.
Broken edit flagged · corrected edit passes
TypeScript
A ref declared at module scope on the server can survive across requests. Nuxt useState supplies SSR-aware state tied to the current application/request and serialized for hydration. That prevents a later request from inheriting the previous customer’s draft.
Broken edit flagged · corrected edit passes
Use a correction as a saved requirement
Choose the failure you need to prevent, add the scoped rule to your repository, and check both the broken and corrected implementation. Ask your agent to inspect the finding, repair the code and recheck the same rule. Keep framework tests beside the model check.
Perch keeps the requirement beside the code. Reuse the named check during the agent’s next edit and in CI, with cached answers free on unchanged requests.
Official Nuxt documentation · All language and framework recipes