Skip to content

docs(skills): add deco-nextjs-site - #786

Closed
tlgimenes wants to merge 2 commits into
mainfrom
skills/deco-nextjs-site
Closed

tlgimenes wants to merge 2 commits into
mainfrom
skills/deco-nextjs-site

Conversation

@tlgimenes

@tlgimenes tlgimenes commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

What this adds

A new agent skill, deco-nextjs-site, for building a Next.js App Router site on @decocms/nextjs 8 and @decocms/blocks 8. It covers the block map and the two createCMS handles, withDeco, the proxy (draft, visitor and assignment decisions, plus the /_draft and /_assignments rewrites or draftProxy), rendering resolved pages in Server Components (bindDraft, contentClient, assignedClient, matchRoute, redirects), page metadata from the seo block, ISR on the assignments route, the Studio bridge and CSP, the next/image loader and the request metric.

SKILL.md is an index. The references are:

  • references/setup.md: packages, files, block map, CMS handles, withDeco, scripts, image loader, request metric
  • references/proxy-and-drafts.md: proxy.ts, the draft route, bindDraft, preview hosts, debugging drafts
  • references/rendering.md: the page function, results and errors, sections, the two routes, routes the app owns
  • references/metadata-seo.md: generateMetadata from page.seo, noindex on drafts
  • references/caching.md: the assignments route, revalidate, what makes a page dynamic, CDN keys, stale content
  • references/studio-bridge.md: StudioBridge, StudioPage, withStudioCsp, DECO_STUDIO_ORIGIN

Sources

  • decocms/migrations: target/faststore-deco-file. Only its @decocms/nextjs binding section, which was rewritten for v8. The FastStore playbook stays in that repo.
  • New material checked against packages/nextjs/src, packages/blocks/src/v8 and examples/nextjs-binding-smoke.

Dropped because it is v7 or Fresh only

  • createNextSetup, createDecoRouteHandlers, createDecoPreviewPage, the /setup and /routeHandlers subpaths, and withDeco adding rewrites or transpilePackages. The skill says these are gone and points to deco-v7-to-v8-migration.
  • src/sections/* shims used as block keys, and generate:deco writing .deco/*.gen.*. In v8 these are the block map in .deco/index.tsx, deco schema and deco content.
  • FastStore, WebOps and Synerise rules. Only one generic note stays: if the host skips devDependencies, keep @decocms/blocks in dependencies.

Fact-check

A second pass checked every export, option, header, CLI command and behavior against the code. Fixes in the second commit:

  • react-dom is not a peer of @decocms/nextjs. Only next and react are.
  • createCMS keeps one instance per site (or per content module), not one per set of options.
  • decideVisitor holds back the cookie only when the request renders a draft or an old release.
  • bindDraft binds the visitor and assignments on the current release only when that release saves an experiments or campaigns block.
  • An unavailable draft shows its own notice, not the "Preview mode" badge.
  • contentClient does not read the request. bindDraft does.

Not verified, or open

  • packages/nextjs/README.md calls decideDraft with 3 arguments, and documents a createCMS({ dev }) option that does not exist. examples/content-module.mjs says there is no deco content command, but there is one. The skill follows the code. The README and the comment can be fixed in a separate PR.
  • The example's src/app/blog/page.tsx calls contentClient without calling bindDraft first, so it ignores the proxy's forwarded version and assignments. The skill tells sites to call bindDraft first.
  • Neither the code nor the example shows how a site with site set previews local .deco/blocks edits in development. The skill sends readers to deco-site-workflow for that.
  • AnalyticsScript usage in a Next root layout was not verified, so it is left out.
  • The skill names sibling skills that are not on main yet: deco-site-workflow, deco-site-authoring, deco-cms-schema, deco-variants, deco-images-media, deco-storefront-caching and deco-tanstack-site. They are named in plain text, not linked.

Note for sibling skill PRs

This PR regenerates the skills table in .agents/skills/README.md. Other skill PRs that also touch that table will conflict with it. After rebasing onto main, run bun run skills:readme and commit the result.

bun run skills:check passes.

🤖 Generated with Claude Code


Summary by cubic

Adds the deco-nextjs-site agent skill: a documentation set for wiring a Next.js App Router site to @decocms/nextjs 8 (with @decocms/blocks 8, Next 16, React 19). It ships an index plus six references covering setup, the proxy and draft previews, page rendering, seo metadata, ISR caching, and the Studio bridge.

The content is checked against packages/nextjs/src, packages/blocks/src/v8, and examples/nextjs-binding-smoke; a second pass corrected behaviors like peer dependencies, createCMS instance sharing, and bindDraft scope. v7 and Fresh-only material is dropped and pointed to deco-v7-to-v8-migration.

Notes

  • Regenerates the skills table in .agents/skills/README.md; other skill PRs touching that table will conflict — rebase onto main and run bun run skills:readme.
  • The skill follows the code where packages/nextjs/README.md and the example disagree with it; those can be fixed separately.
  • References sibling skills not yet on main in plain text, not linked.

Written for commit f36ebe4. Summary will update on new commits.

View guided diff Turn on auto-fix

tlgimenes and others added 2 commits November 9, 2026 15:20
Wiring a Next.js App Router site to @decocms/nextjs 8: setup and the
block map, the proxy and draft previews, rendering resolved pages in
Server Components, metadata from the seo block, ISR on the assignments
route, and the Studio bridge. Written from packages/nextjs and
examples/nextjs-binding-smoke.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- react-dom is not a peer of @decocms/nextjs; only next and react are.
- createCMS shares one instance per site (or content module), not per
  set of options.
- decideVisitor withholds the cookie only when a draft or old release
  renders, not on every preview signal.
- bindDraft binds the forwarded visitor and assignments on the release
  only when it saves an experiments or campaigns block.
- The unavailable-draft case shows a separate notice, not the badge.
- contentClient does not read the request itself; bindDraft does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@tlgimenes
tlgimenes requested a review from a team November 9, 2026 18:34
tlgimenes added a commit that referenced this pull request Nov 9, 2026
## What this adds

This brings the agent skills for building sites on `@decocms/blocks` 8
into `.agents/skills/`. They come from decocms/skills,
decocms/storefront-skills, decocms/migrations and the 7.x branch, and
each was rewritten against the v8 code in `packages/`. It also adds
`deco skills install`, which ships the skills with the package.

It replaces #786–#799 (the one-PR-per-skill versions) with the same
commits, cherry-picked onto main, plus a regenerated skills table.

| Skill | Covers |
|---|---|
| `deco-site-workflow` | the `deco` CLI end to end: schema and schema
push on deploy, pull, push, drafts, publish, check, delivery, previewing
in Studio |
| `deco-tanstack-site` / `deco-nextjs-site` | wiring each binding |
| `deco-site-authoring` | sections, pages, loaders, lazy blocks, SEO |
| `deco-cms-schema` | Props → Studio form |
| `deco-make-editable` | hardcoded site or Figma design → editable
blocks |
| `deco-variants` | multivariate blocks, matchers, draft preview |
| `deco-images-media` | image providers, components, LCP, video |
| `deco-storefront-caching` | worker page cache, cache keys, egress |
| `deco-storefront-performance` | N+1, payload trim, hydration, worker
memory |
| `deco-go-live` | cutover and QA |
| `deco-apps` | the thin `@decocms/apps-*` clients |
| `deco-v7-to-v8-migration` | `reference/` → `references/`, split to fit
the size budgets, claims corrected |

**`deco skills install`** copies the skills that ship with the installed
`@decocms/blocks` into the site's `.claude/skills`, or another folder
with `--dir`. It works offline. Blocks' build copies `.agents/skills`
into `packages/blocks/skills/` (git-ignored, listed in `files`).
Studio's banners will tell the agent to run it, then load
`deco-site-workflow`.

Every API, flag and path was checked twice against `packages/`: once by
the writer and once by an independent review. What only existed in v7 or
Fresh was dropped, not ported. Customer names are anonymized. `deco
serve` was removed in 8.10, and `deco-site-workflow` says so.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds agent skills for building sites on `@decocms/blocks` 8 to
`.agents/skills/`, rewritten against the v8 code in `packages/`, plus
`deco skills install` to ship them with the package.

**New Features**

- Thirteen skills cover the `deco` CLI workflow, the TanStack and
Next.js bindings, authoring, schema forms, making sites editable,
variants, images/media, caching, performance, go-live, the
`@decocms/apps-*` clients, and v7→v8 migration.
- `deco skills install` copies the bundled skills into the site's
`.claude/skills` (or `--dir`), works offline, and replaces only the
folders it ships.
- Content that existed only in v7 or Fresh was dropped, and every API,
flag and path was verified twice against the code in `packages/`.

<sup>Written for commit fd2dfcd.
Summary will update on new commits.</sup>

<a href="https://cubic.dev/pr/decocms/blocks/pull/800?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="View guided diff"
src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<a
href="https://www.cubic.dev/action/auto-fix/pr/decocms/blocks/800?returnTo=https%3A%2F%2Fgithub.com%2Fdecocms%2Fblocks%2Fpull%2F800&source=description"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img
alt="Turn on auto-fix"
src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>

<!-- End of auto-generated description by cubic. -->

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
@tlgimenes

Copy link
Copy Markdown
Contributor Author

Superseded by #800, which merged these commits together.

@tlgimenes tlgimenes closed this Nov 9, 2026
@tlgimenes
tlgimenes deleted the skills/deco-nextjs-site branch November 9, 2026 19:06
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