create-content-sdk-app 2.0.0-canary.9 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.MD +202 -202
- package/dist/initializers/angular/args.js +2 -0
- package/dist/initializers/angular/index.js +30 -0
- package/dist/initializers/angular/prompts.js +20 -0
- package/dist/templates/angular/.postcssrc.json +5 -0
- package/dist/templates/angular/.vscode/extensions.json +4 -0
- package/dist/templates/angular/README.md +3 -0
- package/dist/templates/angular/angular.json +79 -0
- package/dist/templates/angular/package.json +58 -0
- package/dist/templates/angular/public/favicon.ico +0 -0
- package/dist/templates/angular/src/app/app.config.server.ts +12 -0
- package/dist/templates/angular/src/app/app.config.ts +31 -0
- package/dist/templates/angular/src/app/app.css +0 -0
- package/dist/templates/angular/src/app/app.html +1 -0
- package/dist/templates/angular/src/app/app.routes.server.ts +15 -0
- package/dist/templates/angular/src/app/app.routes.ts +28 -0
- package/dist/templates/angular/src/app/app.ts +12 -0
- package/dist/templates/angular/src/app/loaders/error.loader.ts +12 -0
- package/dist/templates/angular/src/app/loaders/index.ts +14 -0
- package/dist/templates/angular/src/app/loaders/not-found.loader.ts +12 -0
- package/dist/templates/angular/src/app/loaders/page.loader.ts +15 -0
- package/dist/templates/angular/src/app/loaders/stub-utils.ts +83 -0
- package/dist/templates/angular/src/app/pages/error.component.ts +124 -0
- package/dist/templates/angular/src/app/pages/not-found.component.ts +85 -0
- package/dist/templates/angular/src/app/pages/page.component.ts +58 -0
- package/dist/templates/angular/src/app/shared/layout.component.ts +106 -0
- package/dist/templates/angular/src/index.html +13 -0
- package/dist/templates/angular/src/main.server.ts +8 -0
- package/dist/templates/angular/src/main.ts +6 -0
- package/dist/templates/angular/src/server.ts +65 -0
- package/dist/templates/angular/src/styles.css +3 -0
- package/dist/templates/angular/tsconfig.json +38 -0
- package/dist/templates/angular/tsconfig.spec.json +10 -0
- package/dist/templates/nextjs/.cursor/rules/general.mdc +81 -81
- package/dist/templates/nextjs/.cursor/rules/javascript.mdc +112 -112
- package/dist/templates/nextjs/.cursor/rules/project-setup.mdc +100 -100
- package/dist/templates/nextjs/.cursor/rules/sitecore.mdc +150 -150
- package/dist/templates/nextjs/.env.container.example +27 -27
- package/dist/templates/nextjs/.env.remote.example +51 -51
- package/dist/templates/nextjs/.gitattributes +11 -11
- package/dist/templates/nextjs/.prettierrc +8 -8
- package/dist/templates/nextjs/.vscode/extensions.json +8 -8
- package/dist/templates/nextjs/.vscode/launch.json +15 -15
- package/dist/templates/nextjs/.windsurfrules +186 -186
- package/dist/templates/nextjs/AGENTS.md +0 -1
- package/dist/templates/nextjs/LICENSE.txt +202 -202
- package/dist/templates/nextjs/LLMs.txt +179 -179
- package/dist/templates/nextjs/eslint.config.mjs +81 -81
- package/dist/templates/nextjs/gitignore +28 -28
- package/dist/templates/nextjs/package.json +68 -68
- package/dist/templates/nextjs/sitecore.config.ts.example +40 -40
- package/dist/templates/nextjs/tsconfig.json +40 -40
- package/dist/templates/nextjs-app-router/.cursor/rules/app-router-setup.mdc +116 -116
- package/dist/templates/nextjs-app-router/.cursor/rules/general.mdc +80 -80
- package/dist/templates/nextjs-app-router/.cursor/rules/javascript.mdc +112 -112
- package/dist/templates/nextjs-app-router/.cursor/rules/sitecore.mdc +174 -174
- package/dist/templates/nextjs-app-router/.env.container.example +27 -27
- package/dist/templates/nextjs-app-router/.env.remote.example +51 -51
- package/dist/templates/nextjs-app-router/.gitattributes +11 -11
- package/dist/templates/nextjs-app-router/.windsurfrules +290 -290
- package/dist/templates/nextjs-app-router/AGENTS.md +0 -1
- package/dist/templates/nextjs-app-router/LLMs.txt +236 -236
- package/dist/templates/nextjs-app-router/eslint.config.mjs +29 -29
- package/dist/templates/nextjs-app-router/gitignore +31 -31
- package/dist/templates/nextjs-app-router/package.json +54 -54
- package/dist/templates/nextjs-app-router/postcss.config.mjs +5 -5
- package/dist/templates/nextjs-app-router/sitecore.config.ts.example +40 -40
- package/dist/templates/nextjs-app-router/src/app/globals.css +1 -1
- package/dist/templates/nextjs-app-router/tsconfig.json +48 -48
- package/package.json +2 -2
- package/dist/templates/nextjs/.agents/skills/content-sdk-component-data-strategy/SKILL.md +0 -37
- package/dist/templates/nextjs/.agents/skills/content-sdk-component-registration/SKILL.md +0 -36
- package/dist/templates/nextjs/.agents/skills/content-sdk-component-scaffold/SKILL.md +0 -34
- package/dist/templates/nextjs/.agents/skills/content-sdk-component-variants/SKILL.md +0 -36
- package/dist/templates/nextjs/.agents/skills/content-sdk-dictionary-and-i18n/SKILL.md +0 -35
- package/dist/templates/nextjs/.agents/skills/content-sdk-editing-safe-rendering/SKILL.md +0 -37
- package/dist/templates/nextjs/.agents/skills/content-sdk-field-usage-image-link-text/SKILL.md +0 -36
- package/dist/templates/nextjs/.agents/skills/content-sdk-graphql-data-fetching/SKILL.md +0 -38
- package/dist/templates/nextjs/.agents/skills/content-sdk-multisite-management/SKILL.md +0 -37
- package/dist/templates/nextjs/.agents/skills/content-sdk-route-configuration/SKILL.md +0 -38
- package/dist/templates/nextjs/.agents/skills/content-sdk-site-setup-and-env/SKILL.md +0 -36
- package/dist/templates/nextjs/.agents/skills/content-sdk-sitemap-robots/SKILL.md +0 -37
- package/dist/templates/nextjs/.agents/skills/content-sdk-troubleshoot-editing/SKILL.md +0 -39
- package/dist/templates/nextjs/.agents/skills/content-sdk-upgrade-assistant/SKILL.md +0 -36
- package/dist/templates/nextjs/Skills.md +0 -79
- package/dist/templates/nextjs-app-router/.agents/skills/content-sdk-component-data-strategy/SKILL.md +0 -37
- package/dist/templates/nextjs-app-router/.agents/skills/content-sdk-component-registration/SKILL.md +0 -38
- package/dist/templates/nextjs-app-router/.agents/skills/content-sdk-component-scaffold/SKILL.md +0 -38
- package/dist/templates/nextjs-app-router/.agents/skills/content-sdk-component-variants/SKILL.md +0 -36
- package/dist/templates/nextjs-app-router/.agents/skills/content-sdk-dictionary-and-i18n/SKILL.md +0 -37
- package/dist/templates/nextjs-app-router/.agents/skills/content-sdk-editing-safe-rendering/SKILL.md +0 -37
- package/dist/templates/nextjs-app-router/.agents/skills/content-sdk-field-usage-image-link-text/SKILL.md +0 -36
- package/dist/templates/nextjs-app-router/.agents/skills/content-sdk-graphql-data-fetching/SKILL.md +0 -37
- package/dist/templates/nextjs-app-router/.agents/skills/content-sdk-multisite-management/SKILL.md +0 -37
- package/dist/templates/nextjs-app-router/.agents/skills/content-sdk-route-configuration/SKILL.md +0 -38
- package/dist/templates/nextjs-app-router/.agents/skills/content-sdk-site-setup-and-env/SKILL.md +0 -36
- package/dist/templates/nextjs-app-router/.agents/skills/content-sdk-sitemap-robots/SKILL.md +0 -37
- package/dist/templates/nextjs-app-router/.agents/skills/content-sdk-troubleshoot-editing/SKILL.md +0 -39
- package/dist/templates/nextjs-app-router/.agents/skills/content-sdk-upgrade-assistant/SKILL.md +0 -36
- package/dist/templates/nextjs-app-router/Skills.md +0 -79
package/dist/templates/nextjs-app-router/.agents/skills/content-sdk-multisite-management/SKILL.md
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: content-sdk-multisite-management
|
|
3
|
-
description: Handles multisite: site resolution, .sitecore/sites.json, and proxy in src/proxy.ts. App Router proxy order is fixed: LocaleProxy → AppRouterMultisiteProxy → RedirectsProxy → PersonalizeProxy. Use when working with multiple sites or hostnames.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Content SDK Multisite Management (App Router)
|
|
7
|
-
|
|
8
|
-
Site resolution from request (e.g. hostname or cookie); proxy rewrites to /[site]/[locale]/...path. **Locale must run first** so next-intl and multisite see the correct locale.
|
|
9
|
-
|
|
10
|
-
## When to Use
|
|
11
|
-
|
|
12
|
-
- User asks about multiple sites, hostnames, or site resolution.
|
|
13
|
-
- Task involves .sitecore/sites.json, multisite config, or proxy/middleware for site.
|
|
14
|
-
- User mentions "multisite," "site resolution," "hostname," or "sites.json."
|
|
15
|
-
|
|
16
|
-
## How to perform
|
|
17
|
-
|
|
18
|
-
- Site list: `.sitecore/sites.json`. Proxy logic lives in `src/proxy.ts`; ensure `src/middleware.ts` re-exports it if present. Keep chain order: LocaleProxy → AppRouterMultisiteProxy → RedirectsProxy → PersonalizeProxy. Exclude API, _next, static assets in the matcher.
|
|
19
|
-
|
|
20
|
-
## Hard Rules
|
|
21
|
-
|
|
22
|
-
- Site list is in `.sitecore/sites.json` (typically generated by Sitecore CLI or deployment). Avoid hand-editing unless the format is known.
|
|
23
|
-
- **Proxy:** Implemented in `src/proxy.ts`. Next.js runs middleware from `middleware.ts` at root or in `src/` — if the app only has `proxy.ts`, add `src/middleware.ts` that re-exports it.
|
|
24
|
-
- **Chain order is fixed:** LocaleProxy → AppRouterMultisiteProxy → RedirectsProxy → PersonalizeProxy. **Do not change this order.** LocaleProxy runs first so i18n and multisite see the correct locale. AppRouterMultisiteProxy rewrites to /[site]/[locale]/[...path].
|
|
25
|
-
- **Matcher:** Exclude API routes, _next/, sitemap, robots, healthz, Sitecore paths, and static assets so the proxy stays lightweight.
|
|
26
|
-
- Config: sitecore.config.ts → multisite, redirects, personalize. Single SitecoreClient; pass resolved site and locale from route params into getPage, getDictionary, etc.
|
|
27
|
-
|
|
28
|
-
## Stop Conditions
|
|
29
|
-
|
|
30
|
-
- Stop if the user wants to reorder the proxy chain; explain that LocaleProxy must run first for App Router.
|
|
31
|
-
- Stop if sites.json format is unknown and the change could break resolution; suggest checking SDK docs or CLI output.
|
|
32
|
-
- Do not add a second site resolution mechanism; use the existing proxy and config.
|
|
33
|
-
|
|
34
|
-
## References
|
|
35
|
-
|
|
36
|
-
- [AGENTS.md](../../../AGENTS.md) for proxy chain, matcher, and multisite config.
|
|
37
|
-
- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html).
|
package/dist/templates/nextjs-app-router/.agents/skills/content-sdk-route-configuration/SKILL.md
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: content-sdk-route-configuration
|
|
3
|
-
description: Configures routing and layout for App Router. Single catch-all at src/app/[site]/[locale]/[[...path]]/page.tsx; call setRequestLocale at top of page. Use when changing routing, placeholders, or Layout.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Content SDK Route Configuration (App Router)
|
|
7
|
-
|
|
8
|
-
Single catch-all route and layout hierarchy. Site and locale are **in the path**; proxy rewrites incoming requests to /[site]/[locale]/...path.
|
|
9
|
-
|
|
10
|
-
## When to Use
|
|
11
|
-
|
|
12
|
-
- User asks to change routing, add a route, or fix 404/not-found behavior.
|
|
13
|
-
- Task involves catch-all route, placeholders, root layout, or Layout.tsx.
|
|
14
|
-
- User mentions "[site]," "[locale]," "[[...path]]," "placeholder," or "layout hierarchy."
|
|
15
|
-
|
|
16
|
-
## How to perform
|
|
17
|
-
|
|
18
|
-
- Single Sitecore page: `src/app/[site]/[locale]/[[...path]]/page.tsx`. Use `await params` for `{ site, locale, path? }`; pass to getPage and call `setRequestLocale(\`${site}_${locale}\`)` at the top. Layout: app/layout.tsx → app/[site]/layout.tsx (Bootstrap, draftMode) → page. Not-found: use parseRewriteHeader and getErrorPage in the route's not-found.tsx.
|
|
19
|
-
|
|
20
|
-
## Hard Rules
|
|
21
|
-
|
|
22
|
-
- **Single Sitecore page:** `src/app/[site]/[locale]/[[...path]]/page.tsx`. This is the **only** page that renders Sitecore content. Do not add another page or catch-all for Sitecore content.
|
|
23
|
-
- **Params:** Next.js 15+ — `params` is a Promise. Use `await params` to get `{ site, locale, path? }`. Pass `site` and `locale` to `client.getPage(path ?? [], { site, locale })`.
|
|
24
|
-
- **Locale for next-intl:** Call `setRequestLocale(\`${site}_${locale}\`)` at the **top** of the page so next-intl and `src/i18n/request.ts` see the correct locale. Do not omit when adding new page branches.
|
|
25
|
-
- **Layout hierarchy:** `app/layout.tsx` → `app/[site]/layout.tsx` (Bootstrap with `siteName={site}` and `draftMode()`) → page. Do not put site/locale-specific data fetching in the root layout.
|
|
26
|
-
- Placeholders are rendered by the layout (e.g. Placeholder component); do not change placeholder names or structure without aligning with Sitecore layout definition.
|
|
27
|
-
- **Not-found:** `src/app/[site]/[locale]/[[...path]]/not-found.tsx`. For Sitecore-driven 404 use `parseRewriteHeader(headers())` for site/locale, then `client.getErrorPage(ErrorPage.NotFound, { site, locale })`. Wrap in Suspense if using async logic.
|
|
28
|
-
|
|
29
|
-
## Stop Conditions
|
|
30
|
-
|
|
31
|
-
- Stop if the user wants to add a second catch-all or a different URL shape for Sitecore pages; explain single-entry-point constraint.
|
|
32
|
-
- Stop if changing proxy/middleware order; order is fixed (LocaleProxy → AppRouterMultisiteProxy → RedirectsProxy → PersonalizeProxy).
|
|
33
|
-
- Do not move or rename the catch-all file without updating all references.
|
|
34
|
-
|
|
35
|
-
## References
|
|
36
|
-
|
|
37
|
-
- [AGENTS.md](../../../AGENTS.md) for exact paths, params, and layout hierarchy.
|
|
38
|
-
- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html).
|
package/dist/templates/nextjs-app-router/.agents/skills/content-sdk-site-setup-and-env/SKILL.md
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: content-sdk-site-setup-and-env
|
|
3
|
-
description: Configures site and environment: sitecore.config.ts, environment variables, default site and language. Use when configuring the app or adding env vars. Document in .env.example only; never commit .env or .env.local.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Content SDK Site Setup and Environment (App Router)
|
|
7
|
-
|
|
8
|
-
Central config in sitecore.config.ts; all secrets and environment-specific values via env vars.
|
|
9
|
-
|
|
10
|
-
## When to Use
|
|
11
|
-
|
|
12
|
-
- User asks to configure site, default language, API host, or environment.
|
|
13
|
-
- Task involves sitecore.config.ts, .env, or defaultSite/defaultLanguage.
|
|
14
|
-
- User mentions "config," "environment variables," "API key," or "default site."
|
|
15
|
-
|
|
16
|
-
## How to perform
|
|
17
|
-
|
|
18
|
-
- Edit `sitecore.config.ts` with `defineConfig`; read all secrets and env-specific values from `process.env.*`. Add or change vars in `.env.example` (or `.env.remote.example` / `.env.container.example`) with placeholders; never commit `.env` or `.env.local`.
|
|
19
|
-
|
|
20
|
-
## Hard Rules
|
|
21
|
-
|
|
22
|
-
- Use `sitecore.config.ts` with `defineConfig` from the SDK. Expose api (edge, local), defaultSite, defaultLanguage, editingSecret, multisite, redirects, personalize as needed.
|
|
23
|
-
- All sensitive or environment-specific values must come from environment variables (e.g. process.env.SITECORE_API_KEY). Never hardcode API keys, secrets, or production URLs in source.
|
|
24
|
-
- Document every new or changed env var in `.env.example` (or `.env.remote.example` / `.env.container.example`). Use placeholder or empty value and a short comment; never put real secrets in example files.
|
|
25
|
-
- Never commit `.env` or `.env.local`; they are gitignored. Example files are the source of truth for which vars exist.
|
|
26
|
-
|
|
27
|
-
## Stop Conditions
|
|
28
|
-
|
|
29
|
-
- Stop if the user wants to commit real secrets or production values; insist on env vars and .env.example only.
|
|
30
|
-
- Stop if adding a new env var would require CI or deployment changes without explicit instruction; document the var and note that deployment must set it.
|
|
31
|
-
- Do not edit .next/, node_modules/, or lockfiles unless the task explicitly requires it.
|
|
32
|
-
|
|
33
|
-
## References
|
|
34
|
-
|
|
35
|
-
- [AGENTS.md](../../../AGENTS.md) for boundaries and env rules.
|
|
36
|
-
- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html).
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: content-sdk-sitemap-robots
|
|
3
|
-
description: Sitemap and robots.txt for App Router: src/app/api/sitemap/route.ts and src/app/api/robots/route.ts with createSitemapRouteHandler and createRobotsRouteHandler. Rewrites in next.config.ts. Use when configuring sitemap, robots.txt, or SEO.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Content SDK Sitemap and Robots (App Router)
|
|
7
|
-
|
|
8
|
-
Sitemap and robots.txt are served via **route handlers** and rewrites. Use the SDK route handler helpers and sites from .sitecore/sites.json.
|
|
9
|
-
|
|
10
|
-
## When to Use
|
|
11
|
-
|
|
12
|
-
- User asks to add or change sitemap or robots.txt.
|
|
13
|
-
- Task involves SEO, sitemap.xml, or robots route.
|
|
14
|
-
- User mentions "sitemap," "robots," "SEO," or "rewrites."
|
|
15
|
-
|
|
16
|
-
## How to perform
|
|
17
|
-
|
|
18
|
-
- Sitemap: `src/app/api/sitemap/route.ts` with `createSitemapRouteHandler({ client, sites })`; robots: `src/app/api/robots/route.ts` with `createRobotsRouteHandler({ client, sites })`. Use sites from `.sitecore/sites.json`. Add rewrites in `next.config.ts` for `/sitemap*.xml` and `/robots.txt` with `locale: false`. Set `dynamic = 'force-dynamic'` if needed.
|
|
19
|
-
|
|
20
|
-
## Hard Rules
|
|
21
|
-
|
|
22
|
-
- **Sitemap:** `src/app/api/sitemap/route.ts` — use `createSitemapRouteHandler({ client, sites })`. Export `{ GET }`. Use `sites` from `.sitecore/sites.json`. Set `export const dynamic = 'force-dynamic'` if the handler relies on request.
|
|
23
|
-
- **Robots:** `src/app/api/robots/route.ts` — use `createRobotsRouteHandler({ client, sites })`. Same pattern.
|
|
24
|
-
- **Rewrites:** In `next.config.ts`, add rewrites for `/sitemap*.xml` and `/robots.txt` to these route handlers. Use `locale: false` so they are not localized.
|
|
25
|
-
- Use the same SitecoreClient instance as the rest of the app; do not create a dedicated client for sitemap/robots.
|
|
26
|
-
- Avoid hardcoding the site list; use .sitecore/sites.json.
|
|
27
|
-
|
|
28
|
-
## Stop Conditions
|
|
29
|
-
|
|
30
|
-
- Stop if the user wants to serve sitemap/robots from a different origin or with different auth; document and suggest proxy or edge config.
|
|
31
|
-
- Do not add new env vars for sitemap/robots without documenting them in .env.example.
|
|
32
|
-
- Do not change rewrite paths without updating docs and any references.
|
|
33
|
-
|
|
34
|
-
## References
|
|
35
|
-
|
|
36
|
-
- [AGENTS.md](../../../AGENTS.md) for API routes and rewrites.
|
|
37
|
-
- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html).
|
package/dist/templates/nextjs-app-router/.agents/skills/content-sdk-troubleshoot-editing/SKILL.md
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: content-sdk-troubleshoot-editing
|
|
3
|
-
description: Troubleshoots XM Cloud editing, preview, and design library for App Router. Check draftMode(), getPreview/getDesignLibraryData from searchParams, setRequestLocale, and component maps. Use when editing or preview does not behave as expected.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Content SDK Troubleshoot Editing (App Router)
|
|
7
|
-
|
|
8
|
-
This skill focuses on **diagnosing** editing, preview, and design library issues. For implementing editing-safe rendering (draftMode, getPreview/getDesignLibraryData, API routes), use the **content-sdk-editing-safe-rendering** skill; the two are complementary (implementation vs. troubleshooting).
|
|
9
|
-
|
|
10
|
-
Diagnose and fix editing, preview, and design library issues without breaking the single client or proxy order. This app uses **draftMode()** and **searchParams** for preview data.
|
|
11
|
-
|
|
12
|
-
## When to Use
|
|
13
|
-
|
|
14
|
-
- User reports that editing, preview, or design library is broken or inconsistent.
|
|
15
|
-
- Task involves debugging "not working in editor," missing chromes, or wrong data in preview.
|
|
16
|
-
- User mentions "editing broken," "preview not working," "design library," or "editor issues."
|
|
17
|
-
|
|
18
|
-
## How to perform
|
|
19
|
-
|
|
20
|
-
- Confirm `draftMode()` and searchParams-based getPreview/getDesignLibraryData; ensure `setRequestLocale` is called at the top of the page. Verify editing API routes are not rewritten (check proxy matcher) and both component maps include the component. Check env (editingSecret, API config) and .env.example documentation.
|
|
21
|
-
|
|
22
|
-
## Hard Rules
|
|
23
|
-
|
|
24
|
-
- **Preview flow:** Use `draftMode()` in Server Components; when enabled, use `client.getPreview(editingParams)` or `client.getDesignLibraryData(editingParams)` from **searchParams**. Ensure site/locale are passed correctly (e.g. from route params or editingParams).
|
|
25
|
-
- **next-intl:** Ensure `setRequestLocale(\`${site}_${locale}\`)` is called at the top of the page; missing setRequestLocale can cause locale or dictionary issues in editor.
|
|
26
|
-
- Editing API routes (`src/app/api/editing/config/route.ts`, `editing/render/route.ts`) must be reachable and use the same component maps (component-map.ts and component-map.client.ts) and config as the app. Check matcher in proxy.ts so /api/editing is not rewritten or blocked.
|
|
27
|
-
- Check that both component maps include all components used in the layout; missing registration causes "component not found" in editor.
|
|
28
|
-
- Environment: editingSecret and API config must be set (in env); document in .env.example only. Do not log or commit secrets.
|
|
29
|
-
|
|
30
|
-
## Stop Conditions
|
|
31
|
-
|
|
32
|
-
- Stop if the fix would require changing CI, deployment, or XM Cloud project settings; suggest the user do that and document the required env or config.
|
|
33
|
-
- Stop if the issue might be in Sitecore (layout, template) rather than the app; suggest checking layout and content in XM Cloud.
|
|
34
|
-
- Do not recommend disabling security (e.g. skipping secret validation) without explicit user request and warning.
|
|
35
|
-
|
|
36
|
-
## References
|
|
37
|
-
|
|
38
|
-
- content-sdk-editing-safe-rendering skill and [AGENTS.md](../../../AGENTS.md) for preview and editing flow.
|
|
39
|
-
- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html).
|
package/dist/templates/nextjs-app-router/.agents/skills/content-sdk-upgrade-assistant/SKILL.md
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: content-sdk-upgrade-assistant
|
|
3
|
-
description: Guides upgrading @sitecore-content-sdk/* packages: version bumps, breaking changes, migration steps. Use when moving to a newer SDK or package version. Check Content SDK repo CHANGELOG and upgrade guides.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Content SDK Upgrade Assistant (App Router)
|
|
7
|
-
|
|
8
|
-
Upgrade @sitecore-content-sdk/* packages safely; follow the Content SDK repo changelog and migration guides.
|
|
9
|
-
|
|
10
|
-
## When to Use
|
|
11
|
-
|
|
12
|
-
- User asks to upgrade SDK packages, update to a new version, or apply a migration.
|
|
13
|
-
- Task involves version bumps, @sitecore-content-sdk/* dependencies, or breaking changes.
|
|
14
|
-
- User mentions "upgrade," "migration," "new version," or "breaking change."
|
|
15
|
-
|
|
16
|
-
## How to perform
|
|
17
|
-
|
|
18
|
-
- Bump all @sitecore-content-sdk/* to consistent versions; read the Content SDK repo CHANGELOG (and MIGRATION/upgrade docs) for breaking changes and migration steps. Update package.json, run `npm install` and `npm run build`; test editing and preview after upgrade.
|
|
19
|
-
|
|
20
|
-
## Hard Rules
|
|
21
|
-
|
|
22
|
-
- Prefer upgrading all @sitecore-content-sdk/* packages together to a consistent set of versions unless the user requests a partial upgrade. Check peer dependencies and compatibility.
|
|
23
|
-
- Update dependencies in package.json; run `npm install` and `npm run build`. Test editing and preview after upgrade.
|
|
24
|
-
- Read the **Content SDK repository** CHANGELOG (and any MIGRATION.md or upgrade guide) for breaking changes and required code/config updates. Apply migration steps before or with the version bump.
|
|
25
|
-
- Do not edit .next/, node_modules/, or lockfiles unless required for the upgrade. Do not change CI or root tooling unless the task explicitly includes it.
|
|
26
|
-
|
|
27
|
-
## Stop Conditions
|
|
28
|
-
|
|
29
|
-
- Stop if the target version is not specified or unclear; ask or suggest checking the Content SDK CHANGELOG and supported versions.
|
|
30
|
-
- Stop if a breaking change requires product or deployment decisions (e.g. new env vars, config schema); list required changes and ask the user to confirm.
|
|
31
|
-
|
|
32
|
-
## References
|
|
33
|
-
|
|
34
|
-
- Content SDK repo [CHANGELOG](https://github.com/Sitecore/content-sdk/blob/dev/CHANGELOG.md) and upgrade docs.
|
|
35
|
-
- [AGENTS.md](../../../AGENTS.md) for build commands.
|
|
36
|
-
- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html).
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
# Skills.md — Capability groupings for this app (Next.js App Router)
|
|
2
|
-
|
|
3
|
-
This file describes **this application** in terms of **capability-style groupings**: high-level areas that help AI tools and developers map tasks to the right part of the app. This is an App Router app with `[site]`/`[locale]` segments, next-intl, and separate server/client component maps. For concrete steps and patterns, see [AGENTS.md](AGENTS.md) and the [official Content SDK documentation](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html).
|
|
4
|
-
|
|
5
|
-
**Agent Skills:** Each grouping is also available as a skill in [.agents/skills/](.agents/skills/) in the standard [Agent Skills](https://agentskills.io) format (`SKILL.md` per capability). Tools that support this standard can discover and load these skills automatically; the skills are tailored for **App Router** (e.g. setRequestLocale, draftMode(), component-map.ts + component-map.client.ts).
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Why capability grouping
|
|
10
|
-
|
|
11
|
-
Grouping related capabilities makes it easier to know which area of the app applies to a given task and to point to the right docs and patterns. Map the task to one or more of the groupings below; use AGENTS.md and the official docs for concrete steps.
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Capability groupings
|
|
16
|
-
|
|
17
|
-
### content-sdk-component-scaffold
|
|
18
|
-
|
|
19
|
-
Creating new Sitecore components: file structure, props interface, and placement under `src/components/`. Use when adding a new component from scratch. In App Router, decide Server vs Client and register in the appropriate map.
|
|
20
|
-
|
|
21
|
-
### content-sdk-component-registration
|
|
22
|
-
|
|
23
|
-
Registering components in `.sitecore/component-map.ts` (Server) and `.sitecore/component-map.client.ts` (Client). Required so layout and editing can resolve and render components. App Router has separate server and client maps.
|
|
24
|
-
|
|
25
|
-
### content-sdk-editing-safe-rendering
|
|
26
|
-
|
|
27
|
-
Safe rendering in XM Cloud editing and preview: `draftMode()`, editing chromes, and design library. Use when ensuring components work in the Sitecore editor and preview. Use `client.getPreview(searchParams)` or `client.getDesignLibraryData(searchParams)` when draft mode is enabled.
|
|
28
|
-
|
|
29
|
-
### content-sdk-field-usage-image-link-text
|
|
30
|
-
|
|
31
|
-
Using SDK field components: `<Text>`, `<RichText>`, `<Image>`, `<Link>`, with proper validation and fallbacks. Use when rendering Sitecore fields.
|
|
32
|
-
|
|
33
|
-
### content-sdk-graphql-data-fetching
|
|
34
|
-
|
|
35
|
-
Page and dictionary fetching via the single Sitecore client in `src/lib/sitecore-client.ts`. Use `getPage(path ?? [], { site, locale })`, `getDictionary`, `getAppRouterStaticParams` for SSG. For preview use `draftMode()` and `getPreview`/`getDesignLibraryData` from searchParams.
|
|
36
|
-
|
|
37
|
-
### content-sdk-route-configuration
|
|
38
|
-
|
|
39
|
-
Routing: single catch-all at `src/app/[site]/[locale]/[[...path]]/page.tsx`. Layout: app/layout.tsx → app/[site]/layout.tsx → page. Call `setRequestLocale(\`${site}_${locale}\`)` at top of page. Use placeholders and Layout.tsx as in AGENTS.md.
|
|
40
|
-
|
|
41
|
-
### content-sdk-site-setup-and-env
|
|
42
|
-
|
|
43
|
-
Site and environment: `sitecore.config.ts`, environment variables, default site and language. Document vars in `.env.example` only; never commit `.env` or `.env.local`.
|
|
44
|
-
|
|
45
|
-
### content-sdk-multisite-management
|
|
46
|
-
|
|
47
|
-
Multisite: `.sitecore/sites.json`, proxy in `src/proxy.ts`. Chain order is **fixed:** LocaleProxy → AppRouterMultisiteProxy → RedirectsProxy → PersonalizeProxy. Do not change proxy order.
|
|
48
|
-
|
|
49
|
-
### content-sdk-dictionary-and-i18n
|
|
50
|
-
|
|
51
|
-
Dictionary and i18n: next-intl with `src/i18n/routing.ts` and `src/i18n/request.ts`. Request locale is `${site}_${locale}`; call `setRequestLocale(\`${site}_${locale}\`)` in the page; in request.ts parse and load dictionary with `client.getDictionary({ locale, site })`.
|
|
52
|
-
|
|
53
|
-
### content-sdk-sitemap-robots
|
|
54
|
-
|
|
55
|
-
Sitemap and robots: `src/app/api/sitemap/route.ts` and `src/app/api/robots/route.ts` with `createSitemapRouteHandler` and `createRobotsRouteHandler`. Rewrites in next.config.ts for /sitemap*.xml and /robots.txt.
|
|
56
|
-
|
|
57
|
-
### content-sdk-component-variants
|
|
58
|
-
|
|
59
|
-
Component variants: different renderings or data-driven variants of the same component type. Use when one component has multiple presentations. Register in the appropriate component map (server or client).
|
|
60
|
-
|
|
61
|
-
### content-sdk-troubleshoot-editing
|
|
62
|
-
|
|
63
|
-
Troubleshooting XM Cloud editing, preview, and design library. Use when editing or preview does not behave as expected. Check draftMode(), getPreview/getDesignLibraryData from searchParams, and component maps.
|
|
64
|
-
|
|
65
|
-
### content-sdk-upgrade-assistant
|
|
66
|
-
|
|
67
|
-
Upgrading @sitecore-content-sdk/* packages: version bumps, breaking changes, migration steps. Use when moving to a newer SDK version. Check the Content SDK repo CHANGELOG and upgrade guides.
|
|
68
|
-
|
|
69
|
-
### content-sdk-component-data-strategy
|
|
70
|
-
|
|
71
|
-
Component data: layout data from getPage (or getPreview/getDesignLibraryData in editing). Pass site and locale from route params; Server Components use the client in server context; Client Components receive serializable props from parent. BYOC must be registered in the component map.
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
## How to use this
|
|
76
|
-
|
|
77
|
-
Map the task to one or more groupings above. Use [AGENTS.md](AGENTS.md) for app-level instructions and the [official documentation](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html) for APIs.
|
|
78
|
-
|
|
79
|
-
**If your tool supports Agent Skills:** Load skills from [.agents/skills/](.agents/skills/) (one folder per capability). They provide when-to-use, hard rules, and stop conditions tailored for this App Router app.
|