@comet/agent-features 9.0.0-canary-20260527154746

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 (35) hide show
  1. package/LICENSE +24 -0
  2. package/package.json +19 -0
  3. package/rules/coding-guidelines/api-nestjs.instructions.md +107 -0
  4. package/rules/coding-guidelines/cdn.instructions.md +24 -0
  5. package/rules/coding-guidelines/general.instructions.md +30 -0
  6. package/rules/coding-guidelines/git.instructions.md +37 -0
  7. package/rules/coding-guidelines/kubernetes.instructions.md +59 -0
  8. package/rules/coding-guidelines/libraries.instructions.md +34 -0
  9. package/rules/coding-guidelines/naming.instructions.md +39 -0
  10. package/rules/coding-guidelines/postgresql.instructions.md +40 -0
  11. package/rules/coding-guidelines/react.instructions.md +102 -0
  12. package/rules/coding-guidelines/security.instructions.md +44 -0
  13. package/rules/coding-guidelines/styling.instructions.md +50 -0
  14. package/rules/coding-guidelines/typescript.instructions.md +50 -0
  15. package/skills/.gitkeep +0 -0
  16. package/skills/comet-block/SKILL.md +246 -0
  17. package/skills/comet-block/references/admin-patterns.md +192 -0
  18. package/skills/comet-block/references/api-patterns.md +183 -0
  19. package/skills/comet-block/references/block-loader.md +368 -0
  20. package/skills/comet-block/references/block-types.md +210 -0
  21. package/skills/comet-block/references/custom-block-field.md +266 -0
  22. package/skills/comet-block/references/fixtures.md +436 -0
  23. package/skills/comet-block/references/image.md +341 -0
  24. package/skills/comet-block/references/migration.md +597 -0
  25. package/skills/comet-block/references/registration.md +167 -0
  26. package/skills/comet-block/references/response-summary.md +102 -0
  27. package/skills/comet-block/references/rich-text.md +309 -0
  28. package/skills/comet-block/references/select.md +176 -0
  29. package/skills/comet-block/references/site-patterns.md +202 -0
  30. package/skills/comet-mail-react/SKILL.md +539 -0
  31. package/skills/comet-mail-react/references/components-and-theme.md +395 -0
  32. package/skills/comet-mail-react/references/layout-patterns.md +315 -0
  33. package/skills/comet-mail-react/references/styling-and-customization.md +306 -0
  34. package/skills/comet-minor-update/SKILL.md +191 -0
  35. package/skills/dev-pm/SKILL.md +100 -0
@@ -0,0 +1,395 @@
1
+ # Components & Theme Reference
2
+
3
+ Detailed reference for all `@comet/mail-react` components, the theme system, module augmentation, and scoped theming.
4
+
5
+ ## Table of Contents
6
+
7
+ 1. [Theme Structure & Defaults](#theme-structure--defaults)
8
+ 2. [Module Augmentation Interfaces](#module-augmentation-interfaces)
9
+ 3. [MjmlMailRoot](#mjmlmailroot)
10
+ 4. [MjmlSection](#mjmlsection)
11
+ 5. [MjmlWrapper](#mjmlwrapper)
12
+ 6. [Text Components](#text-components)
13
+ 7. [HtmlInlineLink](#htmlinlinelink)
14
+ 8. [Scoped Theming](#scoped-theming)
15
+ 9. [MJML Component Re-exports](#mjml-component-re-exports)
16
+
17
+ ---
18
+
19
+ ## Theme Structure & Defaults
20
+
21
+ `createTheme(overrides?)` merges partial overrides into the default theme:
22
+
23
+ | Path | Default | Description |
24
+ | --------------------------- | ----------------------------- | ----------------------------------------------------------- |
25
+ | `sizes.bodyWidth` | `600` | Email container width in pixels |
26
+ | `sizes.contentIndentation` | `{ default: 32, mobile: 16 }` | Left/right padding when `indent` is used |
27
+ | `breakpoints.default` | `createBreakpoint(bodyWidth)` | Auto-set to body width unless explicitly overridden |
28
+ | `breakpoints.mobile` | `createBreakpoint(420)` | Mobile breakpoint (`max-width: 419px`) |
29
+ | `text.fontFamily` | System default | Base font family |
30
+ | `text.fontSize` | `"16px"` | Base font size |
31
+ | `text.lineHeight` | `"20px"` | Base line height |
32
+ | `text.bottomSpacing` | `"16px"` | Default spacing below text when `bottomSpacing` prop is set |
33
+ | `text.defaultVariant` | `undefined` | Variant applied when no `variant` prop is specified |
34
+ | `text.variants` | `{}` | Named typography presets |
35
+ | `colors.background.body` | `"#F2F2F2"` | Email body background |
36
+ | `colors.background.content` | `"#FFFFFF"` | Section content background |
37
+
38
+ ### Breakpoints
39
+
40
+ Breakpoint values are created with `createBreakpoint(pixelWidth)`:
41
+
42
+ ```ts
43
+ createBreakpoint(420);
44
+ // → { value: 420, belowMediaQuery: "@media (max-width: 419px)" }
45
+ ```
46
+
47
+ The `belowMediaQuery` string is ready to use in `registerStyles` calls.
48
+
49
+ ### Responsive Values
50
+
51
+ Many theme properties accept responsive values — objects keyed by breakpoint name:
52
+
53
+ ```ts
54
+ const theme = createTheme({
55
+ sizes: {
56
+ contentIndentation: { default: 40, tablet: 30, mobile: 20 },
57
+ },
58
+ });
59
+ ```
60
+
61
+ The `default` key provides the base value (rendered inline). Other keys generate media query overrides automatically.
62
+
63
+ ---
64
+
65
+ ## Module Augmentation Interfaces
66
+
67
+ These interfaces are empty by default, designed for consumers to extend via `declare module`. Place augmentations in your theme file alongside `createTheme()`, generally below the `createTheme` call.
68
+
69
+ ### TextVariants
70
+
71
+ Controls the `variant` prop on `MjmlText` and `HtmlText`:
72
+
73
+ ```ts
74
+ const theme = createTheme({
75
+ text: {
76
+ defaultVariant: "body",
77
+ variants: {
78
+ heading: { fontSize: "32px", fontWeight: 700, lineHeight: "40px" },
79
+ body: { fontSize: "16px", lineHeight: "24px" },
80
+ caption: { fontSize: "12px", lineHeight: "16px", color: "#666666" },
81
+ },
82
+ },
83
+ });
84
+
85
+ declare module "@comet/mail-react" {
86
+ interface TextVariants {
87
+ heading: true;
88
+ body: true;
89
+ caption: true;
90
+ }
91
+ }
92
+ ```
93
+
94
+ Variant properties accept responsive values:
95
+
96
+ ```ts
97
+ heading: {
98
+ fontSize: { default: "32px", mobile: "24px" },
99
+ lineHeight: { default: "40px", mobile: "30px" },
100
+ bottomSpacing: { default: "24px", mobile: "16px" },
101
+ fontWeight: 700,
102
+ },
103
+ ```
104
+
105
+ ### ThemeBreakpoints
106
+
107
+ Built-in keys are `default` and `mobile`. Add custom breakpoints:
108
+
109
+ ```ts
110
+ import { createBreakpoint, type ThemeBreakpoint } from "@comet/mail-react";
111
+
112
+ const theme = createTheme({
113
+ breakpoints: { tablet: createBreakpoint(540) },
114
+ sizes: {
115
+ contentIndentation: { default: 40, tablet: 30, mobile: 20 },
116
+ },
117
+ });
118
+
119
+ declare module "@comet/mail-react" {
120
+ interface ThemeBreakpoints {
121
+ tablet: ThemeBreakpoint;
122
+ }
123
+ }
124
+ ```
125
+
126
+ New breakpoint keys automatically become available in all responsive theme values.
127
+
128
+ ### ThemeBackgroundColors and ThemeColors
129
+
130
+ Add project-specific color tokens:
131
+
132
+ ```ts
133
+ const theme = createTheme({
134
+ colors: {
135
+ background: { highlight: "#FFF3CD", footer: "#1A1A2E" },
136
+ brand: { primary: "#0066CC", secondary: "#004499" },
137
+ },
138
+ });
139
+
140
+ declare module "@comet/mail-react" {
141
+ interface ThemeBackgroundColors {
142
+ highlight: string;
143
+ footer: string;
144
+ }
145
+ interface ThemeColors {
146
+ brand: { primary: string; secondary: string };
147
+ }
148
+ }
149
+ ```
150
+
151
+ ---
152
+
153
+ ## MjmlMailRoot
154
+
155
+ Root element for every email template. Renders the full MJML skeleton (`<mjml>`, `<mj-head>`, `<mj-body>`) and provides the theme to all descendant components.
156
+
157
+ **Props:**
158
+
159
+ | Prop | Type | Default | Description |
160
+ | ---------- | ----------- | --------------- | --------------------------------------------------------- |
161
+ | `theme` | `Theme` | `createTheme()` | Theme for the email |
162
+ | `config` | `Config` | — | Augmentable values exposed to descendants via `useConfig` |
163
+ | `children` | `ReactNode` | — | Email content |
164
+
165
+ **What it configures from the theme:**
166
+
167
+ - Body width from `theme.sizes.bodyWidth`
168
+ - Body background from `theme.colors.background.body`
169
+ - MJML breakpoint from `theme.breakpoints.mobile` (controls when columns stack)
170
+ - Base font family from `theme.text.fontFamily`
171
+ - Zero default padding on all components
172
+ - Renders all registered styles (`registerStyles`) in the `<head>`
173
+
174
+ **In Storybook:** the decorator wraps stories automatically — pass a custom theme via `parameters.theme`. **Outside Storybook:** wrap content in `MjmlMailRoot` yourself.
175
+
176
+ ---
177
+
178
+ ## MjmlSection
179
+
180
+ Full-width horizontal row with theme integration.
181
+
182
+ **Props** (in addition to standard MJML section props):
183
+
184
+ | Prop | Type | Default | Description |
185
+ | --------------------------- | ------------------------------------- | --------------------------------- | ------------------------------------------------------------------------------- |
186
+ | `indent` | `boolean` | `false` | Applies theme-based left/right padding |
187
+ | `disableResponsiveBehavior` | `boolean` | `false` | Prevents columns from stacking on mobile |
188
+ | `slotProps` | `{ group?: Partial<MjmlGroupProps> }` | — | Forward props to internal `MjmlGroup` (when `disableResponsiveBehavior` is set) |
189
+ | `backgroundColor` | `string` | `theme.colors.background.content` | Override section background color |
190
+
191
+ **CSS classes:** `.mjmlSection`, `.mjmlSection--indented` (when `indent` is set).
192
+
193
+ ```tsx
194
+ <MjmlSection indent>
195
+ <MjmlColumn><MjmlText>Indented content</MjmlText></MjmlColumn>
196
+ </MjmlSection>
197
+
198
+ <MjmlSection disableResponsiveBehavior slotProps={{ group: { width: "100%" } }}>
199
+ <MjmlColumn><MjmlText>Won't stack</MjmlText></MjmlColumn>
200
+ <MjmlColumn><MjmlText>on mobile</MjmlText></MjmlColumn>
201
+ </MjmlSection>
202
+ ```
203
+
204
+ Indentation values come from `theme.sizes.contentIndentation`, which supports responsive values.
205
+
206
+ **Inside `MjmlWrapper`:** the theme-default `backgroundColor` is suppressed so the wrapper's background shows through. An explicit `backgroundColor` prop still wins.
207
+
208
+ ---
209
+
210
+ ## MjmlWrapper
211
+
212
+ Groups multiple `MjmlSection`s that share a background. Must be a direct child of `MjmlBody`; sections go inside.
213
+
214
+ **Props** (standard MJML wrapper props):
215
+
216
+ | Prop | Type | Default | Description |
217
+ | ----------------- | ----------- | --------------------------------- | --------------------------------------------------------------------- |
218
+ | `backgroundColor` | `string` | `theme.colors.background.content` | Background applied to the whole wrapper; shows through inner sections |
219
+ | `children` | `ReactNode` | — | Sections to group |
220
+
221
+ When a theme is present, `MjmlWrapper` applies `theme.colors.background.content` as its default `backgroundColor`. Inner `MjmlSection`s suppress their own theme-default background so the wrapper's color is visible; an explicit `backgroundColor` prop on an inner section still wins.
222
+
223
+ ```tsx
224
+ <MjmlWrapper backgroundColor="#dddddd">
225
+ <MjmlSection indent>
226
+ <MjmlColumn>
227
+ <MjmlText>First row</MjmlText>
228
+ </MjmlColumn>
229
+ </MjmlSection>
230
+ <MjmlSection indent>
231
+ <MjmlColumn>
232
+ <MjmlText>Second row</MjmlText>
233
+ </MjmlColumn>
234
+ </MjmlSection>
235
+ </MjmlWrapper>
236
+ ```
237
+
238
+ Typical uses: multi-section footers with their own color, or grouping sections behind a shared outer padding (e.g., the `direction="rtl"` workaround in [`layout-patterns.md`](layout-patterns.md)). For a region that also needs different default text color or variants, combine `MjmlWrapper` with a scoped `ThemeProvider` — see Scoped Theming below.
239
+
240
+ ---
241
+
242
+ ## Text Components
243
+
244
+ ### MjmlText
245
+
246
+ MJML text component — use inside `MjmlColumn` following the standard layout model.
247
+
248
+ **Props** (in addition to standard MJML text props):
249
+
250
+ | Prop | Type | Description |
251
+ | --------------- | -------------------- | ----------------------------------------- |
252
+ | `variant` | `keyof TextVariants` | Named typography preset from theme |
253
+ | `bottomSpacing` | `boolean` | Add spacing below (from theme or variant) |
254
+
255
+ **CSS classes:** `.mjmlText`, `.mjmlText--{variant}`, `.mjmlText--bottomSpacing`.
256
+
257
+ ```tsx
258
+ <MjmlText variant="heading" bottomSpacing>Large heading with spacing</MjmlText>
259
+ <MjmlText variant="body">Regular body text</MjmlText>
260
+ <MjmlText>Uses defaultVariant if set in theme</MjmlText>
261
+ ```
262
+
263
+ Variant styles merge on top of base theme text styles — properties not set by the variant inherit from the base.
264
+
265
+ ### HtmlText
266
+
267
+ Themed text for use inside ending tags (`MjmlText`, `MjmlRaw`) or custom HTML structures where MJML components can't be used. Renders a plain HTML element.
268
+
269
+ **Props:**
270
+
271
+ | Prop | Type | Default | Description |
272
+ | --------------- | -------------------- | ------- | ---------------------- |
273
+ | `variant` | `keyof TextVariants` | — | Typography preset |
274
+ | `bottomSpacing` | `boolean` | `false` | Add spacing below |
275
+ | `element` | `string` | `"td"` | HTML element to render |
276
+
277
+ **CSS classes:** `.htmlText`, `.htmlText--{variant}`, `.htmlText--bottomSpacing`.
278
+
279
+ ```tsx
280
+ <MjmlRaw>
281
+ <table>
282
+ <tr>
283
+ <HtmlText variant="body">Themed text inside a raw table</HtmlText>
284
+ </tr>
285
+ </table>
286
+ </MjmlRaw>
287
+
288
+ <MjmlText>
289
+ <HtmlText element="div" variant="caption">Rendered as a div</HtmlText>
290
+ </MjmlText>
291
+ ```
292
+
293
+ ### Bottom Spacing
294
+
295
+ Use `bottomSpacing` to add consistent vertical spacing below text elements:
296
+
297
+ ```tsx
298
+ <MjmlText bottomSpacing>First paragraph with spacing below</MjmlText>
299
+ <MjmlText bottomSpacing>Second paragraph with spacing below</MjmlText>
300
+ <MjmlText>Last paragraph, no extra spacing</MjmlText>
301
+ ```
302
+
303
+ The base spacing value comes from `theme.text.bottomSpacing`. Variants can override it individually with their own `bottomSpacing` property (which also supports responsive values).
304
+
305
+ ---
306
+
307
+ ## HtmlInlineLink
308
+
309
+ `<a>` element for use inside `MjmlText` or `HtmlText`. Inherits parent's font styles — even on Outlook Desktop, which normally overrides link typography with its own defaults.
310
+
311
+ **Props:** Standard `<a>` props. Defaults to `target="_blank"` and `text-decoration: underline`.
312
+
313
+ **CSS class:** `.htmlInlineLink`.
314
+
315
+ ```tsx
316
+ <MjmlText variant="body">
317
+ Visit our <HtmlInlineLink href="https://example.com">website</HtmlInlineLink> for more.
318
+ </MjmlText>
319
+ ```
320
+
321
+ ### Outlook Workaround
322
+
323
+ Outlook Desktop ignores `<style>` blocks and applies its own "Hyperlink" style to `<a>` tags, overriding inherited CSS. `HtmlInlineLink` counters this by setting explicit inline styles for font properties (sourced from the parent text component's context). On modern clients, a responsive CSS reset ensures the link adapts when responsive variant overrides apply.
324
+
325
+ ### Custom Color
326
+
327
+ Use `!important` when setting a custom link color — the responsive reset uses `inherit !important`, which would otherwise take precedence:
328
+
329
+ ```tsx
330
+ <HtmlInlineLink href="https://example.com" style={{ color: "#0066cc !important" }}>
331
+ link text
332
+ </HtmlInlineLink>
333
+ ```
334
+
335
+ ---
336
+
337
+ ## Scoped Theming
338
+
339
+ `ThemeProvider` applies a different theme to a subtree. Common use: dark-background sections.
340
+
341
+ **Prefer `MjmlWrapper` when only the background color changes.** Reach for `ThemeProvider` when text color, variants, or other theme values also need to differ — cloning a theme is overkill for a background-only change.
342
+
343
+ ```tsx
344
+ import { ThemeProvider } from "@comet/mail-react";
345
+ import { theme } from "./theme";
346
+
347
+ const darkSectionTheme = {
348
+ ...theme,
349
+ colors: {
350
+ ...theme.colors,
351
+ background: {
352
+ ...theme.colors.background,
353
+ content: "#1A1A2E",
354
+ },
355
+ },
356
+ text: {
357
+ ...theme.text,
358
+ color: "#FFFFFF",
359
+ },
360
+ };
361
+
362
+ function EmailWithDarkFooter() {
363
+ return (
364
+ <>
365
+ <MjmlSection indent>
366
+ <MjmlColumn>
367
+ <MjmlText>Regular content</MjmlText>
368
+ </MjmlColumn>
369
+ </MjmlSection>
370
+
371
+ <ThemeProvider theme={darkSectionTheme}>
372
+ <MjmlSection indent>
373
+ <MjmlColumn>
374
+ <MjmlText>Dark footer with white text</MjmlText>
375
+ </MjmlColumn>
376
+ </MjmlSection>
377
+ </ThemeProvider>
378
+ </>
379
+ );
380
+ }
381
+ ```
382
+
383
+ `ThemeProvider` **replaces** the theme — it does not merge with the parent. Spread the root theme and override only what needs to change to preserve settings like font family, variants, and breakpoints.
384
+
385
+ Theme-aware `registerStyles` entries always resolve against the **root theme** from `MjmlMailRoot`, not nested `ThemeProvider` scopes.
386
+
387
+ ---
388
+
389
+ ## MJML Component Re-exports
390
+
391
+ `@comet/mail-react` re-exports all MJML components from `@faire/mjml-react`. Consumers import everything from `@comet/mail-react` — never from `@faire/mjml-react` directly.
392
+
393
+ Common re-exports: `MjmlColumn`, `MjmlImage`, `MjmlButton`, `MjmlDivider`, `MjmlSpacer`, `MjmlTable`, `MjmlRaw`, `MjmlGroup`, `MjmlAttributes`, `MjmlAll`, `MjmlClass`, `MjmlStyle`, `MjmlComment`, `MjmlConditionalComment`.
394
+
395
+ For the full MJML tag reference: https://documentation.mjml.io/