Skip to content

docs(skills): add deco-site-authoring - #795

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

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

Conversation

@tlgimenes

@tlgimenes tlgimenes commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

What this adds

A new agent skill, .agents/skills/deco-site-authoring, for writing sections, pages and loaders on @decocms/blocks 8 with @decocms/tanstack or @decocms/nextjs. It covers:

  • block functions in .deco/index.ts and their Props
  • sections as render descriptors or React elements
  • "use client" components in place of islands or HTMX
  • page blocks, path templates and route params
  • loaders as block functions, run once per distinct input per client
  • SEO and JSON-LD fed by the same loader as the page
  • the built-in lazy block, one promise per section with Suspense, and loading skeletons
  • the review to run before deco push

SKILL.md is an index. The references are:

  • references/sections.md
  • references/pages.md
  • references/loaders.md
  • references/lazy-blocks.md
  • references/seo.md
  • references/review-before-publish.md

Sources consolidated

  • decocms/skills: new-section, new-page, review, seo-sections (core idea only), deco-async-rendering-site-guide (skeleton craft only)
  • decocms/blocks 7.x .agents/skills/deco-cms-route-config (its seo.md checklist)
  • New material from packages/blocks/src/v8 (resolver, builtins, lazy, matchRoute, the schema generator, deco check) and from the examples

Dropped as v7/Fresh-only

  • The Fresh islands/ folder and HTMX hx-* requests. They become "use client" components plus server functions or server actions.
  • Section-level export const loader = (props, req, ctx) and ctx.invoke. In v8 a block function gets one argument. @decocms/compat-v7/sections is mentioned for migrations only.
  • website/functions/requestToParam.ts and the /:slug* splat. v8 uses matchRoute params passed by the page loader, and only a trailing /*.
  • Studio admin tools for editing JSON (updateJson, patchFile and others). They are replaced by Studio, deco diff / push --draft / publish, and git.
  • website/pages/Page.tsx and SeoV2 as types to write. They now resolve only through legacy aliases.
  • v7 async rendering: Rendering/Lazy.tsx, LoadingFallback, setAsyncRenderingConfig, viewport-deferred sections, deferred SEO, bot-only SSR. Only the skeleton craft was kept, as Suspense fallbacks.
  • Block-level loader caching (cache: "stale-while-revalidate"). The skill points at the upstream client's fetch and at deco-storefront-caching.
  • apps/ widget and commerce imports. They are replaced by @decocms/compat-v7/types/widgets and @decocms/compat-v7/commerce/types.

Fact-check

A second pass checked every API, export, CLI flag, error message and behavior against packages/ and examples/. The second commit fixes these:

  • Functions that return their own props (like seo) are grouped as content or pages, not loaders.
  • The secrets example used an EmailClient type that no package exports. It now closes over an API key with createInstrumentedFetch.
  • DEGRADED_HEADER means awaiting every block before the page answers, so that page does not stream.
  • canonicalFromBreadcrumblist returns the item with the highest position.
  • The props object is a fresh copy. The loader results inside it are shared.
  • A site that replaces page types its own seo field.

Not verifiable in this repo

  • How route params reach blocks is a page-loader convention, not a framework API. The skill describes passing them as arguments (c.resolve({ ...section, slug }), or a nested loader resolved through currentClient().resolve), which the resolver supports. The docs site (/next/*) is not in this repo. If it recommends a different convention, pages.md, loaders.md and seo.md should follow it.
  • The Next.js examples resolve the whole page in one call, so nothing streams per section and one failing block fails the page. The skill describes both setups but does not choose one for Next.js.
  • The skill links to sibling skills by name (deco-site-workflow, deco-cms-schema, deco-tanstack-site, deco-nextjs-site, deco-variants, deco-apps, deco-images-media, deco-storefront-performance, deco-storefront-caching). Those skills land in their own PRs.

README table

bun run skills:check passes. The skills table in .agents/skills/README.md was regenerated with bun run skills:readme. Sibling skill PRs regenerate the same table, so they will conflict there. After rebasing, run bun run skills:readme and commit the result.

🤖 Generated with Claude Code


Summary by cubic

Adds the deco-site-authoring agent skill for writing sections, pages, and loaders on @decocms/blocks 8 with @decocms/tanstack or @decocms/nextjs.

  • Covers block functions in .deco/index.ts, React sections as descriptors or elements, "use client" components in place of islands and HTMX, page blocks with path templates and route params, loaders as block functions, the lazy built-in with Suspense skeletons, SEO and JSON-LD, and the pre-publish review.
  • Consolidates material from existing v7/Fresh skills and new v8 sources, dropping v7-only APIs like islands/, section-level (props, req) loaders, and block-level loader caching.
  • Regenerates the skills table in .agents/skills/README.md. Sibling skill PRs may conflict on that table; run bun run skills:readme after rebasing.

Not verifiable in this repo

  • How route params reach blocks is a page-loader convention, not a framework API; the skill describes passing them as arguments.
  • The Next.js examples resolve the whole page in one call, so nothing streams per section; the skill describes both setups but does not choose one.
  • Sibling skills referenced by name land in their own PRs.

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

View guided diff Turn on auto-fix

tlgimenes and others added 2 commits November 9, 2026 15:23
Sections, pages and loaders on @decocms/blocks 8: block functions and their
Props, descriptors vs elements, client components in place of islands and
HTMX, page blocks and route params, loaders as block functions with the
per-client memo, the lazy built-in and per-section Suspense with skeletons,
SEO fed by the same loader as the page, and the review before deco push.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- loaders.md: identity functions are content or pages, not loaders
- loaders.md: the secrets example used an EmailClient type that no
  package exports; replace it with a key closed over an instrumented fetch
- loaders.md: DEGRADED_HEADER needs every block awaited before answering
- seo.md: canonicalFromBreadcrumblist picks the highest position
- sections.md: props are fresh copies; loader results inside them are shared
- pages.md: a replaced page types its own seo field

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@tlgimenes
tlgimenes requested a review from a team November 9, 2026 18:48
@tlgimenes

Copy link
Copy Markdown
Contributor Author

Superseded by #800, which merged these commits together.

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