@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.
- package/CHANGELOG.md +10 -0
- package/dist/antigravity/.agents/rules/jahia.md +51 -0
- package/dist/antigravity/.agents/skills/jahia-cnd-author/SKILL.md +94 -0
- package/dist/antigravity/.agents/skills/jahia-cnd-author/references/cnd-area-types.md +55 -0
- package/dist/antigravity/.agents/skills/jahia-cnd-author/references/cnd-authoring-experience.md +92 -0
- package/dist/antigravity/.agents/skills/jahia-cnd-author/references/cnd-child-nodes.md +74 -0
- package/dist/antigravity/.agents/skills/jahia-cnd-author/references/cnd-jahia-mixins.md +510 -0
- package/dist/antigravity/.agents/skills/jahia-cnd-author/references/cnd-modeling-decisions.md +87 -0
- package/dist/antigravity/.agents/skills/jahia-cnd-author/references/cnd-numbers-dates.md +92 -0
- package/dist/antigravity/.agents/skills/jahia-cnd-author/references/cnd-string-selectors.md +133 -0
- package/dist/antigravity/.agents/skills/jahia-cnd-author/references/cnd-syntax.md +119 -0
- package/dist/antigravity/.agents/skills/jahia-cnd-author/references/types-ts-mapping.md +73 -0
- package/dist/antigravity/.agents/skills/jahia-dev-accessibility/SKILL.md +11 -0
- package/dist/antigravity/.agents/skills/jahia-dev-build-component/SKILL.md +133 -0
- package/dist/antigravity/.agents/skills/jahia-dev-create-page-template/SKILL.md +341 -0
- package/dist/antigravity/.agents/skills/jahia-dev-create-template-set/SKILL.md +205 -0
- package/dist/antigravity/.agents/skills/jahia-dev-create-view/SKILL.md +896 -0
- package/dist/antigravity/.agents/skills/jahia-dev-debug/SKILL.md +176 -0
- package/dist/antigravity/.agents/skills/jahia-dev-import-from/SKILL.md +244 -0
- package/dist/antigravity/.agents/skills/jahia-dev-jexperience/SKILL.md +269 -0
- package/dist/antigravity/.agents/skills/jahia-dev-ops/SKILL.md +50 -0
- package/dist/antigravity/.agents/skills/jahia-dev-ops/references/docker.md +151 -0
- package/dist/antigravity/.agents/skills/jahia-dev-ops/references/monitoring.md +195 -0
- package/dist/antigravity/.agents/skills/jahia-dev-ops/references/provisioning.md +269 -0
- package/dist/antigravity/.agents/skills/jahia-dev-properties/SKILL.md +147 -0
- package/dist/antigravity/.agents/skills/jahia-dev-properties/references/all-properties.md +231 -0
- package/dist/antigravity/.agents/skills/jahia-dev-query-content/SKILL.md +204 -0
- package/dist/antigravity/.agents/skills/jahia-dev-review-cnd/SKILL.md +79 -0
- package/dist/antigravity/.agents/skills/jahia-dev-review-cnd/scripts/check-cnd.d.mts +13 -0
- package/dist/antigravity/.agents/skills/jahia-dev-review-cnd/scripts/check-cnd.mjs +198 -0
- package/dist/antigravity/.agents/skills/jahia-dev-screenshot/SKILL.md +177 -0
- package/dist/antigravity/.agents/skills/jahia-dev-start-local/SKILL.md +121 -0
- package/dist/antigravity/.agents/skills/jahia-jcr-sql2/SKILL.md +257 -0
- package/dist/antigravity/.agents/skills/jahia-review/SKILL.md +63 -0
- package/dist/{claude/.claude/skills/jahia-dev-review → antigravity/.agents/skills/jahia-review-code}/SKILL.md +3 -3
- package/dist/antigravity/.agents/skills/jahia-review-site/SKILL.md +52 -0
- package/dist/antigravity/.agents/skills/jahia-review-site/scripts/review-pages.mjs +74 -0
- package/dist/antigravity/AGENTS.md +62 -0
- package/dist/claude/.claude/rules/jahia.md +1 -1
- package/dist/claude/.claude/skills/jahia-dev-build-component/SKILL.md +2 -2
- package/dist/claude/.claude/skills/jahia-dev-create-view/SKILL.md +2 -2
- package/dist/claude/.claude/skills/jahia-dev-import-from/SKILL.md +1 -1
- package/dist/claude/.claude/skills/jahia-dev-properties/SKILL.md +1 -1
- package/dist/claude/.claude/skills/jahia-dev-query-content/SKILL.md +1 -1
- package/dist/claude/.claude/skills/jahia-jcr-sql2/SKILL.md +1 -2
- package/dist/claude/.claude/skills/jahia-review/SKILL.md +63 -0
- package/dist/{copilot/.agents/skills/jahia-dev-review → claude/.claude/skills/jahia-review-code}/SKILL.md +3 -3
- package/dist/claude/.claude/skills/jahia-review-site/SKILL.md +52 -0
- package/dist/claude/.claude/skills/jahia-review-site/scripts/review-pages.mjs +74 -0
- package/dist/claude/.mcp.json +11 -0
- package/dist/claude/CLAUDE.md +2 -2
- package/dist/codex/.agents/skills/jahia-dev-build-component/SKILL.md +2 -2
- package/dist/codex/.agents/skills/jahia-dev-create-view/SKILL.md +2 -2
- package/dist/codex/.agents/skills/jahia-dev-import-from/SKILL.md +1 -1
- package/dist/codex/.agents/skills/jahia-dev-properties/SKILL.md +1 -1
- package/dist/codex/.agents/skills/jahia-dev-query-content/SKILL.md +1 -1
- package/dist/codex/.agents/skills/jahia-jcr-sql2/SKILL.md +1 -2
- package/dist/codex/.agents/skills/jahia-review/SKILL.md +63 -0
- package/dist/{cursor/.agents/skills/jahia-dev-review → codex/.agents/skills/jahia-review-code}/SKILL.md +3 -3
- package/dist/codex/.agents/skills/jahia-review-site/SKILL.md +52 -0
- package/dist/codex/.agents/skills/jahia-review-site/scripts/review-pages.mjs +74 -0
- package/dist/codex/AGENTS.md +2 -2
- package/dist/copilot/.agents/skills/jahia-dev-build-component/SKILL.md +2 -2
- package/dist/copilot/.agents/skills/jahia-dev-create-view/SKILL.md +2 -2
- package/dist/copilot/.agents/skills/jahia-dev-import-from/SKILL.md +1 -1
- package/dist/copilot/.agents/skills/jahia-dev-properties/SKILL.md +1 -1
- package/dist/copilot/.agents/skills/jahia-dev-query-content/SKILL.md +1 -1
- package/dist/copilot/.agents/skills/jahia-jcr-sql2/SKILL.md +1 -2
- package/dist/copilot/.agents/skills/jahia-review/SKILL.md +63 -0
- package/dist/{codex/.agents/skills/jahia-dev-review → copilot/.agents/skills/jahia-review-code}/SKILL.md +3 -3
- package/dist/copilot/.agents/skills/jahia-review-site/SKILL.md +52 -0
- package/dist/copilot/.agents/skills/jahia-review-site/scripts/review-pages.mjs +74 -0
- package/dist/copilot/AGENTS.md +2 -2
- package/dist/cursor/.agents/skills/jahia-dev-build-component/SKILL.md +2 -2
- package/dist/cursor/.agents/skills/jahia-dev-create-view/SKILL.md +2 -2
- package/dist/cursor/.agents/skills/jahia-dev-import-from/SKILL.md +1 -1
- package/dist/cursor/.agents/skills/jahia-dev-properties/SKILL.md +1 -1
- package/dist/cursor/.agents/skills/jahia-dev-query-content/SKILL.md +1 -1
- package/dist/cursor/.agents/skills/jahia-jcr-sql2/SKILL.md +1 -2
- package/dist/cursor/.agents/skills/jahia-review/SKILL.md +63 -0
- package/dist/cursor/.agents/skills/jahia-review-code/SKILL.md +228 -0
- package/dist/cursor/.agents/skills/jahia-review-site/SKILL.md +52 -0
- package/dist/cursor/.agents/skills/jahia-review-site/scripts/review-pages.mjs +74 -0
- package/dist/cursor/.cursor/mcp.json +11 -0
- package/dist/cursor/.cursor/rules/jahia.mdc +1 -1
- package/dist/gemini/.agents/skills/jahia-dev-build-component/SKILL.md +2 -2
- package/dist/gemini/.agents/skills/jahia-dev-create-view/SKILL.md +2 -2
- package/dist/gemini/.agents/skills/jahia-dev-import-from/SKILL.md +1 -1
- package/dist/gemini/.agents/skills/jahia-dev-properties/SKILL.md +1 -1
- package/dist/gemini/.agents/skills/jahia-dev-query-content/SKILL.md +1 -1
- package/dist/gemini/.agents/skills/jahia-jcr-sql2/SKILL.md +1 -2
- package/dist/gemini/.agents/skills/jahia-review/SKILL.md +63 -0
- package/dist/gemini/.agents/skills/jahia-review-code/SKILL.md +228 -0
- package/dist/gemini/.agents/skills/jahia-review-site/SKILL.md +52 -0
- package/dist/gemini/.agents/skills/jahia-review-site/scripts/review-pages.mjs +74 -0
- package/dist/gemini/.gemini/settings.json +10 -0
- package/dist/gemini/AGENTS.md +2 -2
- package/dist/index.js +14 -2
- package/dist/kiro/.kiro/settings/mcp.json +10 -0
- package/dist/kiro/.kiro/skills/jahia-cnd-author/SKILL.md +94 -0
- package/dist/kiro/.kiro/skills/jahia-cnd-author/references/cnd-area-types.md +55 -0
- package/dist/kiro/.kiro/skills/jahia-cnd-author/references/cnd-authoring-experience.md +92 -0
- package/dist/kiro/.kiro/skills/jahia-cnd-author/references/cnd-child-nodes.md +74 -0
- package/dist/kiro/.kiro/skills/jahia-cnd-author/references/cnd-jahia-mixins.md +510 -0
- package/dist/kiro/.kiro/skills/jahia-cnd-author/references/cnd-modeling-decisions.md +87 -0
- package/dist/kiro/.kiro/skills/jahia-cnd-author/references/cnd-numbers-dates.md +92 -0
- package/dist/kiro/.kiro/skills/jahia-cnd-author/references/cnd-string-selectors.md +133 -0
- package/dist/kiro/.kiro/skills/jahia-cnd-author/references/cnd-syntax.md +119 -0
- package/dist/kiro/.kiro/skills/jahia-cnd-author/references/types-ts-mapping.md +73 -0
- package/dist/kiro/.kiro/skills/jahia-dev-accessibility/SKILL.md +11 -0
- package/dist/kiro/.kiro/skills/jahia-dev-build-component/SKILL.md +133 -0
- package/dist/kiro/.kiro/skills/jahia-dev-create-page-template/SKILL.md +341 -0
- package/dist/kiro/.kiro/skills/jahia-dev-create-template-set/SKILL.md +205 -0
- package/dist/kiro/.kiro/skills/jahia-dev-create-view/SKILL.md +896 -0
- package/dist/kiro/.kiro/skills/jahia-dev-debug/SKILL.md +176 -0
- package/dist/kiro/.kiro/skills/jahia-dev-import-from/SKILL.md +244 -0
- package/dist/kiro/.kiro/skills/jahia-dev-jexperience/SKILL.md +269 -0
- package/dist/kiro/.kiro/skills/jahia-dev-ops/SKILL.md +50 -0
- package/dist/kiro/.kiro/skills/jahia-dev-ops/references/docker.md +151 -0
- package/dist/kiro/.kiro/skills/jahia-dev-ops/references/monitoring.md +195 -0
- package/dist/kiro/.kiro/skills/jahia-dev-ops/references/provisioning.md +269 -0
- package/dist/kiro/.kiro/skills/jahia-dev-properties/SKILL.md +147 -0
- package/dist/kiro/.kiro/skills/jahia-dev-properties/references/all-properties.md +231 -0
- package/dist/kiro/.kiro/skills/jahia-dev-query-content/SKILL.md +204 -0
- package/dist/kiro/.kiro/skills/jahia-dev-review-cnd/SKILL.md +79 -0
- package/dist/kiro/.kiro/skills/jahia-dev-review-cnd/scripts/check-cnd.d.mts +13 -0
- package/dist/kiro/.kiro/skills/jahia-dev-review-cnd/scripts/check-cnd.mjs +198 -0
- package/dist/kiro/.kiro/skills/jahia-dev-screenshot/SKILL.md +177 -0
- package/dist/kiro/.kiro/skills/jahia-dev-start-local/SKILL.md +121 -0
- package/dist/kiro/.kiro/skills/jahia-jcr-sql2/SKILL.md +257 -0
- package/dist/kiro/.kiro/skills/jahia-review/SKILL.md +63 -0
- package/dist/kiro/.kiro/skills/jahia-review-code/SKILL.md +228 -0
- package/dist/kiro/.kiro/skills/jahia-review-site/SKILL.md +52 -0
- package/dist/kiro/.kiro/skills/jahia-review-site/scripts/review-pages.mjs +74 -0
- package/dist/kiro/.kiro/steering/jahia.md +55 -0
- package/dist/kiro/AGENTS.md +62 -0
- package/dist/opencode/.agents/skills/jahia-dev-build-component/SKILL.md +2 -2
- package/dist/opencode/.agents/skills/jahia-dev-create-view/SKILL.md +2 -2
- package/dist/opencode/.agents/skills/jahia-dev-import-from/SKILL.md +1 -1
- package/dist/opencode/.agents/skills/jahia-dev-properties/SKILL.md +1 -1
- package/dist/opencode/.agents/skills/jahia-dev-query-content/SKILL.md +1 -1
- package/dist/opencode/.agents/skills/jahia-jcr-sql2/SKILL.md +1 -2
- package/dist/opencode/.agents/skills/jahia-review/SKILL.md +63 -0
- package/dist/opencode/.agents/skills/jahia-review-code/SKILL.md +228 -0
- package/dist/opencode/.agents/skills/jahia-review-site/SKILL.md +52 -0
- package/dist/opencode/.agents/skills/jahia-review-site/scripts/review-pages.mjs +74 -0
- package/dist/opencode/AGENTS.md +2 -2
- package/dist/opencode/opencode.json +12 -0
- package/dist/windsurf/.windsurf/rules/jahia.md +1 -1
- package/dist/windsurf/.windsurf/skills/jahia-dev-build-component/SKILL.md +2 -2
- package/dist/windsurf/.windsurf/skills/jahia-dev-create-view/SKILL.md +2 -2
- package/dist/windsurf/.windsurf/skills/jahia-dev-import-from/SKILL.md +1 -1
- package/dist/windsurf/.windsurf/skills/jahia-dev-properties/SKILL.md +1 -1
- package/dist/windsurf/.windsurf/skills/jahia-dev-query-content/SKILL.md +1 -1
- package/dist/windsurf/.windsurf/skills/jahia-jcr-sql2/SKILL.md +1 -2
- package/dist/windsurf/.windsurf/skills/jahia-review/SKILL.md +63 -0
- package/dist/windsurf/.windsurf/skills/jahia-review-code/SKILL.md +228 -0
- package/dist/windsurf/.windsurf/skills/jahia-review-site/SKILL.md +52 -0
- package/dist/windsurf/.windsurf/skills/jahia-review-site/scripts/review-pages.mjs +74 -0
- package/dist/windsurf/AGENTS.md +2 -2
- package/package.json +1 -1
- package/dist/claude/.claude/skills/jahia-dev-site-review/SKILL.md +0 -70
- package/dist/claude/.claude/skills/jahia-dev-site-review/scripts/review-pages.mjs +0 -85
- package/dist/codex/.agents/skills/jahia-dev-site-review/SKILL.md +0 -70
- package/dist/codex/.agents/skills/jahia-dev-site-review/scripts/review-pages.mjs +0 -85
- package/dist/copilot/.agents/skills/jahia-dev-site-review/SKILL.md +0 -70
- package/dist/copilot/.agents/skills/jahia-dev-site-review/scripts/review-pages.mjs +0 -85
- package/dist/cursor/.agents/skills/jahia-dev-site-review/SKILL.md +0 -70
- package/dist/cursor/.agents/skills/jahia-dev-site-review/scripts/review-pages.mjs +0 -85
- package/dist/gemini/.agents/skills/jahia-dev-review/SKILL.md +0 -228
- package/dist/gemini/.agents/skills/jahia-dev-site-review/SKILL.md +0 -70
- package/dist/gemini/.agents/skills/jahia-dev-site-review/scripts/review-pages.mjs +0 -85
- package/dist/opencode/.agents/skills/jahia-dev-review/SKILL.md +0 -228
- package/dist/opencode/.agents/skills/jahia-dev-site-review/SKILL.md +0 -70
- package/dist/opencode/.agents/skills/jahia-dev-site-review/scripts/review-pages.mjs +0 -85
- package/dist/windsurf/.windsurf/skills/jahia-dev-review/SKILL.md +0 -228
- package/dist/windsurf/.windsurf/skills/jahia-dev-site-review/SKILL.md +0 -70
- package/dist/windsurf/.windsurf/skills/jahia-dev-site-review/scripts/review-pages.mjs +0 -85
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# CND String & Selector Properties
|
|
2
|
+
|
|
3
|
+
## String type variants
|
|
4
|
+
|
|
5
|
+
| Type declaration | Editor widget | When to use |
|
|
6
|
+
|---|---|---|
|
|
7
|
+
| `(string)` | Single-line text input | Short labels, IDs, slugs |
|
|
8
|
+
| `(string, textarea)` | Multi-line text area | Paragraphs, descriptions |
|
|
9
|
+
| `(string, richtext)` | Rich text editor (TinyMCE) | Body content, formatted text |
|
|
10
|
+
| `(string) multiple` | Tag input / list | Lists of plain strings |
|
|
11
|
+
| `(string, tag[autocomplete=<n>,separator='<char>']) multiple` | Tag input with autocomplete | Tagging, keywords |
|
|
12
|
+
| `(string, color)` | Color picker | Color values |
|
|
13
|
+
| `(string, cron)` | Cron expression editor | Scheduling |
|
|
14
|
+
|
|
15
|
+
## Fixed-choice dropdowns
|
|
16
|
+
|
|
17
|
+
Use `(string, choicelist)` + `< 'val1', 'val2'` for a dropdown with a hard-coded list.
|
|
18
|
+
**Never use `choicelist[val1,val2]`** — the bracket syntax is for initializer keywords, not values.
|
|
19
|
+
|
|
20
|
+
```cnd
|
|
21
|
+
- difficulty (string, choicelist) i18n < 'beginner', 'intermediate', 'advanced'
|
|
22
|
+
- variant (string, choicelist) < 'primary', 'secondary', 'ghost'
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## `choicelist[...]` initializer variants
|
|
26
|
+
|
|
27
|
+
| Initializer | What it renders |
|
|
28
|
+
|---|---|
|
|
29
|
+
| `choicelist` | Dropdown from constraints list |
|
|
30
|
+
| `choicelist[componentTypes='<types>']` | Component types/mixins dropdown |
|
|
31
|
+
| `choicelist[country]` | Countries list (ISO codes, localized labels) |
|
|
32
|
+
| `choicelist[menus]` | Site menus |
|
|
33
|
+
| `choicelist[nodes='<path>;<type>;<property>']` | Nodes from a JCR path; supports `$currentSiteTemplatesSet` |
|
|
34
|
+
| `choicelist[nodetypes='<type>']` | Node types inheriting from `<type>`; special values: `PRIMARY;fromDependencies;useName`, `MIXIN;fromDependencies;useName` |
|
|
35
|
+
| `choicelist[permissions]` | Permissions list |
|
|
36
|
+
| `choicelist[renderModes]` | Render modes |
|
|
37
|
+
| `choicelist[resourceBundle]` | Keys as constraints, labels from resource bundle |
|
|
38
|
+
| `choicelist[sortableFieldnames]` | Sortable field names |
|
|
39
|
+
| `choicelist[subnodetypes='<type>']` | Similar to nodetypes |
|
|
40
|
+
| `choicelist[templates]` | Site templates; variants: `mainresource`, `reference`, `subnodes`, `<type>`, with optional `, dependentProperties='<property>'` |
|
|
41
|
+
| `choicelist[templatesNode]` | Node templates; variant: `pageTemplate` |
|
|
42
|
+
| `choicelist[workflow]` | Available workflows |
|
|
43
|
+
| `choicelist[linkTypeInitializer]` | Internal/external/none link picker (see below) |
|
|
44
|
+
|
|
45
|
+
## `mix:title` instead of a title string property
|
|
46
|
+
|
|
47
|
+
**NEVER write `- title (string) i18n mandatory`.**
|
|
48
|
+
Extend `mix:title` instead — it adds `jcr:title`, which Jahia's UI, breadcrumbs, and search use natively.
|
|
49
|
+
|
|
50
|
+
```cnd
|
|
51
|
+
// ✅ Correct
|
|
52
|
+
[ns:heroSection] > jnt:content, nsmix:component, mix:title
|
|
53
|
+
|
|
54
|
+
// ❌ Wrong — duplicates what mix:title already provides
|
|
55
|
+
[ns:heroSection] > jnt:content, nsmix:component
|
|
56
|
+
- title (string) i18n mandatory
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Access in the view as `props["jcr:title"]`.
|
|
60
|
+
|
|
61
|
+
## Link picker — `choicelist[linkTypeInitializer]`
|
|
62
|
+
|
|
63
|
+
**NEVER use `(string)` for a link, URL, href, or path.**
|
|
64
|
+
Use `choicelist[linkTypeInitializer]` — it renders an internal/external/none picker in the editor.
|
|
65
|
+
|
|
66
|
+
**Declare ONLY `j:linkType` in the CND. Do NOT add `j:linknode` or `j:url` — Jahia injects them automatically.**
|
|
67
|
+
|
|
68
|
+
```cnd
|
|
69
|
+
// ✅ Correct — bare minimum
|
|
70
|
+
[ns:callToAction] > jnt:content, nsmix:component
|
|
71
|
+
- label (string) i18n mandatory
|
|
72
|
+
- j:linkType (string, choicelist[linkTypeInitializer]) mandatory
|
|
73
|
+
|
|
74
|
+
// ❌ Wrong — do not declare companion fields
|
|
75
|
+
- j:linknode (weakreference) // injected by Jahia — remove this
|
|
76
|
+
- j:url (string) // injected by Jahia — remove this
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
TypeScript discriminated union for the view:
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
import type { JCRNodeWrapper } from "org.jahia.services.content";
|
|
83
|
+
export type Props =
|
|
84
|
+
| { label?: string; "j:linkType": "none" }
|
|
85
|
+
| { label?: string; "j:linkType": "internal"; "j:linknode"?: JCRNodeWrapper }
|
|
86
|
+
| { label?: string; "j:linkType": "external"; "j:url"?: string; "j:linkTitle"?: string };
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
In the view, switch on `props["j:linkType"]`.
|
|
90
|
+
|
|
91
|
+
## Weakreference picker variants
|
|
92
|
+
|
|
93
|
+
| Initializer | What it picks |
|
|
94
|
+
|---|---|
|
|
95
|
+
| `picker[type='image']` | Image from media library |
|
|
96
|
+
| `picker[type='editoriallink']` | Editorial content node |
|
|
97
|
+
| `picker[type='page']` | Page node |
|
|
98
|
+
| `picker[type='file']` | Any file asset |
|
|
99
|
+
|
|
100
|
+
## Regex constraints on strings
|
|
101
|
+
|
|
102
|
+
```cnd
|
|
103
|
+
- contactEmail (string) < '^$|[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}'
|
|
104
|
+
- slug (string) < '^[a-z0-9-]+$'
|
|
105
|
+
- externalUrl (string) < '^https?://'
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Modifiers / keywords
|
|
109
|
+
|
|
110
|
+
| Keyword | Description |
|
|
111
|
+
|---|---|
|
|
112
|
+
| `i18n` | Translatable per language — **default to always on user-facing fields** |
|
|
113
|
+
| `mandatory` | Required |
|
|
114
|
+
| `multiple` | List of values |
|
|
115
|
+
| `primary` | Highlighted field in editor (one per type) |
|
|
116
|
+
| `autocreated` | Auto-created on node creation; requires `= 'value'` |
|
|
117
|
+
| `indexed=no` | Excludes from indexing |
|
|
118
|
+
| `nofulltext` | Excludes from full-text search |
|
|
119
|
+
| `boost=<float>` | Multiplies full-text search score |
|
|
120
|
+
| `facetable` | Enables faceted search on this property |
|
|
121
|
+
| `protected` | Cannot be set by external tools |
|
|
122
|
+
| `hidden` | Hidden in editor |
|
|
123
|
+
|
|
124
|
+
## Examples combining selectors and modifiers
|
|
125
|
+
|
|
126
|
+
```cnd
|
|
127
|
+
- tags (string, tag[autocomplete=5,separator=',']) multiple
|
|
128
|
+
- color (string, color) = '#000000' autocreated
|
|
129
|
+
- template (string, choicelist[templates]) i18n
|
|
130
|
+
- nodes (weakreference, choicelist[nodes='/sites/systemsite/categories;jnt:category',sort]) multiple
|
|
131
|
+
- image (weakreference, picker[type='image'])
|
|
132
|
+
- page (weakreference, picker[type='page'])
|
|
133
|
+
```
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# CND Syntax Reference
|
|
2
|
+
|
|
3
|
+
## Namespace declarations
|
|
4
|
+
|
|
5
|
+
| Pattern | Example |
|
|
6
|
+
|---|---|
|
|
7
|
+
| `<prefix = 'uri'>` | `<jnt = 'http://www.jahia.org/jahia/nt/1.0'>` |
|
|
8
|
+
|
|
9
|
+
Jahia built-in namespaces:
|
|
10
|
+
|
|
11
|
+
| Prefix | URI |
|
|
12
|
+
|---|---|
|
|
13
|
+
| `j` | `http://www.jahia.org/jahia/1.0` |
|
|
14
|
+
| `jnt` | `http://www.jahia.org/jahia/nt/1.0` |
|
|
15
|
+
| `jmix` | `http://www.jahia.org/jahia/mix/1.0` |
|
|
16
|
+
|
|
17
|
+
Module convention: declare two namespaces — one for node types (`ns`), one for mixins (`nsmix`). The prefix is read from the first `<…>` line in `settings/definitions.cnd`.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Node type definition
|
|
22
|
+
|
|
23
|
+
```cnd
|
|
24
|
+
[ns:nodeType] > ns:baseType, nsmix:mixin1, nsmix:mixin2
|
|
25
|
+
- property1 (type) = 'default' modifier1 modifier2
|
|
26
|
+
+ childNode1 (ns:childType)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Add `abstract` after supertypes to prevent direct instantiation:
|
|
30
|
+
|
|
31
|
+
```cnd
|
|
32
|
+
[ns:abstractType] > jnt:content abstract
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
All component node types must extend `nsmix:component`:
|
|
36
|
+
|
|
37
|
+
```cnd
|
|
38
|
+
[ns:myComponent] > jnt:content, nsmix:component
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Mixin definition
|
|
44
|
+
|
|
45
|
+
```cnd
|
|
46
|
+
[nsmix:myMixin] > jmix:templateMixin mixin
|
|
47
|
+
- property1 (type) = 'default'
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Property anatomy
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
- propertyName (type, visualHint) = 'default' modifier1 modifier2 < constraint1, constraint2
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
| Part | Position | Example |
|
|
59
|
+
|---|---|---|
|
|
60
|
+
| Name | after `-` | `- title` |
|
|
61
|
+
| Type | first parens | `(string)` |
|
|
62
|
+
| Visual hint | after type, same parens | `(string, text)` |
|
|
63
|
+
| Default value | after `=` | `= 'Hello'` |
|
|
64
|
+
| Modifiers | after default | `i18n mandatory multiple autocreated primary` |
|
|
65
|
+
| Constraints | after `<` | `< 'en', 'fr', 'de'` |
|
|
66
|
+
|
|
67
|
+
### Property types
|
|
68
|
+
|
|
69
|
+
| Type | Notes |
|
|
70
|
+
|---|---|
|
|
71
|
+
| `string` | Plain text |
|
|
72
|
+
| `richtext` | HTML rich text |
|
|
73
|
+
| `boolean` | `true` / `false` |
|
|
74
|
+
| `long` | Integer |
|
|
75
|
+
| `double` | Floating point |
|
|
76
|
+
| `decimal` | Exact decimal |
|
|
77
|
+
| `date` | ISO date/time |
|
|
78
|
+
| `weakreference` | Node reference |
|
|
79
|
+
| `uri` | URI string |
|
|
80
|
+
|
|
81
|
+
### Common modifiers
|
|
82
|
+
|
|
83
|
+
| Modifier | Meaning |
|
|
84
|
+
|---|---|
|
|
85
|
+
| `i18n` | Translatable per language |
|
|
86
|
+
| `mandatory` | Must have a value |
|
|
87
|
+
| `multiple` | Multi-value property |
|
|
88
|
+
| `autocreated` | Created automatically |
|
|
89
|
+
| `primary` | Primary property of the node |
|
|
90
|
+
| `hidden` | Not shown in editor UI |
|
|
91
|
+
| `protected` | Not editable by users |
|
|
92
|
+
|
|
93
|
+
### Common visual hints
|
|
94
|
+
|
|
95
|
+
| Hint | Editor widget |
|
|
96
|
+
|---|---|
|
|
97
|
+
| `text` | Single-line text |
|
|
98
|
+
| `textarea` | Multi-line text |
|
|
99
|
+
| `richtext` | Rich text editor |
|
|
100
|
+
| `picker` | Content picker |
|
|
101
|
+
| `color` | Color picker |
|
|
102
|
+
| `checkbox` | Checkbox |
|
|
103
|
+
| `radio` | Radio buttons |
|
|
104
|
+
| `choicelist` | Drop-down list |
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Minimal working example
|
|
109
|
+
|
|
110
|
+
```cnd
|
|
111
|
+
<ns = 'http://www.example.org/ns/1.0'>
|
|
112
|
+
<nsmix = 'http://www.example.org/nsmix/1.0'>
|
|
113
|
+
|
|
114
|
+
[ns:card] > jnt:content, nsmix:component
|
|
115
|
+
- title (string, text) = '' i18n
|
|
116
|
+
- body (string, richtext) i18n
|
|
117
|
+
- ctaLabel (string, text) i18n
|
|
118
|
+
- ctaLink (weakreference, picker[type='page'])
|
|
119
|
+
```
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
## CND type → TypeScript mapping
|
|
2
|
+
|
|
3
|
+
| CND type | TypeScript type | Notes |
|
|
4
|
+
|---|---|---|
|
|
5
|
+
| `string` | `string` | |
|
|
6
|
+
| `string` + `multiple` | `string[]` | |
|
|
7
|
+
| `long` | `number` | 64-bit integer |
|
|
8
|
+
| `double` | `number` | 64-bit float |
|
|
9
|
+
| `boolean` | `boolean` | |
|
|
10
|
+
| `date` | `string` | ISO 8601 string |
|
|
11
|
+
| `weakreference` | `JCRNodeWrapper \| undefined` | Always optional |
|
|
12
|
+
| `weakreference` + `multiple` | `JCRNodeWrapper[]` | |
|
|
13
|
+
|
|
14
|
+
## Required import
|
|
15
|
+
```ts
|
|
16
|
+
import type { JCRNodeWrapper } from "org.jahia.services.content";
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## mix:title
|
|
20
|
+
When a type extends `mix:title`, add `"jcr:title"?: string` to Props.
|
|
21
|
+
|
|
22
|
+
## linkTypeInitializer discriminated union
|
|
23
|
+
When CND has `j:linkType (string, choicelist[linkTypeInitializer])`, use a discriminated union:
|
|
24
|
+
```ts
|
|
25
|
+
export type Props =
|
|
26
|
+
| { "j:linkType": "none" }
|
|
27
|
+
| { "j:linkType": "internal"; "j:linknode"?: JCRNodeWrapper }
|
|
28
|
+
| { "j:linkType": "external"; "j:url"?: string; "j:linkTitle"?: string };
|
|
29
|
+
```
|
|
30
|
+
Add other fields of the type to each union member.
|
|
31
|
+
|
|
32
|
+
## Choicelist (fixed values)
|
|
33
|
+
Use a string literal union:
|
|
34
|
+
```ts
|
|
35
|
+
variant?: "primary" | "secondary" | "ghost";
|
|
36
|
+
columns?: "1" | "2" | "3"; // long choicelist values come through as strings
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Full example
|
|
40
|
+
For a CND type:
|
|
41
|
+
```cnd
|
|
42
|
+
[ns:card] > jnt:content, nsmix:component, mix:title
|
|
43
|
+
- subtitle (string) i18n
|
|
44
|
+
- body (string, richtext) i18n
|
|
45
|
+
- image (weakreference, picker[type='image']) < jmix:image
|
|
46
|
+
- variant (string, choicelist) < 'primary', 'secondary'
|
|
47
|
+
- j:linkType (string, choicelist[linkTypeInitializer]) mandatory
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The `types.ts`:
|
|
51
|
+
```ts
|
|
52
|
+
import type { JCRNodeWrapper } from "org.jahia.services.content";
|
|
53
|
+
|
|
54
|
+
type CardBase = {
|
|
55
|
+
"jcr:title"?: string;
|
|
56
|
+
subtitle?: string;
|
|
57
|
+
body?: string;
|
|
58
|
+
image?: JCRNodeWrapper;
|
|
59
|
+
variant?: "primary" | "secondary";
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export type Props = CardBase & (
|
|
63
|
+
| { "j:linkType": "none" }
|
|
64
|
+
| { "j:linkType": "internal"; "j:linknode"?: JCRNodeWrapper }
|
|
65
|
+
| { "j:linkType": "external"; "j:url"?: string; "j:linkTitle"?: string }
|
|
66
|
+
);
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Rules
|
|
70
|
+
- All properties are optional unless `mandatory` in CND (and even mandatory fields may be absent at runtime — always guard)
|
|
71
|
+
- `weakreference` is always `JCRNodeWrapper | undefined` regardless of `mandatory`
|
|
72
|
+
- Never add `j:linknode` or `j:url` to the CND — they appear in types.ts via the discriminated union because Jahia injects them
|
|
73
|
+
- `i18n` does not affect the TypeScript type
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: jahia-dev-accessibility
|
|
3
|
+
description: Audits a site for accessibility issues
|
|
4
|
+
argument-hint: "[live page]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Run `npx pa11y [live page]` on all live pages to audit a site for accessibility issues.
|
|
8
|
+
|
|
9
|
+
Fix all issues systematically, and re-run the audit until no issues remain.
|
|
10
|
+
|
|
11
|
+
If available, use a subagent to fix issues, with the right amount of context.
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: jahia-dev-build-component
|
|
3
|
+
description: Builds a complete Jahia component (content type + view + CSS) from a description. Meta-skill that orchestrates jahia-cnd-author and jahia-dev-create-view. Use when asked to build a new UI component or section.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Overview
|
|
7
|
+
|
|
8
|
+
This meta-skill builds a complete **Single Directory Component (SDC)** — the standard Jahia component pattern — by sequencing two atomic skills:
|
|
9
|
+
|
|
10
|
+
1. `jahia-cnd-author` → create the CND definition and `types.ts`
|
|
11
|
+
2. `jahia-dev-create-view` → implement the React view and CSS Module
|
|
12
|
+
|
|
13
|
+
Run these steps in order. Do not skip to the view before the content type is defined.
|
|
14
|
+
|
|
15
|
+
**Scale of thumbs**: a well-scoped module has 1–4 page templates, 5–10 content types, 2–5 mixins, 1–4 views per type. If a request exceeds this, split it into multiple work sessions.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Step 0 — Optional: capture reference screenshot (interactive sessions only)
|
|
20
|
+
|
|
21
|
+
If the user provides a reference URL (or mentions a site to model after), invoke `/jahia-dev-screenshot` **before writing any code** to capture the visual spec.
|
|
22
|
+
|
|
23
|
+
> Skip this step in automated / autopilot contexts — screenshot comparison requires human review and adds significant time.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Step 1 — Write the content spec
|
|
28
|
+
|
|
29
|
+
Before writing any code, draft this spec internally. In an interactive session, confirm with the user; in autopilot mode, proceed with your best judgement and document what you chose:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
Name: <ComponentName>
|
|
33
|
+
Description: <What is this for? What does an editor fill in?>
|
|
34
|
+
Fields:
|
|
35
|
+
- fieldName: type / i18n? / mandatory?
|
|
36
|
+
(repeat for each field)
|
|
37
|
+
Views:
|
|
38
|
+
- default: <describe layout>
|
|
39
|
+
- small (optional): <compact variant>
|
|
40
|
+
Used where: <Area on page / nested in <Parent> / listing item>
|
|
41
|
+
Has children: <yes: ChildType / no>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Step 2 — REQUIRED: Invoke `@jahia-cnd-author`
|
|
47
|
+
|
|
48
|
+
**Do not write CND manually.** Jahia-specific patterns (`choicelist[linkTypeInitializer]`, `mix:title`, child nodes for CTAs) are not in LLM training data — writing from memory produces broken output.
|
|
49
|
+
|
|
50
|
+
Invoke `@jahia-cnd-author` as a sub-agent with the complete spec:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
Component: <PascalCase name>
|
|
54
|
+
Namespace prefix: <ns>
|
|
55
|
+
Module path: <absolute path to module root>
|
|
56
|
+
Fields:
|
|
57
|
+
- <fieldName>: <type description> [mandatory] [i18n] [multiple]
|
|
58
|
+
Children: <repeatable sub-items, e.g. "CTA buttons with label + link">
|
|
59
|
+
Usage: <where this component appears, e.g. "dropped in page areas">
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Wait for **PASS** before continuing. If it returns **FAIL**, send the issues back to `@jahia-cnd-author` to fix.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Step 3 — Invoke `jahia-dev-create-view`
|
|
67
|
+
|
|
68
|
+
Use the instructions from the `jahia-dev-create-view` skill to:
|
|
69
|
+
|
|
70
|
+
1. Create `src/components/<Category>/<Name>/default.server.tsx`
|
|
71
|
+
2. Create `src/components/<Category>/<Name>/component.module.css`
|
|
72
|
+
3. Import `Props` from `./types.js`
|
|
73
|
+
4. Use `buildNodeUrl`, `RenderChildren`, `RenderChild` as needed
|
|
74
|
+
5. Run `yarn build && yarn jahia-deploy` to push all changes
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Step 4 — Validate
|
|
79
|
+
|
|
80
|
+
1. In Jahia Page Builder, click **New content** and select the new type
|
|
81
|
+
2. Fill in the content form and click **Save**
|
|
82
|
+
3. Verify the component renders correctly on the page
|
|
83
|
+
4. Check for the error `No rendering set for node: <type>` — if seen, re-run `yarn build && yarn jahia-deploy`
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## SDC structure summary
|
|
88
|
+
|
|
89
|
+
After following this skill, the component should look like:
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
src/components/<Category>/<Name>/
|
|
93
|
+
├── definition.cnd # Content type definition
|
|
94
|
+
├── types.ts # TypeScript Props interface
|
|
95
|
+
├── default.server.tsx # Default React view
|
|
96
|
+
└── component.module.css # CSS Module styles
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Optional additions:
|
|
100
|
+
- `small.server.tsx` — named view (compact/alternate rendering)
|
|
101
|
+
- `<name>.client.tsx` — client-side interactive component
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Nested components
|
|
106
|
+
|
|
107
|
+
If the component has child nodes (e.g. a hero with CTA buttons), repeat Steps 2–4 for each child type, then:
|
|
108
|
+
|
|
109
|
+
1. Add `+ * (namespace:childType)` to the parent's `definition.cnd`
|
|
110
|
+
2. Add `<RenderChildren />` to the parent's view where children should appear
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Troubleshooting
|
|
115
|
+
> https://academy.jahia.com/tutorials-get-started/front-end-developer/making-a-hero-section
|
|
116
|
+
|
|
117
|
+
## References
|
|
118
|
+
|
|
119
|
+
- Preparing for i18n: https://academy.jahia.com/documentation/jahia-cms/jahia-8-2/developer/javascript-module-development/preparing-for-internationalization-i18n
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Validation checklist
|
|
124
|
+
- [ ] Spec written before any code
|
|
125
|
+
- [ ] Component count within scale of thumbs (1–4 templates, 5–10 types, 2–5 mixins, 1–4 views/type)
|
|
126
|
+
- [ ] `definition.cnd` created with correct namespace and mixins
|
|
127
|
+
- [ ] `types.ts` reflects all CND properties
|
|
128
|
+
- [ ] `default.server.tsx` renders without errors
|
|
129
|
+
- [ ] Views handle null/missing fields gracefully (mandatory does not guarantee a value at runtime)
|
|
130
|
+
- [ ] `component.module.css` applied and visible
|
|
131
|
+
- [ ] Semantic HTML used: correct heading level, `alt` text on images, sufficient colour contrast
|
|
132
|
+
- [ ] Component appears in Page Builder content picker
|
|
133
|
+
- [ ] Content can be created and renders on the page
|