@jahia/agentic 0.3.0 → 0.4.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.
Files changed (153) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/claude/.claude/agents/cnd-child-nodes.md +74 -0
  3. package/dist/claude/.claude/agents/cnd-jahia-mixins.md +113 -0
  4. package/dist/claude/.claude/agents/cnd-numbers-dates.md +61 -0
  5. package/dist/claude/.claude/agents/cnd-string-selectors.md +94 -0
  6. package/dist/claude/.claude/agents/jahia-cnd-author.md +130 -0
  7. package/dist/claude/.claude/agents/jahia-dev-worker.md +264 -0
  8. package/dist/claude/.claude/agents/jahia-reviewer.md +105 -0
  9. package/dist/claude/.claude/rules/jahia.md +15 -6
  10. package/dist/claude/.claude/skills/jahia/SKILL.md +5 -1
  11. package/dist/claude/.claude/skills/jahia-dev-accessibility/SKILL.md +3 -3
  12. package/dist/claude/.claude/skills/jahia-dev-build-component/SKILL.md +10 -7
  13. package/dist/claude/.claude/skills/jahia-dev-create-page-template/SKILL.md +59 -21
  14. package/dist/claude/.claude/skills/jahia-dev-create-template-set/SKILL.md +20 -47
  15. package/dist/claude/.claude/skills/jahia-dev-create-view/SKILL.md +3 -3
  16. package/dist/claude/.claude/skills/jahia-dev-define-content-type/SKILL.md +43 -486
  17. package/dist/claude/.claude/skills/jahia-dev-define-content-type/references/modeling-decisions.md +52 -0
  18. package/dist/claude/.claude/skills/jahia-dev-review-cnd/SKILL.md +79 -0
  19. package/dist/claude/.claude/skills/jahia-dev-review-cnd/scripts/check-cnd.d.mts +13 -0
  20. package/dist/claude/.claude/skills/jahia-dev-review-cnd/scripts/check-cnd.mjs +198 -0
  21. package/dist/claude/.claude/skills/jahia-dev-site-review/SKILL.md +70 -0
  22. package/dist/claude/.claude/skills/jahia-dev-site-review/scripts/review-pages.mjs +85 -0
  23. package/dist/claude/.claude/skills/jahia-dev-start-local/SKILL.md +18 -26
  24. package/dist/claude/.claude/skills/jahia-orchestrate/SKILL.md +148 -0
  25. package/dist/claude/.claude/skills/jahia-orchestrate/scripts/verify-pages.mjs +59 -0
  26. package/dist/claude/CLAUDE.md +16 -7
  27. package/dist/codex/.agents/skills/jahia/SKILL.md +5 -1
  28. package/dist/codex/.agents/skills/jahia-dev-accessibility/SKILL.md +3 -3
  29. package/dist/codex/.agents/skills/jahia-dev-build-component/SKILL.md +10 -7
  30. package/dist/codex/.agents/skills/jahia-dev-create-page-template/SKILL.md +59 -21
  31. package/dist/codex/.agents/skills/jahia-dev-create-template-set/SKILL.md +20 -47
  32. package/dist/codex/.agents/skills/jahia-dev-create-view/SKILL.md +3 -3
  33. package/dist/codex/.agents/skills/jahia-dev-define-content-type/SKILL.md +43 -486
  34. package/dist/codex/.agents/skills/jahia-dev-define-content-type/references/modeling-decisions.md +52 -0
  35. package/dist/codex/.agents/skills/jahia-dev-review-cnd/SKILL.md +79 -0
  36. package/dist/codex/.agents/skills/jahia-dev-review-cnd/scripts/check-cnd.d.mts +13 -0
  37. package/dist/codex/.agents/skills/jahia-dev-review-cnd/scripts/check-cnd.mjs +198 -0
  38. package/dist/codex/.agents/skills/jahia-dev-site-review/SKILL.md +70 -0
  39. package/dist/codex/.agents/skills/jahia-dev-site-review/scripts/review-pages.mjs +85 -0
  40. package/dist/codex/.agents/skills/jahia-dev-start-local/SKILL.md +18 -26
  41. package/dist/codex/.agents/skills/jahia-orchestrate/SKILL.md +148 -0
  42. package/dist/codex/.agents/skills/jahia-orchestrate/scripts/verify-pages.mjs +59 -0
  43. package/dist/codex/.codex/agents/cnd-child-nodes.toml +3 -0
  44. package/dist/codex/.codex/agents/cnd-jahia-mixins.toml +3 -0
  45. package/dist/codex/.codex/agents/cnd-numbers-dates.toml +3 -0
  46. package/dist/codex/.codex/agents/cnd-string-selectors.toml +3 -0
  47. package/dist/codex/.codex/agents/jahia-cnd-author.toml +3 -0
  48. package/dist/codex/.codex/agents/jahia-dev-worker.toml +3 -0
  49. package/dist/codex/.codex/agents/jahia-reviewer.toml +3 -0
  50. package/dist/codex/AGENTS.md +17 -8
  51. package/dist/copilot/.agents/skills/jahia/SKILL.md +5 -1
  52. package/dist/copilot/.agents/skills/jahia-dev-accessibility/SKILL.md +3 -3
  53. package/dist/copilot/.agents/skills/jahia-dev-build-component/SKILL.md +10 -7
  54. package/dist/copilot/.agents/skills/jahia-dev-create-page-template/SKILL.md +59 -21
  55. package/dist/copilot/.agents/skills/jahia-dev-create-template-set/SKILL.md +20 -47
  56. package/dist/copilot/.agents/skills/jahia-dev-create-view/SKILL.md +3 -3
  57. package/dist/copilot/.agents/skills/jahia-dev-define-content-type/SKILL.md +43 -486
  58. package/dist/copilot/.agents/skills/jahia-dev-define-content-type/references/modeling-decisions.md +52 -0
  59. package/dist/copilot/.agents/skills/jahia-dev-review-cnd/SKILL.md +79 -0
  60. package/dist/copilot/.agents/skills/jahia-dev-review-cnd/scripts/check-cnd.d.mts +13 -0
  61. package/dist/copilot/.agents/skills/jahia-dev-review-cnd/scripts/check-cnd.mjs +198 -0
  62. package/dist/copilot/.agents/skills/jahia-dev-site-review/SKILL.md +70 -0
  63. package/dist/copilot/.agents/skills/jahia-dev-site-review/scripts/review-pages.mjs +85 -0
  64. package/dist/copilot/.agents/skills/jahia-dev-start-local/SKILL.md +18 -26
  65. package/dist/copilot/.agents/skills/jahia-orchestrate/SKILL.md +148 -0
  66. package/dist/copilot/.agents/skills/jahia-orchestrate/scripts/verify-pages.mjs +59 -0
  67. package/dist/copilot/AGENTS.md +17 -8
  68. package/dist/cursor/.agents/skills/jahia/SKILL.md +5 -1
  69. package/dist/cursor/.agents/skills/jahia-dev-accessibility/SKILL.md +3 -3
  70. package/dist/cursor/.agents/skills/jahia-dev-build-component/SKILL.md +10 -7
  71. package/dist/cursor/.agents/skills/jahia-dev-create-page-template/SKILL.md +59 -21
  72. package/dist/cursor/.agents/skills/jahia-dev-create-template-set/SKILL.md +20 -47
  73. package/dist/cursor/.agents/skills/jahia-dev-create-view/SKILL.md +3 -3
  74. package/dist/cursor/.agents/skills/jahia-dev-define-content-type/SKILL.md +43 -486
  75. package/dist/cursor/.agents/skills/jahia-dev-define-content-type/references/modeling-decisions.md +52 -0
  76. package/dist/cursor/.agents/skills/jahia-dev-review-cnd/SKILL.md +79 -0
  77. package/dist/cursor/.agents/skills/jahia-dev-review-cnd/scripts/check-cnd.d.mts +13 -0
  78. package/dist/cursor/.agents/skills/jahia-dev-review-cnd/scripts/check-cnd.mjs +198 -0
  79. package/dist/cursor/.agents/skills/jahia-dev-site-review/SKILL.md +70 -0
  80. package/dist/cursor/.agents/skills/jahia-dev-site-review/scripts/review-pages.mjs +85 -0
  81. package/dist/cursor/.agents/skills/jahia-dev-start-local/SKILL.md +18 -26
  82. package/dist/cursor/.agents/skills/jahia-orchestrate/SKILL.md +148 -0
  83. package/dist/cursor/.agents/skills/jahia-orchestrate/scripts/verify-pages.mjs +59 -0
  84. package/dist/cursor/.cursor/agents/cnd-child-nodes.md +74 -0
  85. package/dist/cursor/.cursor/agents/cnd-jahia-mixins.md +113 -0
  86. package/dist/cursor/.cursor/agents/cnd-numbers-dates.md +61 -0
  87. package/dist/cursor/.cursor/agents/cnd-string-selectors.md +94 -0
  88. package/dist/cursor/.cursor/agents/jahia-cnd-author.md +130 -0
  89. package/dist/cursor/.cursor/agents/jahia-dev-worker.md +264 -0
  90. package/dist/cursor/.cursor/agents/jahia-reviewer.md +105 -0
  91. package/dist/cursor/.cursor/rules/jahia.mdc +15 -6
  92. package/dist/gemini/.agents/skills/jahia/SKILL.md +5 -1
  93. package/dist/gemini/.agents/skills/jahia-dev-accessibility/SKILL.md +3 -3
  94. package/dist/gemini/.agents/skills/jahia-dev-build-component/SKILL.md +10 -7
  95. package/dist/gemini/.agents/skills/jahia-dev-create-page-template/SKILL.md +59 -21
  96. package/dist/gemini/.agents/skills/jahia-dev-create-template-set/SKILL.md +20 -47
  97. package/dist/gemini/.agents/skills/jahia-dev-create-view/SKILL.md +3 -3
  98. package/dist/gemini/.agents/skills/jahia-dev-define-content-type/SKILL.md +43 -486
  99. package/dist/gemini/.agents/skills/jahia-dev-define-content-type/references/modeling-decisions.md +52 -0
  100. package/dist/gemini/.agents/skills/jahia-dev-review-cnd/SKILL.md +79 -0
  101. package/dist/gemini/.agents/skills/jahia-dev-review-cnd/scripts/check-cnd.d.mts +13 -0
  102. package/dist/gemini/.agents/skills/jahia-dev-review-cnd/scripts/check-cnd.mjs +198 -0
  103. package/dist/gemini/.agents/skills/jahia-dev-site-review/SKILL.md +70 -0
  104. package/dist/gemini/.agents/skills/jahia-dev-site-review/scripts/review-pages.mjs +85 -0
  105. package/dist/gemini/.agents/skills/jahia-dev-start-local/SKILL.md +18 -26
  106. package/dist/gemini/.agents/skills/jahia-orchestrate/SKILL.md +148 -0
  107. package/dist/gemini/.agents/skills/jahia-orchestrate/scripts/verify-pages.mjs +59 -0
  108. package/dist/gemini/AGENTS.md +17 -8
  109. package/dist/gemini/GEMINI.md +2 -2
  110. package/dist/index.js +13 -0
  111. package/dist/opencode/.agents/skills/jahia/SKILL.md +5 -1
  112. package/dist/opencode/.agents/skills/jahia-dev-accessibility/SKILL.md +3 -3
  113. package/dist/opencode/.agents/skills/jahia-dev-build-component/SKILL.md +10 -7
  114. package/dist/opencode/.agents/skills/jahia-dev-create-page-template/SKILL.md +59 -21
  115. package/dist/opencode/.agents/skills/jahia-dev-create-template-set/SKILL.md +20 -47
  116. package/dist/opencode/.agents/skills/jahia-dev-create-view/SKILL.md +3 -3
  117. package/dist/opencode/.agents/skills/jahia-dev-define-content-type/SKILL.md +43 -486
  118. package/dist/opencode/.agents/skills/jahia-dev-define-content-type/references/modeling-decisions.md +52 -0
  119. package/dist/opencode/.agents/skills/jahia-dev-review-cnd/SKILL.md +79 -0
  120. package/dist/opencode/.agents/skills/jahia-dev-review-cnd/scripts/check-cnd.d.mts +13 -0
  121. package/dist/opencode/.agents/skills/jahia-dev-review-cnd/scripts/check-cnd.mjs +198 -0
  122. package/dist/opencode/.agents/skills/jahia-dev-site-review/SKILL.md +70 -0
  123. package/dist/opencode/.agents/skills/jahia-dev-site-review/scripts/review-pages.mjs +85 -0
  124. package/dist/opencode/.agents/skills/jahia-dev-start-local/SKILL.md +18 -26
  125. package/dist/opencode/.agents/skills/jahia-orchestrate/SKILL.md +148 -0
  126. package/dist/opencode/.agents/skills/jahia-orchestrate/scripts/verify-pages.mjs +59 -0
  127. package/dist/opencode/.opencode/agents/cnd-child-nodes.md +74 -0
  128. package/dist/opencode/.opencode/agents/cnd-jahia-mixins.md +113 -0
  129. package/dist/opencode/.opencode/agents/cnd-numbers-dates.md +61 -0
  130. package/dist/opencode/.opencode/agents/cnd-string-selectors.md +94 -0
  131. package/dist/opencode/.opencode/agents/jahia-cnd-author.md +130 -0
  132. package/dist/opencode/.opencode/agents/jahia-dev-worker.md +264 -0
  133. package/dist/opencode/.opencode/agents/jahia-reviewer.md +105 -0
  134. package/dist/opencode/AGENTS.md +17 -8
  135. package/dist/windsurf/.windsurf/rules/jahia.md +15 -6
  136. package/dist/windsurf/.windsurf/skills/jahia/SKILL.md +5 -1
  137. package/dist/windsurf/.windsurf/skills/jahia-dev-accessibility/SKILL.md +3 -3
  138. package/dist/windsurf/.windsurf/skills/jahia-dev-build-component/SKILL.md +10 -7
  139. package/dist/windsurf/.windsurf/skills/jahia-dev-create-page-template/SKILL.md +59 -21
  140. package/dist/windsurf/.windsurf/skills/jahia-dev-create-template-set/SKILL.md +20 -47
  141. package/dist/windsurf/.windsurf/skills/jahia-dev-create-view/SKILL.md +3 -3
  142. package/dist/windsurf/.windsurf/skills/jahia-dev-define-content-type/SKILL.md +43 -486
  143. package/dist/windsurf/.windsurf/skills/jahia-dev-define-content-type/references/modeling-decisions.md +52 -0
  144. package/dist/windsurf/.windsurf/skills/jahia-dev-review-cnd/SKILL.md +79 -0
  145. package/dist/windsurf/.windsurf/skills/jahia-dev-review-cnd/scripts/check-cnd.d.mts +13 -0
  146. package/dist/windsurf/.windsurf/skills/jahia-dev-review-cnd/scripts/check-cnd.mjs +198 -0
  147. package/dist/windsurf/.windsurf/skills/jahia-dev-site-review/SKILL.md +70 -0
  148. package/dist/windsurf/.windsurf/skills/jahia-dev-site-review/scripts/review-pages.mjs +85 -0
  149. package/dist/windsurf/.windsurf/skills/jahia-dev-start-local/SKILL.md +18 -26
  150. package/dist/windsurf/.windsurf/skills/jahia-orchestrate/SKILL.md +148 -0
  151. package/dist/windsurf/.windsurf/skills/jahia-orchestrate/scripts/verify-pages.mjs +59 -0
  152. package/dist/windsurf/AGENTS.md +17 -8
  153. package/package.json +1 -1
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env node
2
+ import { readFileSync, writeFileSync } from "node:fs";
3
+ import { execSync } from "node:child_process";
4
+ import { tmpdir } from "node:os";
5
+ import { join } from "node:path";
6
+
7
+ const pagesFile = "pages.json";
8
+ let urls;
9
+ try {
10
+ urls = JSON.parse(readFileSync(pagesFile, "utf8"));
11
+ } catch {
12
+ console.error(`MISSING: ${pagesFile} not found or invalid JSON`);
13
+ process.exit(1);
14
+ }
15
+
16
+ if (!Array.isArray(urls) || urls.length === 0) {
17
+ console.error(`EMPTY: ${pagesFile} contains no URLs`);
18
+ process.exit(1);
19
+ }
20
+
21
+ const tmp = join(tmpdir(), "jahia_pg_verify.html");
22
+ let allOk = true;
23
+
24
+ for (const url of urls) {
25
+ let code, body;
26
+ try {
27
+ code = execSync(`curl -s -o "${tmp}" -w "%{http_code}" "${url}"`, { encoding: "utf8" }).trim();
28
+ body = readFileSync(tmp, "utf8");
29
+ } catch {
30
+ console.log(`ERROR [unknown] ${url}`);
31
+ allOk = false;
32
+ continue;
33
+ }
34
+ const titleMatch = body.match(/<title>([^<]*)<\/title>/i);
35
+ const title = titleMatch ? titleMatch[1].trim() : "";
36
+ const hasError =
37
+ body.includes("error details are shown in development mode") ||
38
+ body.includes("pl.touk.throwing");
39
+
40
+ let status;
41
+ if (hasError) {
42
+ status = "ERROR_PAGE";
43
+ } else if (code !== "200") {
44
+ status = `HTTP_${code}`;
45
+ } else {
46
+ const mainMatch = body.match(/<main[^>]*>([\s\S]*?)<\/main>/i);
47
+ if (mainMatch) {
48
+ const mainText = mainMatch[1].replace(/<[^>]+>/g, "").replace(/\s+/g, " ").trim();
49
+ status = mainText.length < 150 ? "INCOMPLETE" : "OK";
50
+ } else {
51
+ status = "OK";
52
+ }
53
+ }
54
+
55
+ console.log(`${status} [${title}] ${url}`);
56
+ if (status !== "OK") allOk = false;
57
+ }
58
+
59
+ process.exit(allOk ? 0 : 1);
@@ -1,6 +1,6 @@
1
1
  # CLAUDE.md
2
2
  <!-- Generated by APM CLI -->
3
- <!-- Build ID: 3e845c4f03a9 -->
3
+ <!-- Build ID: 89ed743cfc8b -->
4
4
 
5
5
  # Project Standards
6
6
 
@@ -15,15 +15,22 @@ You are helping develop a **Jahia JavaScript Module** — a React-based template
15
15
  ## Agent Principles
16
16
 
17
17
  1. **Always invoke a skill before any Jahia task** — skills are the canonical source of patterns, gotchas, and API syntax. Never operate from memory alone.
18
+ 1a. **Always load CND reference files before writing any CND** — Jahia-specific patterns (`choicelist[linkTypeInitializer]`, `mix:title`, child nodes for CTAs, `jmix:image` weakreferences) are not in your training data. Before writing any CND, read the reference files: `find . -maxdepth 4 -name 'cnd-jahia-mixins*' | head -3`. When working interactively through skill chains, prefer `@jahia-cnd-author` (it loads these files for you).
18
19
  2. **Never use `yarn dev` from an agent** — it is an interactive file watcher for human developers only. Always deploy with `yarn build && yarn jahia-deploy` (one-shot, non-interactive).
20
+ 2a. **Use the TypeScript LSP for API discovery, never grep.** When you need to know a function's signature or what a module exports, call `mcp__ide__getDiagnostics` on the file after writing it — the LSP reads live type definitions and reports mismatches, wrong argument counts, and missing exports. Never run `grep` on `node_modules` to find a function name or signature.
19
21
  3. **Never hardcode URLs** — all navigable links must come from contributed content (JCR nodes, `j:linkType`, `buildNodeUrl`). This is a CMS: content owns the URLs.
20
22
  4. **Never use `j:linkType: "external"` for internal pages** — use `"internal"` + `j:linknode`. External URLs break on environment changes, language switches, and vanity URL rewrites.
21
- 5. **Always verify before creating** — check that content types are deployed, site keys are correct, and area structures exist before attempting GraphQL mutations.
23
+ 5. **Always verify before creating** — check that content types are deployed, site keys are correct, and parent area nodes exist before creating content via MCP.
22
24
  6. **All props are optional at runtime** — even mandatory CND fields. Always guard against `undefined` in views.
23
- 7. **Always include `-H "Origin: http://localhost:8080"` in every GraphQL curl** omitting it returns `Permission denied` even with correct credentials.
24
- 8. **Build accessible HTML from the start** — every view must use semantic HTML (`<main>`, `<header>`, `<nav>`, `<footer>`, `<section>`, `<article>`), include exactly one `<h1>` per page, use a strict heading hierarchy (h1 → h2 → h3), add `alt` text to every `<img>`, and use sufficient colour contrast (≥ 4.5:1 for body text). Baking this in during authoring is faster than a post-hoc audit.
25
- 9. **Run one accessibility audit at the end** after all components are built and content is published, invoke `/jahia-dev-accessibility` once to catch any remaining violations. Do not audit after every individual component; it wastes time on pages that are not yet complete.
26
- 10. **Batch builds and deploys** — build all components together, then run `yarn build && yarn jahia-deploy` once rather than after each individual component. Deploy once before populating content.
25
+ 7. **Use MCP tools for all Jahia operations — never GraphQL curl.** The `jahia` MCP server covers site, page, content, and publication operations. Never fall back to `curl` + GraphQL mutations for anything the MCP server can do. Never write Python scripts — use JavaScript or bash only.
26
+ 7a. **`yarn` and `npx` must be run from the module root** — the module is a standalone project, not part of a monorepo. Running `yarn` from a parent directory fails with a workspace boundary error. Always `cd` to the module directory first.
27
+ 7b. **Use `grep`, not `ugrep`** `ugrep` is not available on all systems and does not support the same regex syntax. Use `grep -rn` for plain text, `grep -rn -E` for extended regex, or `grep -rn -P` for Perl-compatible patterns (e.g. lookaheads). Never use `ugrep` or `(?m)` flags.
28
+ 8. **Build accessible HTML from the start** — every view must use semantic HTML (`<main>`, `<header>`, `<nav>`, `<footer>`, `<section>`, `<article>`), include exactly one `<h1>` per page (in the template from `jcr:title` never inside a component), use a strict heading hierarchy (h1 in template → h2 in components → h3 for sub-items), add `alt` text to every `<img>` with a meaningful fallback (`imageAlt || title || 'Image'` — never empty string), ensure sufficient colour contrast (≥ 4.5:1 for body text), include a skip link at the top of the template, and never leave a landmark (`<nav>`, `<footer>`) empty.
29
+ 9. **Review quality after each deploy** — after deploying and populating content, run `/jahia-dev-site-review` to get a scored a11y + SEO report. Fix any critical/serious violations before moving on. Do not write `pages.json` until the review passes.
30
+ 10. **Deploy iteratively** — deploy after each component with `yarn build && yarn jahia-deploy`, verify it renders, then move to the next. Don't accumulate components before deploying; a broken component is easier to diagnose in isolation.
31
+ 11. **Collocate everything per component** — each component lives in `src/components/<Category>/<Name>/` containing its `definition.cnd`, `default.server.tsx`, `component.module.css`, and `types.ts`. Never centralize content types in `settings/definitions.cnd` — that file holds only namespace declarations and the module base mixin.
32
+ 12. **Always build a page template first** — every website needs a root template at `src/templates/<ModuleName>Template/default.server.tsx`. It must include: a skip link, a `<nav>` built inline from children of the site's home node using `getChildNodes(renderContext.getSite().getNode('home'), -1, 0, n => n.isNodeType('jnt:page'))` (pages live under `home`, not directly under the site), a `<main id="main-content">` with `<h1>{title}</h1>` and Areas, and a `<footer>` that is never empty. The `<title>` tag must be `{title} | {siteName}` — never set `jcr:title` to the full `Page | Site` string; `jcr:title` is always just the short page name (e.g. "Car Insurance"). Build and deploy before any page-specific components.
33
+ 13. **SEO baseline** — every page template must render a `<title>` tag, all `<img>` must have descriptive `alt` text, all links must have visible text (no icon-only links without `aria-label`), and pages must have a single `<h1>` matching the page title.
27
34
 
28
35
  ## Skill Map
29
36
 
@@ -38,11 +45,13 @@ Start with `/jahia` if unsure where to begin.
38
45
  | `/jahia-dev-start-local` | Start Jahia locally (Docker or bare metal) |
39
46
  | `/jahia-dev-build-component` | Build a complete component (CND + view) — start here |
40
47
  | `/jahia-dev-define-content-type` | Define a CND content type + types.ts |
48
+ | `/jahia-dev-review-cnd` | Validate a CND file for antipatterns — run after writing any CND |
41
49
  | `/jahia-dev-create-view` | Implement a React view (.server.tsx + CSS Module) |
42
50
  | `/jahia-dev-create-page-template` | Create a page template with Areas |
43
51
  | `/jahia-dev-query-content` | Write JCR-SQL2 queries and useJCRQuery |
44
52
  | `/jahia-dev-review` | Code review: 8 critical checks, 9 warnings, 11 suggestions |
45
- | `/jahia-dev-accessibility` | Audit live pages with axe-core, fix WCAG 2.1 AA violations |
53
+ | `/jahia-dev-site-review` | Scored a11y + SEO report on live pages use after every deploy |
54
+ | `/jahia-dev-accessibility` | Deep WCAG 2.1 AA audit with fixes — use for targeted a11y work |
46
55
  | `/jahia-dev-screenshot` | Screenshot reference + local render for visual comparison |
47
56
  | `/jahia-dev-debug` | Debug build/deploy/runtime errors end-to-end |
48
57
 
@@ -88,7 +88,11 @@ Use these recipes as starting points when the task maps to a known pattern.
88
88
  ```
89
89
  1. /jahia-dev-create-template-set → scaffold the module
90
90
  2. /jahia-dev-start-local → start Jahia locally
91
- 3. /jahia-dev-build-component → build content types + views (repeat per component)
91
+ 3. /jahia-dev-build-component → build ONE component at a time (repeat this step per component):
92
+ - invokes /jahia-dev-define-content-type
93
+ - which invokes @jahia-cnd-author (sub-agent, mandatory)
94
+ - then invokes /jahia-dev-create-view
95
+ ⚠ Never batch-write CND — always go through @jahia-cnd-author
92
96
  4. /jahia-dev-create-page-template → create page templates
93
97
  5. /jahia-content-create-content → use `site.templateSets` + `site.create`, then add pages and content
94
98
  6. /jahia-content-publish → publish the site content
@@ -110,10 +110,10 @@ color: #595959; /* 7:1 ratio on white */
110
110
  /* Bad */
111
111
  <img src={buildNodeUrl(props.image)} />
112
112
 
113
- /* Fix — use content from CND, fall back to empty string for decorative */
114
- <img src={buildNodeUrl(props.image)} alt={props.imageAlt ?? ""} />
113
+ /* Fix — use the image node's jcr:title, fall back to empty string for decorative */
114
+ <img src={buildNodeUrl(props.image)} alt={props.image?.getPropertyAsString("jcr:title") ?? ""} />
115
115
  ```
116
- Add `- imageAlt (string) i18n` to the CND and `imageAlt?: string` to `types.ts`.
116
+ The image node already has `jcr:title` (from `mix:title`). **Do not add `imageAlt (string) i18n`** to the CND.
117
117
 
118
118
  **`button-name`** — `<button>` or `<a>` is empty (icon-only without label)
119
119
  ```tsx
@@ -43,15 +43,18 @@ Has children: <yes: ChildType / no>
43
43
 
44
44
  ---
45
45
 
46
- ## Step 2 — Invoke `jahia-dev-define-content-type`
46
+ ## Step 2 — REQUIRED: Invoke `/jahia-dev-define-content-type`
47
47
 
48
- Use the instructions from the `jahia-dev-define-content-type` skill to:
48
+ **Do not write CND manually.** Jahia-specific patterns (`choicelist[linkTypeInitializer]`, `mix:title`, child nodes for CTAs) are not in LLM training data — writing CND from memory always produces broken output. This skill delegates to `@jahia-cnd-author` which loads the correct reference files.
49
49
 
50
- 1. Identify the namespace (check `settings/definitions.cnd`)
51
- 2. Create `src/components/<Category>/<Name>/definition.cnd`
52
- 3. Create `src/components/<Category>/<Name>/types.ts`
53
- 4. Run `yarn build && yarn jahia-deploy` to push the type to Jahia
54
- 5. Verify the content type appears in the Jahia content editor
50
+ Invoke `/jahia-dev-define-content-type` in a sub-agent job. Pass the component spec. Wait for it to confirm PASS before continuing.
51
+
52
+ The skill will:
53
+ 1. Confirm the namespace (from `settings/definitions.cnd`)
54
+ 2. Invoke `@jahia-cnd-author` to create `src/components/<Category>/<Name>/definition.cnd`
55
+ 3. Invoke `@jahia-cnd-author` to create `src/components/<Category>/<Name>/types.ts`
56
+
57
+ **Do not proceed to Step 3 until the CND review is PASS.**
55
58
 
56
59
  ---
57
60
 
@@ -14,35 +14,72 @@ A **page template** defines the full layout of a page. It is registered with `co
14
14
 
15
15
  ## Step 1 — Create the template file
16
16
 
17
- Page templates live in `src/templates/Page/`. Name the file `<templateName>.server.tsx`.
17
+ Page templates live in `src/templates/<ModuleName>Template/`. Name the file `default.server.tsx`.
18
18
 
19
19
  ```tsx
20
- import { Area, AbsoluteArea, jahiaComponent } from "@jahia/javascript-modules-library";
21
- import { Layout } from "../Layout.jsx";
20
+ import React from "react";
21
+ import { Area, AbsoluteArea, getChildNodes, buildNodeUrl, jahiaComponent } from "@jahia/javascript-modules-library";
22
+ import styles from "./template.module.css";
22
23
 
23
24
  jahiaComponent(
24
25
  {
25
26
  componentType: "template", // "template" for full pages, not "view"
26
27
  nodeType: "jnt:page", // always jnt:page for page templates
27
- displayName: "Single Column",
28
- name: "singleColumn", // used in Jahia UI when selecting a template
28
+ displayName: "Default Template",
29
+ name: "default",
30
+ },
31
+ ({ "jcr:title": title }, { renderContext, mainNode }) => {
32
+ // Pages live under /sites/<key>/home — not directly under the site node
33
+ const siteHome = renderContext.getSite().getNode("home");
34
+ const navPages = getChildNodes(siteHome, -1, 0, n => n.isNodeType("jnt:page"));
35
+ const siteName = renderContext.getSite().getPropertyAsString("j:siteTitle") ?? renderContext.getSite().getName();
36
+ return (
37
+ <html lang="en">
38
+ <head>
39
+ <meta charSet="UTF-8" />
40
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
41
+ {/* jcr:title is the short page name — template appends site name for SEO */}
42
+ <title>{title}{siteName ? ` | ${siteName}` : ""}</title>
43
+ </head>
44
+ <body>
45
+ <a href="#main-content" className={styles.skipLink}>Skip to main content</a>
46
+ <header className={styles.header}>
47
+ <nav aria-label="Main navigation">
48
+ <ul className={styles.navList}>
49
+ <li key={siteHome.getPath()}>
50
+ <a href={buildNodeUrl(siteHome)} aria-current={siteHome.getPath() === mainNode.getPath() ? "page" : undefined}>
51
+ {siteHome.getPropertyAsString("jcr:title") ?? siteHome.getName()}
52
+ </a>
53
+ </li>
54
+ {navPages.map(page => (
55
+ <li key={page.getPath()}>
56
+ <a
57
+ href={buildNodeUrl(page)}
58
+ aria-current={page.getPath() === mainNode.getPath() ? "page" : undefined}
59
+ >
60
+ {page.getPropertyAsString("jcr:title") ?? page.getName()}
61
+ </a>
62
+ </li>
63
+ ))}
64
+ </ul>
65
+ </nav>
66
+ </header>
67
+ <main id="main-content">
68
+ <h1 className={styles.pageTitle}>{title}</h1>
69
+ <Area name="pagecontent" />
70
+ </main>
71
+ <footer className={styles.footer}>
72
+ <AbsoluteArea name="footer" parent={renderContext.getSite()} />
73
+ <p className={styles.copyright}>{"© "}{renderContext.getSite().getName()}</p>
74
+ </footer>
75
+ </body>
76
+ </html>
77
+ );
29
78
  },
30
- ({ "jcr:title": title }, { renderContext }) => (
31
- <Layout title={title}>
32
- <Area name="header" nodeType="namespace:header" />
33
- <main style={{ maxWidth: "40rem", margin: "0 auto" }}>
34
- <Area name="main" />
35
- </main>
36
- <AbsoluteArea
37
- name="footer"
38
- parent={renderContext.getSite()}
39
- nodeType="namespace:footer"
40
- />
41
- </Layout>
42
- ),
43
79
  );
44
80
  ```
45
81
 
82
+
46
83
  ---
47
84
 
48
85
  ## Step 2 — Choose: Area vs AbsoluteArea
@@ -266,13 +303,14 @@ After deploying, the new template will appear in the **template selection** step
266
303
  ---
267
304
 
268
305
  ## Validation checklist
269
- - [ ] File is in `src/templates/Page/`
270
306
  - [ ] `componentType: "template"` and `nodeType: "jnt:page"`
271
307
  - [ ] `name` is set (used in Jahia UI template picker)
308
+ - [ ] Skip link present: `<a href="#main-content">Skip to main content</a>`
309
+ - [ ] Nav built from `getChildNodes(site.getNode('home'), ...)` — pages are children of `home`, not of the site node
310
+ - [ ] `<h1>{title}</h1>` in the template — no `<h1>` in any component
311
+ - [ ] `<footer>` landmark always has visible content (never empty)
272
312
  - [ ] Areas use a custom area node type (not bare `<Area name="..."/>`)
273
313
  - [ ] Custom area type has `jmix:list`, `jmix:hiddenType`, and `orderable`
274
- - [ ] `AbsoluteArea` uses `renderContext.getSite()` as parent
275
- - [ ] Structural container nodes use `jmix:hiddenType` (hidden from picker)
276
314
  - [ ] Decision made: page template vs sectioning component (see Step 4)
277
315
  - [ ] `yarn build && yarn jahia-deploy` run and template appears in Jahia UI
278
316
 
@@ -119,66 +119,39 @@ yarn build && yarn jahia-deploy
119
119
 
120
120
  Verify the module is installed:
121
121
 
122
- ```bash
123
- curl -s -u root:root1234 -H "Origin: http://localhost:8080" \
124
- -X POST http://localhost:8080/modules/graphql \
125
- -H "Content-Type: application/json" \
126
- -d '{"query":"{ jcr { nodeByPath(path:\"/modules/<module-name>\") { name } } }"}'
122
+ ```
123
+ tool: content.get
124
+ args: { "path": "/modules/<module-name>" }
127
125
  ```
128
126
 
129
- Replace `<module-name>` with the `name` from `package.json`. The response should contain `"name": "<module-name>"`.
127
+ Replace `<module-name>` with the `name` from `package.json`. The response should contain the module node.
130
128
 
131
129
  ---
132
130
 
133
131
  ## Step 5 — Create a new site in Jahia
134
132
 
135
- After the module is deployed, create the site via the Provisioning API — **do not use the UI**.
136
-
137
- > ⚠️ **CRITICAL: syntax is `- createSite: ""`** — the empty string `""` after the colon is **mandatory**. Without it, Jahia returns HTTP 200 but silently creates nothing. Using `- createSite:` with nested properties is **wrong and will fail silently**.
133
+ After the module is deployed, create the site via MCP:
138
134
 
139
- ```bash
140
- MODULE_NAME=<module-name> # value of "name" in package.json
141
-
142
- curl -u root:root1234 \
143
- -X POST \
144
- -H "Content-Type: application/yaml" \
145
- --data-binary "- createSite: \"\"
146
- siteKey: ${MODULE_NAME}
147
- title: \"My Site\"
148
- defaultLanguage: en
149
- serverName: localhost
150
- templateSet: ${MODULE_NAME}" \
151
- http://localhost:8080/modules/api/provisioning
152
135
  ```
153
-
154
- Or write the script to a file and POST it:
155
-
156
- ```bash
157
- MODULE_NAME=<module-name>
158
-
159
- cat > /tmp/create-site.yaml <<EOF
160
- - createSite: ""
161
- siteKey: ${MODULE_NAME}
162
- title: "My Site"
163
- defaultLanguage: en
164
- serverName: localhost
165
- templateSet: ${MODULE_NAME}
166
- EOF
167
-
168
- curl -u root:root1234 -X POST -H "Content-Type: application/yaml" \
169
- --data-binary @/tmp/create-site.yaml \
170
- http://localhost:8080/modules/api/provisioning
136
+ tool: site.create
137
+ args: {
138
+ "siteKey": "<module-name>",
139
+ "title": "My Site",
140
+ "templateSet": "<module-name>",
141
+ "defaultLanguage": "en",
142
+ "serverName": "localhost"
143
+ }
171
144
  ```
172
145
 
146
+ Replace `<module-name>` with the `name` from `package.json`. `templateSet` must exactly match the deployed module name.
147
+
173
148
  Verify the site was created:
174
- ```bash
175
- curl -s -u root:root1234 \
176
- -H "Content-Type: application/json" -H "Origin: http://localhost:8080" \
177
- -X POST http://localhost:8080/modules/graphql \
178
- -d "{\"query\":\"{ jcr { nodeByPath(path:\\\"/sites/${MODULE_NAME}\\\") { name } } }\"}"
149
+
150
+ ```
151
+ tool: site.list
179
152
  ```
180
153
 
181
- The response must contain `"name": "<module-name>"`. If the path returns `null`, the site was not created — check that `templateSet` exactly matches the deployed module name.
154
+ The site key must appear in the response. If it does not, check that `templateSet` exactly matches the deployed module name.
182
155
 
183
156
  ---
184
157
 
@@ -229,4 +202,4 @@ If anything goes wrong during setup or scaffolding, refer to the official Jahia
229
202
  - [ ] Module directory created with expected structure
230
203
  - [ ] `yarn install` completes without errors
231
204
  - [ ] `yarn build && yarn jahia-deploy` succeeds — module appears at `/modules/<name>` in JCR
232
- - [ ] Site created with `createSite: ""` — JCR confirms `/sites/<name>` exists
205
+ - [ ] Site created with `site.create` — `site.list` confirms site key exists
@@ -100,11 +100,11 @@ Every `<img>` must have an `alt` attribute. Decorative images use `alt=""`. Info
100
100
  // ❌ Missing alt
101
101
  <img src={buildNodeUrl(props.image)} />
102
102
 
103
- // ✅ Descriptive alt from content
104
- <img src={buildNodeUrl(props.image)} alt={props.imageAlt ?? ""} />
103
+ // ✅ Alt from the image node's title (no extra CND property needed)
104
+ <img src={buildNodeUrl(props.image)} alt={props.image?.getPropertyAsString("jcr:title") ?? ""} />
105
105
  ```
106
106
 
107
- Add `- imageAlt (string) i18n` to the CND and `imageAlt?: string` to `types.ts` for any type with an image field.
107
+ The image node already has `jcr:title` (from `mix:title`). **Do not add `imageAlt (string) i18n`** to the CND it forces editors to enter duplicate data.
108
108
 
109
109
  ### Colour contrast
110
110