Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
feb4ac5
add comet-api-graphql skill
manuelblum Mar 13, 2026
df5e9c6
add comet-admin-translatable-enum
manuelblum Mar 13, 2026
8c24d61
add comet-admin-datagrid skill
manuelblum Mar 13, 2026
9262352
add comet-admin-form-skill
manuelblum Mar 13, 2026
662614f
add comet-admin-pages skill
manuelblum Mar 13, 2026
423a3d9
add comet-crud skill
manuelblum Mar 13, 2026
901d1cf
Fix skill consistency issues
manuelblum Mar 13, 2026
0529f6f
docs: add docs for skills
manuelblum Mar 13, 2026
c0455a7
Fix RadioGroupField props type: use RadioGroupFieldProps instead of S…
Copilot Mar 16, 2026
b9e7099
Fix CheckboxListField skill template: use CheckboxListFieldProps and …
Copilot Mar 16, 2026
6bbb5b1
Use RadioGroupFieldProps instead of SelectFieldProps in RadioGroupFie…
Copilot Mar 16, 2026
26c9a86
Fix `onSelectItem` handler in editable chip skill template (#5328)
Copilot Mar 16, 2026
a4c5c19
Move skills from package-skills/ to skills/
manuelblum Mar 24, 2026
0746829
Rename comet-admin-translatable-enum skill to comet-admin-enum
manuelblum Apr 9, 2026
87ff12a
Remove commit signing and --no-verify guidance from comet-crud skill
manuelblum Apr 9, 2026
b8f2519
Use available DataGrid variant instead of defaulting to DataGridPro
manuelblum Apr 9, 2026
77c520c
comet-api-graphql skill: expand scope options in feature-05-scope
manuelblum Apr 9, 2026
460e9d5
docs: Fix broken link to installing-agent-features guide
manuelblum Jul 20, 2026
06dcf99
comet-admin-form skill: Use current date picker component names
manuelblum Jul 20, 2026
0b83502
Clarify project-local helpers in comet-admin-enum and comet-admin-dat…
manuelblum Jul 20, 2026
902a578
comet-crud skill: Detect package manager and validate serially after …
manuelblum Jul 20, 2026
767cb29
comet-api-graphql skill: Align taught patterns with api-generator output
manuelblum Jul 20, 2026
0255600
docs: Document relationship between agent skills and CRUD generator
manuelblum Jul 20, 2026
3592f12
docs: Position agent skills as successor of the CRUD generator
manuelblum Jul 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cspellignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ retryable
mjml
autonumber
colorpicker
datagrid
datetimerangepickerfield
datetimerangepicker
inlinealert
Expand Down
6 changes: 6 additions & 0 deletions docs/docs/1-getting-started/4-crud-generator/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ title: CRUD Generator
sidebar_position: 4
---

:::warning

The CRUD Generator will be deprecated in a future version. Prefer [Agent Skills](../../11-agent-skills/index.md) for scaffolding CRUD features where possible — they teach AI coding assistants to produce CRUD code in the same style the generator emits, so skill-produced code fits seamlessly next to existing generated code.

:::

To accelerate the development of a feature, the CRUD Generator can be used to generate the usual CRUD operations (in GraphQL) for the feature. The CRUD Generator is available for the API and for the Admin. The CRUD Generator can be used in two ways:

### "True" Generation
Expand Down
88 changes: 88 additions & 0 deletions docs/docs/11-agent-skills/2-comet-crud/1-comet-api-graphql.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
title: comet-api-graphql
sidebar_position: 1
---

The `comet-api-graphql` skill generates the NestJS/GraphQL API layer for a MikroORM entity. It produces the same output style as `@comet/api-generator`: **resolvers contain the CRUD logic** (injecting `EntityManager` directly), while services are generated only when needed — position helpers for ordered entities and hand-written business-logic services for validation hooks.

## What It Generates

- **Entity** — MikroORM entity with decorators, validation, and relations
- **Resolver** — CRUD queries and mutations inline, plus `@ResolveField` for every relation and block
- **Services** (conditional) — position helpers for entities with a `position` field; a business-logic (hooks) service for validation and side effects
- **DTOs** — input, filter, sort, and args classes
- **Paginated Response** — `ObjectType` for paginated list queries
- **Module Registration** — adds the entity, resolver, and any services to the NestJS module

## Key Features

- Pagination, filtering, and sorting via `@comet/cms-api` utilities
- Content scope support for multi-tenant setups
- Position ordering for sortable entities
- All relation types: `ManyToOne`, `OneToMany`, `ManyToMany`, `OneToOne`
- Slug-based queries with unique validation
- Permission decorators on all resolver methods

## Examples

:::tip
Skills should trigger automatically based on your prompt. If a skill does not activate as expected, you can force it by prefixing your prompt with "Use the comet-api-graphql skill" (or `/comet-api-graphql`).
:::

### Minimal — just fields

> Create the API for a `BlogPost` entity with title, content, author (string), and publishedAt (date).

The skill will create a scoped entity with a resolver, DTOs, and module registration using sensible defaults.

### Scoped entity with relations and slug validation

> Create the API for a `Product` entity scoped by domain + language.
>
> **Fields:** name (string, required), slug (string, required, unique per scope),
> description (string, optional), price (decimal, required), isPublished (boolean, default false),
> mainImage (DAM image, optional).
>
> **Enum** productStatus: Draft, InReview, Published, Archived.
>
> **Relations:** ManyToMany to ProductCategory (owner side).
>
> **Validation:** Slug uniqueness validated server-side — return field-level error `SLUG_ALREADY_EXISTS`.
> Price must be positive.

### Entity with position ordering and self-reference

> Create the API for a `ProductCategory` entity scoped by domain + language.
>
> **Fields:** name (string, required), slug (string, required, unique per scope),
> position (number, for manual ordering).
>
> **Relations:** ManyToOne to ProductCategory (optional parent for nesting).

### Sub-entity scoped via parent relation

> Create the API for a `ProductVariant` entity scoped via its parent Product relation
> (use `@ScopedEntity` deriving scope from the product).
>
> **Fields:** name (string, required), sku (string, required), price (decimal, required),
> stock (integer, required, default 0), isAvailable (boolean, default true).
>
> **Enum** variantStatus: Active, OutOfStock, Discontinued.
>
> **Relations:** ManyToOne to Product (required parent).
>
> **Validation:** SKU uniqueness within the parent product — return field-level error `SKU_ALREADY_EXISTS`.

### Unscoped entity with relation

> Create the API for a `ProductReview` entity (not scoped, global).
>
> **Fields:** title (string, required), body (string, required), rating enum (One through Five),
> reviewerName (string, required), reviewedAt (datetime, required), isApproved (boolean, default false).
>
> **Relations:** ManyToOne to Product (required).

### Add fields to an existing entity

> Add a `description` text field and a `ManyToOne` relation to `Department` on the `Employee` entity,
> and update the resolver and DTOs.
58 changes: 58 additions & 0 deletions docs/docs/11-agent-skills/2-comet-crud/2-comet-admin-enum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: comet-admin-enum
sidebar_position: 2
---

The `comet-admin-enum` skill generates React components for displaying and editing GraphQL enums in the Comet admin. It covers translations, colored chips, inline-editable chips, and form field components.

## What It Generates

- **Translation component** — maps enum values to translated labels using `react-intl`
- **Chip component** — colored `MuiChip` for displaying enum values (e.g., status badges)
- **Editable chip** — chip with a dropdown menu that triggers an Apollo mutation to change the value inline
- **Form field components** — `SelectField`, `AutocompleteField`, `RadioGroupField`, `CheckboxListField`

## Key Features

- All components are fully typed against the generated GraphQL enum
- Chip colors are configurable per enum value
- Editable chips handle optimistic updates and error states
- Form fields integrate with Final Form and support validation

## Examples

:::tip
Skills should trigger automatically based on your prompt. If a skill does not activate as expected, you can force it by prefixing your prompt with "Use the comet-admin-enum skill" (or `/comet-admin-enum`).
:::

### All components at once

> Create all enum components for `productStatus`

### Translation component

> Create a translation component for `productStatus`

### Chip

> Create a chip for `productStatus`

### Editable chip

> Create an editable chip for `productStatus` on the `Product` entity

### Select field

> Create a select field for `productStatus`

### Autocomplete field

> Create an autocomplete field for `productStatus`

### Radio group field

> Create a radio group field for `productStatus`

### Checkbox list field

> Create a checkbox list field for `productStatus`
88 changes: 88 additions & 0 deletions docs/docs/11-agent-skills/2-comet-crud/3-comet-admin-datagrid.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
title: comet-admin-datagrid
sidebar_position: 3
---

The `comet-admin-datagrid` skill generates server-side MUI DataGrid components for the Comet admin. All filtering, sorting, searching, and pagination are handled server-side using Apollo Client.

## What It Generates

- DataGrid component with typed columns
- Server-side pagination, sorting, and filtering via `useDataGridRemote` and `usePaginationQuery`
- Toolbar with search, filter button, and actions (add, delete)
- Filter bar components for each filterable field

## Key Features

- Column types: string, boolean, number, date/time, enum (with chips), relations, file uploads
- Multiple variants: standard paginated, non-paginated, row reordering, sub-entity grids
- Selection/checkbox mode for bulk actions
- Excel export support
- Responsive column visibility

## Examples

:::tip
Skills should trigger automatically based on your prompt. If a skill does not activate as expected, you can force it by prefixing your prompt with "Use the comet-admin-datagrid skill" (or `/comet-admin-datagrid`).
:::

### Minimal — no column or filter details

> Create a datagrid for `BlogPost`.

The skill reads the entity's GraphQL schema and generates columns, search, and filters based on the available fields.

### Paginated grid with editable chips, filters, and Excel export

> Create a datagrid for `Product`.
>
> **Columns:** mainImage (thumbnail, excluded from Excel export), name, sku, productType as editable chip,
> categories (comma-separated names), price, productStatus as editable chip, publishedAt, isPublished.
>
> **Search:** by name and sku.
>
> **Filters:** productStatus, productType.
>
> **Features:** Excel export enabled.

### Partial specification — only columns, no filters

> Create a datagrid for `Employee` with columns: name, email, department (relation), hiredAt.

The skill generates the grid with the specified columns. Since no filters or search are mentioned, it will ask or infer reasonable defaults.

### Non-paginated grid with row reordering

> Create a datagrid for `ProductCategory`.
>
> **Columns:** name, slug, parentCategory (show parent name).
>
> **Variant:** Non-paginated grid with drag-and-drop row reordering.
> No search or filters — the dataset is small enough to display in full.

### Sub-entity grid filtered by parent

> Create a datagrid for `ProductVariant` as a sub-entity grid of Product.
>
> **Columns:** name, sku, price, stock, variantStatus as editable chip, isAvailable.
>
> **Search:** by name and sku.
>
> The grid is filtered by the parent product ID passed as a prop.

### Grid with optional relation filter prop

> Create a datagrid for `ProductReview`.
>
> **Columns:** title, rating, reviewerName, product name, reviewedAt, isApproved.
>
> **Search:** by title and reviewerName.
>
> **Filters:** product (relation filter with autocomplete), isApproved.
>
> **Features:** Excel export. The component accepts an optional `productId` prop
> to filter reviews for a specific product (for reuse on the Product detail page).

### Add a column to an existing grid

> Add a `variantCount` column to the `Product` datagrid showing the number of variants per product in a grey Chip.
74 changes: 74 additions & 0 deletions docs/docs/11-agent-skills/2-comet-crud/4-comet-admin-form.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
title: comet-admin-form
sidebar_position: 4
---

The `comet-admin-form` skill generates Final Form components for the Comet admin. All forms support both create and edit modes, save conflict detection, and Apollo Client mutations.

## What It Generates

- Form component using `FinalForm` with `editMode` support
- Apollo `useQuery` for loading existing data (edit mode)
- Apollo `useMutation` for create and update operations
- Field layout using `FieldSet` grouping
- Save conflict detection via `SaveConflictDialog`

## Key Features

- All `@comet/admin` field components: text, textarea, number, checkbox, switch, select, async autocomplete, date/time pickers
- File upload fields (Dam image/file)
- Block fields (rich text, content blocks)
- Validation with field-level and form-level rules
- Automatic dirty-checking and unsaved changes warning

## Examples

:::tip
Skills should trigger automatically based on your prompt. If a skill does not activate as expected, you can force it by prefixing your prompt with "Use the comet-admin-form skill" (or `/comet-admin-form`).
:::

### Minimal

> Create a form for `BlogPost`.

The skill reads the entity's GraphQL schema and generates a form with appropriate field types and a single FieldSet grouping all fields.

### Form with FieldSets, DAM image, and client-side validation

> Create a form for `Product`.
>
> **FieldSets:**
> - "General": name (text), slug (text), description (textarea), categories (AsyncAutocompleteField, multiple)
> - "Details": sku (text), price (number), productType (SelectField)
> - "Publishing": productStatus (SelectField), publishedAt (date picker), isPublished (switch)
> - "Media": mainImage (DAM image)
>
> **Validation:** price must be positive (client-side). sku must match format `[A-Z]{2,4}-[0-9]{4,8}` (client-side).

### Simple form with single FieldSet and relation

> Create a form for `ProductCategory`.
>
> **FieldSets:**
> - "General": name (text), slug (text), parentCategory (AsyncSelectField)

### Sub-entity form (parent set implicitly)

> Create a form for `ProductVariant` (sub-entity of Product — the product field is set implicitly from the parent).
>
> **FieldSets:**
> - "General": name (text), sku (text), variantStatus (SelectField)
> - "Pricing & Stock": price (number), stock (number), isAvailable (switch)
>
> **Validation:** price must be positive, stock must be zero or positive integer (client-side).

### Dialog-based form

> Create a form for `ProductReview` rendered inside an EditDialog (no separate page).
>
> **Fields:** product (AsyncAutocompleteField, placed at the top), title (text), body (textarea),
> rating (SelectField), reviewerName (text), reviewedAt (datetime picker), isApproved (checkbox).

### Add a field to an existing form

> Add a `notes` textarea field to the `Product` form in the "General" FieldSet.
Loading
Loading