@jahia/agentic 0.4.1 → 0.5.1

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 (178) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/antigravity/.agents/rules/jahia.md +51 -0
  3. package/dist/antigravity/.agents/skills/jahia-cnd-author/SKILL.md +94 -0
  4. package/dist/antigravity/.agents/skills/jahia-cnd-author/references/cnd-area-types.md +55 -0
  5. package/dist/antigravity/.agents/skills/jahia-cnd-author/references/cnd-authoring-experience.md +92 -0
  6. package/dist/antigravity/.agents/skills/jahia-cnd-author/references/cnd-child-nodes.md +74 -0
  7. package/dist/antigravity/.agents/skills/jahia-cnd-author/references/cnd-jahia-mixins.md +510 -0
  8. package/dist/antigravity/.agents/skills/jahia-cnd-author/references/cnd-modeling-decisions.md +87 -0
  9. package/dist/antigravity/.agents/skills/jahia-cnd-author/references/cnd-numbers-dates.md +92 -0
  10. package/dist/antigravity/.agents/skills/jahia-cnd-author/references/cnd-string-selectors.md +133 -0
  11. package/dist/antigravity/.agents/skills/jahia-cnd-author/references/cnd-syntax.md +119 -0
  12. package/dist/antigravity/.agents/skills/jahia-cnd-author/references/types-ts-mapping.md +73 -0
  13. package/dist/antigravity/.agents/skills/jahia-dev-accessibility/SKILL.md +11 -0
  14. package/dist/antigravity/.agents/skills/jahia-dev-build-component/SKILL.md +133 -0
  15. package/dist/antigravity/.agents/skills/jahia-dev-create-page-template/SKILL.md +341 -0
  16. package/dist/antigravity/.agents/skills/jahia-dev-create-template-set/SKILL.md +205 -0
  17. package/dist/antigravity/.agents/skills/jahia-dev-create-view/SKILL.md +896 -0
  18. package/dist/antigravity/.agents/skills/jahia-dev-debug/SKILL.md +176 -0
  19. package/dist/antigravity/.agents/skills/jahia-dev-import-from/SKILL.md +244 -0
  20. package/dist/antigravity/.agents/skills/jahia-dev-jexperience/SKILL.md +269 -0
  21. package/dist/antigravity/.agents/skills/jahia-dev-ops/SKILL.md +50 -0
  22. package/dist/antigravity/.agents/skills/jahia-dev-ops/references/docker.md +151 -0
  23. package/dist/antigravity/.agents/skills/jahia-dev-ops/references/monitoring.md +195 -0
  24. package/dist/antigravity/.agents/skills/jahia-dev-ops/references/provisioning.md +269 -0
  25. package/dist/antigravity/.agents/skills/jahia-dev-properties/SKILL.md +147 -0
  26. package/dist/antigravity/.agents/skills/jahia-dev-properties/references/all-properties.md +231 -0
  27. package/dist/antigravity/.agents/skills/jahia-dev-query-content/SKILL.md +204 -0
  28. package/dist/antigravity/.agents/skills/jahia-dev-review-cnd/SKILL.md +79 -0
  29. package/dist/antigravity/.agents/skills/jahia-dev-review-cnd/scripts/check-cnd.d.mts +13 -0
  30. package/dist/antigravity/.agents/skills/jahia-dev-review-cnd/scripts/check-cnd.mjs +198 -0
  31. package/dist/antigravity/.agents/skills/jahia-dev-screenshot/SKILL.md +177 -0
  32. package/dist/antigravity/.agents/skills/jahia-dev-start-local/SKILL.md +121 -0
  33. package/dist/antigravity/.agents/skills/jahia-jcr-sql2/SKILL.md +257 -0
  34. package/dist/antigravity/.agents/skills/jahia-review/SKILL.md +63 -0
  35. package/dist/{claude/.claude/skills/jahia-dev-review → antigravity/.agents/skills/jahia-review-code}/SKILL.md +3 -3
  36. package/dist/antigravity/.agents/skills/jahia-review-site/SKILL.md +52 -0
  37. package/dist/antigravity/.agents/skills/jahia-review-site/scripts/review-pages.mjs +74 -0
  38. package/dist/antigravity/AGENTS.md +62 -0
  39. package/dist/claude/.claude/rules/jahia.md +1 -1
  40. package/dist/claude/.claude/skills/jahia-dev-build-component/SKILL.md +2 -2
  41. package/dist/claude/.claude/skills/jahia-dev-create-view/SKILL.md +2 -2
  42. package/dist/claude/.claude/skills/jahia-dev-import-from/SKILL.md +1 -1
  43. package/dist/claude/.claude/skills/jahia-dev-properties/SKILL.md +1 -1
  44. package/dist/claude/.claude/skills/jahia-dev-query-content/SKILL.md +1 -1
  45. package/dist/claude/.claude/skills/jahia-jcr-sql2/SKILL.md +1 -2
  46. package/dist/claude/.claude/skills/jahia-review/SKILL.md +63 -0
  47. package/dist/{copilot/.agents/skills/jahia-dev-review → claude/.claude/skills/jahia-review-code}/SKILL.md +3 -3
  48. package/dist/claude/.claude/skills/jahia-review-site/SKILL.md +52 -0
  49. package/dist/claude/.claude/skills/jahia-review-site/scripts/review-pages.mjs +74 -0
  50. package/dist/claude/.mcp.json +11 -0
  51. package/dist/claude/CLAUDE.md +2 -2
  52. package/dist/codex/.agents/skills/jahia-dev-build-component/SKILL.md +2 -2
  53. package/dist/codex/.agents/skills/jahia-dev-create-view/SKILL.md +2 -2
  54. package/dist/codex/.agents/skills/jahia-dev-import-from/SKILL.md +1 -1
  55. package/dist/codex/.agents/skills/jahia-dev-properties/SKILL.md +1 -1
  56. package/dist/codex/.agents/skills/jahia-dev-query-content/SKILL.md +1 -1
  57. package/dist/codex/.agents/skills/jahia-jcr-sql2/SKILL.md +1 -2
  58. package/dist/codex/.agents/skills/jahia-review/SKILL.md +63 -0
  59. package/dist/{cursor/.agents/skills/jahia-dev-review → codex/.agents/skills/jahia-review-code}/SKILL.md +3 -3
  60. package/dist/codex/.agents/skills/jahia-review-site/SKILL.md +52 -0
  61. package/dist/codex/.agents/skills/jahia-review-site/scripts/review-pages.mjs +74 -0
  62. package/dist/codex/AGENTS.md +2 -2
  63. package/dist/copilot/.agents/skills/jahia-dev-build-component/SKILL.md +2 -2
  64. package/dist/copilot/.agents/skills/jahia-dev-create-view/SKILL.md +2 -2
  65. package/dist/copilot/.agents/skills/jahia-dev-import-from/SKILL.md +1 -1
  66. package/dist/copilot/.agents/skills/jahia-dev-properties/SKILL.md +1 -1
  67. package/dist/copilot/.agents/skills/jahia-dev-query-content/SKILL.md +1 -1
  68. package/dist/copilot/.agents/skills/jahia-jcr-sql2/SKILL.md +1 -2
  69. package/dist/copilot/.agents/skills/jahia-review/SKILL.md +63 -0
  70. package/dist/{codex/.agents/skills/jahia-dev-review → copilot/.agents/skills/jahia-review-code}/SKILL.md +3 -3
  71. package/dist/copilot/.agents/skills/jahia-review-site/SKILL.md +52 -0
  72. package/dist/copilot/.agents/skills/jahia-review-site/scripts/review-pages.mjs +74 -0
  73. package/dist/copilot/AGENTS.md +2 -2
  74. package/dist/cursor/.agents/skills/jahia-dev-build-component/SKILL.md +2 -2
  75. package/dist/cursor/.agents/skills/jahia-dev-create-view/SKILL.md +2 -2
  76. package/dist/cursor/.agents/skills/jahia-dev-import-from/SKILL.md +1 -1
  77. package/dist/cursor/.agents/skills/jahia-dev-properties/SKILL.md +1 -1
  78. package/dist/cursor/.agents/skills/jahia-dev-query-content/SKILL.md +1 -1
  79. package/dist/cursor/.agents/skills/jahia-jcr-sql2/SKILL.md +1 -2
  80. package/dist/cursor/.agents/skills/jahia-review/SKILL.md +63 -0
  81. package/dist/cursor/.agents/skills/jahia-review-code/SKILL.md +228 -0
  82. package/dist/cursor/.agents/skills/jahia-review-site/SKILL.md +52 -0
  83. package/dist/cursor/.agents/skills/jahia-review-site/scripts/review-pages.mjs +74 -0
  84. package/dist/cursor/.cursor/mcp.json +11 -0
  85. package/dist/cursor/.cursor/rules/jahia.mdc +1 -1
  86. package/dist/gemini/.agents/skills/jahia-dev-build-component/SKILL.md +2 -2
  87. package/dist/gemini/.agents/skills/jahia-dev-create-view/SKILL.md +2 -2
  88. package/dist/gemini/.agents/skills/jahia-dev-import-from/SKILL.md +1 -1
  89. package/dist/gemini/.agents/skills/jahia-dev-properties/SKILL.md +1 -1
  90. package/dist/gemini/.agents/skills/jahia-dev-query-content/SKILL.md +1 -1
  91. package/dist/gemini/.agents/skills/jahia-jcr-sql2/SKILL.md +1 -2
  92. package/dist/gemini/.agents/skills/jahia-review/SKILL.md +63 -0
  93. package/dist/gemini/.agents/skills/jahia-review-code/SKILL.md +228 -0
  94. package/dist/gemini/.agents/skills/jahia-review-site/SKILL.md +52 -0
  95. package/dist/gemini/.agents/skills/jahia-review-site/scripts/review-pages.mjs +74 -0
  96. package/dist/gemini/.gemini/settings.json +10 -0
  97. package/dist/gemini/AGENTS.md +2 -2
  98. package/dist/index.js +14 -2
  99. package/dist/kiro/.kiro/settings/mcp.json +10 -0
  100. package/dist/kiro/.kiro/skills/jahia-cnd-author/SKILL.md +94 -0
  101. package/dist/kiro/.kiro/skills/jahia-cnd-author/references/cnd-area-types.md +55 -0
  102. package/dist/kiro/.kiro/skills/jahia-cnd-author/references/cnd-authoring-experience.md +92 -0
  103. package/dist/kiro/.kiro/skills/jahia-cnd-author/references/cnd-child-nodes.md +74 -0
  104. package/dist/kiro/.kiro/skills/jahia-cnd-author/references/cnd-jahia-mixins.md +510 -0
  105. package/dist/kiro/.kiro/skills/jahia-cnd-author/references/cnd-modeling-decisions.md +87 -0
  106. package/dist/kiro/.kiro/skills/jahia-cnd-author/references/cnd-numbers-dates.md +92 -0
  107. package/dist/kiro/.kiro/skills/jahia-cnd-author/references/cnd-string-selectors.md +133 -0
  108. package/dist/kiro/.kiro/skills/jahia-cnd-author/references/cnd-syntax.md +119 -0
  109. package/dist/kiro/.kiro/skills/jahia-cnd-author/references/types-ts-mapping.md +73 -0
  110. package/dist/kiro/.kiro/skills/jahia-dev-accessibility/SKILL.md +11 -0
  111. package/dist/kiro/.kiro/skills/jahia-dev-build-component/SKILL.md +133 -0
  112. package/dist/kiro/.kiro/skills/jahia-dev-create-page-template/SKILL.md +341 -0
  113. package/dist/kiro/.kiro/skills/jahia-dev-create-template-set/SKILL.md +205 -0
  114. package/dist/kiro/.kiro/skills/jahia-dev-create-view/SKILL.md +896 -0
  115. package/dist/kiro/.kiro/skills/jahia-dev-debug/SKILL.md +176 -0
  116. package/dist/kiro/.kiro/skills/jahia-dev-import-from/SKILL.md +244 -0
  117. package/dist/kiro/.kiro/skills/jahia-dev-jexperience/SKILL.md +269 -0
  118. package/dist/kiro/.kiro/skills/jahia-dev-ops/SKILL.md +50 -0
  119. package/dist/kiro/.kiro/skills/jahia-dev-ops/references/docker.md +151 -0
  120. package/dist/kiro/.kiro/skills/jahia-dev-ops/references/monitoring.md +195 -0
  121. package/dist/kiro/.kiro/skills/jahia-dev-ops/references/provisioning.md +269 -0
  122. package/dist/kiro/.kiro/skills/jahia-dev-properties/SKILL.md +147 -0
  123. package/dist/kiro/.kiro/skills/jahia-dev-properties/references/all-properties.md +231 -0
  124. package/dist/kiro/.kiro/skills/jahia-dev-query-content/SKILL.md +204 -0
  125. package/dist/kiro/.kiro/skills/jahia-dev-review-cnd/SKILL.md +79 -0
  126. package/dist/kiro/.kiro/skills/jahia-dev-review-cnd/scripts/check-cnd.d.mts +13 -0
  127. package/dist/kiro/.kiro/skills/jahia-dev-review-cnd/scripts/check-cnd.mjs +198 -0
  128. package/dist/kiro/.kiro/skills/jahia-dev-screenshot/SKILL.md +177 -0
  129. package/dist/kiro/.kiro/skills/jahia-dev-start-local/SKILL.md +121 -0
  130. package/dist/kiro/.kiro/skills/jahia-jcr-sql2/SKILL.md +257 -0
  131. package/dist/kiro/.kiro/skills/jahia-review/SKILL.md +63 -0
  132. package/dist/kiro/.kiro/skills/jahia-review-code/SKILL.md +228 -0
  133. package/dist/kiro/.kiro/skills/jahia-review-site/SKILL.md +52 -0
  134. package/dist/kiro/.kiro/skills/jahia-review-site/scripts/review-pages.mjs +74 -0
  135. package/dist/kiro/.kiro/steering/jahia.md +55 -0
  136. package/dist/kiro/AGENTS.md +62 -0
  137. package/dist/opencode/.agents/skills/jahia-dev-build-component/SKILL.md +2 -2
  138. package/dist/opencode/.agents/skills/jahia-dev-create-view/SKILL.md +2 -2
  139. package/dist/opencode/.agents/skills/jahia-dev-import-from/SKILL.md +1 -1
  140. package/dist/opencode/.agents/skills/jahia-dev-properties/SKILL.md +1 -1
  141. package/dist/opencode/.agents/skills/jahia-dev-query-content/SKILL.md +1 -1
  142. package/dist/opencode/.agents/skills/jahia-jcr-sql2/SKILL.md +1 -2
  143. package/dist/opencode/.agents/skills/jahia-review/SKILL.md +63 -0
  144. package/dist/opencode/.agents/skills/jahia-review-code/SKILL.md +228 -0
  145. package/dist/opencode/.agents/skills/jahia-review-site/SKILL.md +52 -0
  146. package/dist/opencode/.agents/skills/jahia-review-site/scripts/review-pages.mjs +74 -0
  147. package/dist/opencode/AGENTS.md +2 -2
  148. package/dist/opencode/opencode.json +12 -0
  149. package/dist/windsurf/.windsurf/rules/jahia.md +1 -1
  150. package/dist/windsurf/.windsurf/skills/jahia-dev-build-component/SKILL.md +2 -2
  151. package/dist/windsurf/.windsurf/skills/jahia-dev-create-view/SKILL.md +2 -2
  152. package/dist/windsurf/.windsurf/skills/jahia-dev-import-from/SKILL.md +1 -1
  153. package/dist/windsurf/.windsurf/skills/jahia-dev-properties/SKILL.md +1 -1
  154. package/dist/windsurf/.windsurf/skills/jahia-dev-query-content/SKILL.md +1 -1
  155. package/dist/windsurf/.windsurf/skills/jahia-jcr-sql2/SKILL.md +1 -2
  156. package/dist/windsurf/.windsurf/skills/jahia-review/SKILL.md +63 -0
  157. package/dist/windsurf/.windsurf/skills/jahia-review-code/SKILL.md +228 -0
  158. package/dist/windsurf/.windsurf/skills/jahia-review-site/SKILL.md +52 -0
  159. package/dist/windsurf/.windsurf/skills/jahia-review-site/scripts/review-pages.mjs +74 -0
  160. package/dist/windsurf/AGENTS.md +2 -2
  161. package/package.json +1 -1
  162. package/dist/claude/.claude/skills/jahia-dev-site-review/SKILL.md +0 -70
  163. package/dist/claude/.claude/skills/jahia-dev-site-review/scripts/review-pages.mjs +0 -85
  164. package/dist/codex/.agents/skills/jahia-dev-site-review/SKILL.md +0 -70
  165. package/dist/codex/.agents/skills/jahia-dev-site-review/scripts/review-pages.mjs +0 -85
  166. package/dist/copilot/.agents/skills/jahia-dev-site-review/SKILL.md +0 -70
  167. package/dist/copilot/.agents/skills/jahia-dev-site-review/scripts/review-pages.mjs +0 -85
  168. package/dist/cursor/.agents/skills/jahia-dev-site-review/SKILL.md +0 -70
  169. package/dist/cursor/.agents/skills/jahia-dev-site-review/scripts/review-pages.mjs +0 -85
  170. package/dist/gemini/.agents/skills/jahia-dev-review/SKILL.md +0 -228
  171. package/dist/gemini/.agents/skills/jahia-dev-site-review/SKILL.md +0 -70
  172. package/dist/gemini/.agents/skills/jahia-dev-site-review/scripts/review-pages.mjs +0 -85
  173. package/dist/opencode/.agents/skills/jahia-dev-review/SKILL.md +0 -228
  174. package/dist/opencode/.agents/skills/jahia-dev-site-review/SKILL.md +0 -70
  175. package/dist/opencode/.agents/skills/jahia-dev-site-review/scripts/review-pages.mjs +0 -85
  176. package/dist/windsurf/.windsurf/skills/jahia-dev-review/SKILL.md +0 -228
  177. package/dist/windsurf/.windsurf/skills/jahia-dev-site-review/SKILL.md +0 -70
  178. package/dist/windsurf/.windsurf/skills/jahia-dev-site-review/scripts/review-pages.mjs +0 -85
@@ -0,0 +1,341 @@
1
+ ---
2
+ name: jahia-dev-create-page-template
3
+ description: Creates a Jahia page template with Areas and AbsoluteAreas. Use when asked to add a new page layout, create a page template, or set up a shared area like a header or footer.
4
+ allowed-tools: Bash, Read, Write, Edit
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ A **page template** defines the full layout of a page. It is registered with `componentType: "template"` and always targets `jnt:page`. Templates contain **Areas** (per-page content) and **AbsoluteAreas** (shared across all pages, e.g. footer, navbar).
10
+
11
+ ---
12
+
13
+ > ⚠️ **CMS rule — never hardcode links in templates.** Navigation links, logo hrefs, footer links — all must come from contributed content (via props, `buildNodeUrl`, or `j:linkType`). Do not put literal URLs in template code.
14
+
15
+ ## Step 1 — Create the template file
16
+
17
+ Page templates live in `src/templates/<ModuleName>Template/`. Name the file `default.server.tsx`.
18
+
19
+ ```tsx
20
+ import React from "react";
21
+ import { Area, AbsoluteArea, getChildNodes, buildNodeUrl, jahiaComponent } from "@jahia/javascript-modules-library";
22
+ import styles from "./template.module.css";
23
+
24
+ jahiaComponent(
25
+ {
26
+ componentType: "template", // "template" for full pages, not "view"
27
+ nodeType: "jnt:page", // always jnt:page for page templates
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
+ );
78
+ },
79
+ );
80
+ ```
81
+
82
+
83
+ ---
84
+
85
+ ## Step 2 — Choose: Area vs AbsoluteArea
86
+
87
+ | | `<Area>` | `<AbsoluteArea>` |
88
+ |---|---|---|
89
+ | Content | Per-page (each page has its own) | Shared across all pages |
90
+ | Use for | Page body, hero, sections | Footer, navbar, sidebar |
91
+ | `parent` prop | Not needed | Set to `renderContext.getSite()` for site-wide |
92
+
93
+ ---
94
+
95
+ ## Step 3 — Use typed area nodes (required for good editorial UX)
96
+
97
+ Instead of a single generic area type, define **one area type per section** with a tight child constraint. This ensures editors only see relevant content types in each area's "New content" menu.
98
+
99
+ ```cnd
100
+ // settings/definitions.cnd
101
+
102
+ [namespacemix:pageComponent] > namespacemix:component mixin
103
+
104
+ // ✅ Typed areas — editors only see the right types per area
105
+ // Use jmix:hiddenType (NOT jmix:studioOnly) — hides from picker while keeping rendering intact
106
+ [namespace:heroArea] > jnt:content, jmix:list, jmix:hiddenType orderable
107
+ + * (namespace:heroSection)
108
+
109
+ [namespace:featuresArea] > jnt:content, jmix:list, jmix:hiddenType orderable
110
+ + * (namespace:featureCard)
111
+
112
+ // Generic fallback — use only when no tighter constraint makes sense
113
+ [namespace:pageArea] > jnt:content, jmix:list, jmix:hiddenType orderable
114
+ + * (namespacemix:pageComponent)
115
+ ```
116
+
117
+ Then in the template:
118
+
119
+ ```tsx
120
+ <Area name="hero" nodeType="namespace:heroArea" />
121
+ <Area name="features" nodeType="namespace:featuresArea" />
122
+ <Area name="footer" nodeType="namespace:pageArea" /> // generic ok for footer
123
+ ```
124
+
125
+ > ⚠️ **Never use a generic `pageArea` for every area.** If all areas accept all `pageComponent` types, editors will see "New Hero Section" as an option in a feature card area, which is confusing and error-prone.
126
+
127
+ > **Sections driven by content folders** (e.g. a tutorials listing that queries `/contents/tutorials/`) should NOT use an Area at all — the template renders them via a server-side query component. Exposing an Area there invites editors to manually add duplicates of auto-queried content.
128
+
129
+ > ⚠️ **CSS gotcha — `Area` renders children directly, no wrapper div.** When wrapping an `<Area>` in a container div and styling children with `.container > div { display: grid }`, the grid won't apply because there is no intermediate `div` — the area's child components are rendered as direct children of `.container`. Always apply grid/flex layout **on the container itself** when its only content is an Area:
130
+ > ```css
131
+ > /* ✅ correct — grid on the container that wraps the Area */
132
+ > .featuresSection .container { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.5rem; }
133
+ > /* ❌ wrong — no div is inserted between container and the card articles */
134
+ > .container > div { display: grid; }
135
+ > ```
136
+
137
+ ### ⚠️ After defining `pageComponent` — update existing components
138
+
139
+ **This is the most common mistake:** if the module already has content types, they all extend `namespacemix:component`. After introducing the custom area type, **editors will not be able to drop anything** until you update the page-level components to extend `namespacemix:pageComponent` instead.
140
+
141
+ Scan all `definition.cnd` files and update every component that should be droppable in page areas:
142
+
143
+ ```cnd
144
+ // Before (editors can't drop in pageArea):
145
+ [namespace:heroSection] > jnt:content, namespacemix:component
146
+
147
+ // After (editors can drop in pageArea):
148
+ [namespace:heroSection] > jnt:content, namespacemix:pageComponent
149
+ ```
150
+
151
+ **Which components need `pageComponent`?**
152
+ - Standalone page sections (hero, feature cards, text blocks, etc.) → `namespacemix:pageComponent`
153
+ - Child-only types (CTA inside hero, card inside list) → keep `namespacemix:component`
154
+ - `jmix:mainResource` types stored in content folders → keep `namespacemix:component`
155
+
156
+ ---
157
+
158
+ ## Step 4 — Page template vs sectioning component
159
+
160
+ Before creating a new page template, ask:
161
+
162
+ | Is this… | Use a… |
163
+ |---|---|
164
+ | A new top-level page layout (different column structure, hero slot) | **New page template** |
165
+ | A layout variation that could be reused as a section on any page | **Sectioning component** (use the build-component skill) |
166
+ | A minor style difference on an existing template | **Named view** of the existing template |
167
+
168
+ **Guideline**: keep page templates small (1–4). Use sectioning components for compositional differences.
169
+
170
+ ---
171
+
172
+ ## Step 5 — Define structural (non-selectable) container nodes
173
+
174
+ Some nodes are purely structural — they hold child nodes but shouldn't appear in the component picker. Omit `namespacemix:component` and add `jmix:hiddenType`:
175
+
176
+ ```cnd
177
+ [namespace:header] > jnt:content, jmix:hiddenType
178
+ + hero (namespace:heroSection)
179
+ ```
180
+
181
+ Render it with `RenderChild`:
182
+
183
+ ```tsx
184
+ // src/components/Header/default.server.tsx
185
+ import { jahiaComponent, RenderChild } from "@jahia/javascript-modules-library";
186
+
187
+ jahiaComponent(
188
+ { componentType: "view", nodeType: "namespace:header" },
189
+ () => <RenderChild name="hero" />,
190
+ );
191
+ ```
192
+
193
+ ---
194
+
195
+ ## Step 6 — Bootstrap site structure with import.xml
196
+
197
+ `import.xml` provisions every new site created from this template set. **Always update it** — editors cannot contribute if there's no page structure to start from.
198
+
199
+ **Minimum required:**
200
+
201
+ ```xml
202
+ <?xml version="1.0" encoding="UTF-8"?>
203
+ <content xmlns:j="http://www.jahia.org/jahia/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0">
204
+ <modules jcr:primaryType="jnt:modules">
205
+ <your-module-name>
206
+
207
+ <!-- Homepage — MUST use your actual template name, not "basic" -->
208
+ <home j:isHomePage="true" j:templateName="homepage" jcr:primaryType="jnt:page">
209
+ <j:translation_en jcr:language="en" jcr:mixinTypes="mix:title"
210
+ jcr:primaryType="jnt:translation" jcr:title="Home"/>
211
+
212
+ <!-- Pre-create area nodes so editors can start dropping content immediately -->
213
+ <hero jcr:primaryType="namespace:pageArea"/>
214
+ <main jcr:primaryType="namespace:pageArea"/>
215
+ </home>
216
+
217
+ <!-- Add sub-pages for each template you created -->
218
+ <documentation j:templateName="documentation" jcr:primaryType="jnt:page">
219
+ <j:translation_en jcr:language="en" jcr:mixinTypes="mix:title"
220
+ jcr:primaryType="jnt:translation" jcr:title="Documentation"/>
221
+ <hero jcr:primaryType="namespace:pageArea"/>
222
+ </documentation>
223
+
224
+ <!-- Offline management pages — never published, system-name locked -->
225
+ <drafts jcr:primaryType="jnt:page" j:templateName="basic"
226
+ jcr:mixinTypes="jmix:systemNameReadonly jmix:nolive">
227
+ <j:translation_en jcr:language="en" jcr:mixinTypes="mix:title"
228
+ jcr:primaryType="jnt:translation" jcr:title="Drafts"/>
229
+ </drafts>
230
+
231
+ <!-- Content folders — store jmix:mainResource content here, not in pages -->
232
+ <contents jcr:primaryType="jnt:contentFolder">
233
+ <articles jcr:primaryType="jnt:contentFolder"
234
+ jcr:mixinTypes="jmix:contributeMode" j:contributeTypes="namespace:docArticle">
235
+ <j:translation_en jcr:language="en" jcr:primaryType="jnt:translation" jcr:title="Articles"/>
236
+ </articles>
237
+ </contents>
238
+
239
+ </your-module-name>
240
+ </modules>
241
+ </content>
242
+ ```
243
+
244
+ **Rules:**
245
+ - `j:templateName` must match the `name:` in your `jahiaComponent` call — if it's wrong, editors get a blank page
246
+ - Pre-create area nodes (`jcr:primaryType="namespace:pageArea"`) so editors don't face empty containers on first open
247
+ - Add a starter component in the hero area so the page isn't visually blank (optional but strongly recommended)
248
+ - Content folders with `jmix:contributeMode` + `j:contributeTypes` restrict what editors can create in them
249
+ - `jmix:systemNameReadonly` prevents editors from renaming or moving management pages; `jmix:nolive` prevents accidental publishing
250
+
251
+ ---
252
+
253
+ ## Step 7 — Build and deploy
254
+
255
+ ```bash
256
+ yarn build && yarn jahia-deploy
257
+ ```
258
+
259
+ > ⚠️ **Do not use `yarn dev`** — it is a continuous file watcher that should only be started manually when needed for rapid iteration. For agentic workflows, always use `yarn build && yarn jahia-deploy` for explicit, one-shot deploys.
260
+
261
+ After deploying, the new template will appear in the **template selection** step when creating a new page (right-click on a page in the sidebar → **+ New Page**).
262
+
263
+ ---
264
+
265
+ ## Common patterns
266
+
267
+ ### Single column with shared footer
268
+
269
+ ```tsx
270
+ <Layout title={title}>
271
+ <Area name="main" />
272
+ <AbsoluteArea name="footer" parent={renderContext.getSite()} nodeType="namespace:footer" />
273
+ </Layout>
274
+ ```
275
+
276
+ ### Two-column layout
277
+
278
+ ```tsx
279
+ <Layout title={title}>
280
+ <div style={{ display: "grid", gridTemplateColumns: "1fr 2fr", gap: "2rem" }}>
281
+ <Area name="sidebar" />
282
+ <Area name="main" />
283
+ </div>
284
+ </Layout>
285
+ ```
286
+
287
+ ### Edit mode-aware rendering
288
+
289
+ ```tsx
290
+ ({ "jcr:title": title }, { renderContext }) => {
291
+ const isEdit = renderContext.isEditMode();
292
+ return (
293
+ <Layout title={title}>
294
+ <Area name="main" />
295
+ <nav style={{ flexDirection: isEdit ? "column" : "row" }}>
296
+ <AbsoluteArea name="footer" parent={renderContext.getSite()} />
297
+ </nav>
298
+ </Layout>
299
+ );
300
+ }
301
+ ```
302
+
303
+ ---
304
+
305
+ ## Validation checklist
306
+ - [ ] `componentType: "template"` and `nodeType: "jnt:page"`
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)
312
+ - [ ] Areas use a custom area node type (not bare `<Area name="..."/>`)
313
+ - [ ] Custom area type has `jmix:list`, `jmix:hiddenType`, and `orderable`
314
+ - [ ] Decision made: page template vs sectioning component (see Step 4)
315
+ - [ ] `yarn build && yarn jahia-deploy` run and template appears in Jahia UI
316
+
317
+ ## Troubleshooting
318
+
319
+ ### 🚨 Area renders blank — content invisible
320
+
321
+ **Symptom:** An Area in your template produces no HTML output at all, even though you can see children in jContent.
322
+
323
+ **Root cause:** Jahia's `Area` component auto-creates the JCR area node using its declared `nodeType` on first page load. If that node was subsequently **deleted and recreated manually** (e.g. via GraphQL) with a *different* type, the declared type and the actual JCR type no longer match — and Jahia silently renders nothing.
324
+
325
+ **Fix:** Delete the mistyped node and let Jahia recreate it automatically:
326
+
327
+ ```graphql
328
+ mutation {
329
+ jcr {
330
+ mutateNode(pathOrId: "/sites/mySite/home/hero") {
331
+ delete
332
+ }
333
+ }
334
+ }
335
+ ```
336
+
337
+ Visit the page — Jahia recreates the node with the correct type and children render again.
338
+
339
+ **Prevention:** Never manually create area nodes via GraphQL with a type that differs from the `nodeType` declared in the template. Always let Jahia auto-create area nodes on first render.
340
+
341
+ > https://academy.jahia.com/tutorials-get-started/front-end-developer/the-about-us-page
@@ -0,0 +1,205 @@
1
+ ---
2
+ name: jahia-dev-create-template-set
3
+ description: Scaffolds a new Jahia JavaScript template set (React). Use this when asked to create a new Jahia module, website, or project.
4
+ ---
5
+
6
+ ## About Jahia JavaScript Modules
7
+
8
+ This skill only covers **JavaScript Modules** — React-based template sets for Jahia 8+. This is the recommended approach for all new Jahia projects.
9
+
10
+ ### JS modules vs Java modules vs Next.js
11
+
12
+ | | Java Modules | JS Modules | Next.js (Headless) |
13
+ |---|---|---|---|
14
+ | Availability | All versions | 8.2+ | Depends on setup |
15
+ | Separate runtime | No | No | Yes |
16
+ | GraphQL required | No | No | Yes |
17
+ | CMS navigation/cache/auth | Yes | Yes | No |
18
+ | Packaging | Maven/jar | NPM/tgz | NPM/tgz |
19
+ | Templating | JSP | JSX | JSX |
20
+ | Module descriptor | pom.xml | package.json | Separate module |
21
+
22
+ Jahia recommends JS or Java modules for most projects. Next.js should only be chosen when integrating with an existing Next.js codebase.
23
+
24
+ ### How JS modules run: GraalVM + GraalJS
25
+
26
+ Jahia JS modules run inside **GraalJS** (part of GraalVM) — a fully ECMAScript-2019-compliant JS engine on the JVM. GraalVM Native Image is **not** used (incompatible with OSGi). Official Jahia Docker images ship with GraalVM pre-configured.
27
+
28
+ **Build pipeline:** Yarn 4 + Vite. The `npm init @jahia/module@latest` scaffolder generates `vite.config.mjs` handling TypeScript, CSS Modules, and client-side JS bundles.
29
+
30
+ **tgz → OSGi transformation:** On install, Jahia converts the NPM tgz into an OSGi bundle. Key `package.json` → `MANIFEST.MF` mappings:
31
+
32
+ | package.json field | MANIFEST.MF clause |
33
+ |---|---|
34
+ | `jahia.module-dependencies` | `Jahia-Depends` |
35
+ | `jahia.server` | `Jahia-NPM-InitScript` |
36
+ | `jahia.required-version` | `Jahia-Required-Version` |
37
+ | `jahia.module-type` | `Jahia-Module-Type` |
38
+ | `jahia.static-resources` | `Jahia-Static-Resources` |
39
+
40
+ **Request flow:**
41
+ 1. Browser request → Jahia servlet
42
+ 2. `TemplateNodeFilter` resolves the template identifier
43
+ 3. `ViewsRegistrar` resolves the JS script for the template
44
+ 4. `GraalVMEngine` pulls a `ContextProvider` from its pool, renders via GraalJS
45
+ 5. `<Area>` / `<Render>` components may call `RenderService` to render child views
46
+ 6. Final HTML assembled and returned
47
+
48
+ The engine maintains a pool of polyglot contexts (one per thread). Each context runs all init scripts (`dist/server/index.js`) on creation. A version counter invalidates stale contexts when modules are added or removed.
49
+
50
+ ---
51
+
52
+ ## Step 1 — Check prerequisites
53
+
54
+ Before scaffolding, verify Node.js and Yarn are available:
55
+
56
+ ```bash
57
+ node --version # must be 22.14+
58
+ yarn --version # must be 4.9+
59
+ ```
60
+
61
+ Node 22.14+ is required. Yarn is managed by **Corepack** (bundled with Node) — no global install needed:
62
+
63
+ ```bash
64
+ corepack enable yarn
65
+ ```
66
+
67
+ If Node is missing or outdated, install it from [nodejs.org/en/download](https://nodejs.org/en/download) — select **for your platform** and **with Yarn**. Alternatively use mise:
68
+
69
+ ```bash
70
+ mise use node@lts && corepack enable yarn
71
+ ```
72
+
73
+ Do not proceed until both `node --version` (22.14+) and `yarn --version` (4.9+) pass.
74
+
75
+ ---
76
+
77
+ ## Step 2 — Scaffold the module
78
+
79
+ Run the interactive CLI and **show the user its full output**:
80
+
81
+ ```bash
82
+ npm init @jahia/module@latest <project-name>
83
+ ```
84
+
85
+ The CLI will prompt interactively for:
86
+
87
+ | Prompt | Guidance |
88
+ |--------|----------|
89
+ | Module name | kebab-case, e.g. `my-site` |
90
+ | Output directory | accept the default (`./<module-name>`) |
91
+ | Module type | see below |
92
+
93
+ **Module type — always choose a template set:**
94
+ - `A minimal Hello World template set` ✅ — best starting point, includes working components
95
+ - `An empty template set` — blank canvas, for experienced developers
96
+
97
+ Once the project is created, the CLI will suggest commands to start it. Run them in order — they start Docker (Jahia) and push the module.
98
+
99
+ ---
100
+
101
+ ## Step 3 — After generation
102
+
103
+ 1. `cd <project-name>`
104
+ 2. `yarn install` — install dependencies
105
+
106
+ To run the module locally, use the `/jahia-dev-start-local` skill next.
107
+
108
+ ---
109
+
110
+ ## Step 4 — Build and deploy the module
111
+
112
+ Once Jahia is running at `http://localhost:8080`, build and deploy the module:
113
+
114
+ ```bash
115
+ yarn build && yarn jahia-deploy
116
+ ```
117
+
118
+ `yarn jahia-deploy` (from `@jahia/vite-plugin` 1.2.0+) always uses curl and defaults to `http://localhost:8080` / `root:root1234` — no `.env` configuration is required for standard local development.
119
+
120
+ Verify the module is installed:
121
+
122
+ ```
123
+ tool: content.get
124
+ args: { "path": "/modules/<module-name>" }
125
+ ```
126
+
127
+ Replace `<module-name>` with the `name` from `package.json`. The response should contain the module node.
128
+
129
+ ---
130
+
131
+ ## Step 5 — Create a new site in Jahia
132
+
133
+ After the module is deployed, create the site via MCP:
134
+
135
+ ```
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
+ }
144
+ ```
145
+
146
+ Replace `<module-name>` with the `name` from `package.json`. `templateSet` must exactly match the deployed module name.
147
+
148
+ Verify the site was created:
149
+
150
+ ```
151
+ tool: site.list
152
+ ```
153
+
154
+ The site key must appear in the response. If it does not, check that `templateSet` exactly matches the deployed module name.
155
+
156
+ ---
157
+
158
+ ## Generated structure (Hello World template set)
159
+
160
+ ```
161
+ <module-name>/
162
+ ├── .github/ # GitHub Actions (builds on push)
163
+ ├── .vscode/ # VSCode config — install recommended extensions!
164
+ ├── src/
165
+ │ ├── components/ # React content type components
166
+ │ └── templates/ # Page layouts
167
+ ├── settings/
168
+ │ ├── content-types-icons/ # 32×32 PNG icons per content type
169
+ │ ├── definitions.cnd # Module-level CND (mixins, base types)
170
+ │ ├── import.xml # Content/pages provisioned on site creation
171
+ │ ├── locales/ # i18n (en.json, fr.json, ...)
172
+ │ ├── resources/ # Editor UI labels (.properties files)
173
+ │ └── template-thumbnail.png # Shown in the Jahia template picker
174
+ ├── static/ # Static files (images, fonts, vendor CSS/JS)
175
+ ├── docker-compose.yml # Local Jahia instance
176
+ ├── docker/provisioning.yml
177
+ ├── .env # Environment variables for build tools
178
+ ├── .node-version # Node version pin (used by GitHub Actions)
179
+ ├── package.json
180
+ ├── vite.config.mjs
181
+ └── tsconfig.json
182
+ ```
183
+
184
+ `static/` is served at `/modules/<name>/` — reference files there with `buildModuleFileUrl("image.png")`.
185
+
186
+ ---
187
+
188
+ ## References
189
+ - https://github.com/Jahia/javascript-modules (monorepo — includes the `create-module` archetype)
190
+
191
+ ## Troubleshooting
192
+
193
+ If anything goes wrong during setup or scaffolding, refer to the official Jahia front-end developer setup guide:
194
+
195
+ > https://academy.jahia.com/tutorials-get-started/front-end-developer/setting-up-your-dev-environment
196
+
197
+ ---
198
+
199
+ ## Validation checklist
200
+ - [ ] `node --version` reports 22.14+
201
+ - [ ] `yarn --version` reports 4.9+ (via Corepack)
202
+ - [ ] Module directory created with expected structure
203
+ - [ ] `yarn install` completes without errors
204
+ - [ ] `yarn build && yarn jahia-deploy` succeeds — module appears at `/modules/<name>` in JCR
205
+ - [ ] Site created with `site.create` — `site.list` confirms site key exists