Skip to content

PoC: Crud skill test 02 product category#1345

Draft
manuelblum wants to merge 10 commits intocrud-skill-test-01-productfrom
crud-skill-test-02-product-category
Draft

PoC: Crud skill test 02 product category#1345
manuelblum wants to merge 10 commits intocrud-skill-test-01-productfrom
crud-skill-test-02-product-category

Conversation

@manuelblum
Copy link
Contributor

Sample PR showcasing how Claude (Opus 4.6) implements full-stack CRUD from a spec file using Comet skills. The entire
implementation — API entity, admin UI, relation wiring, filtering — was generated from specs/product/02-product-category.md. This also includes updating the existing Product entity with a category relation
and filter.

What's implemented

Area Features
API Entity Scoped ProductCategory entity (domain + language) with self-referencing parentCategory ManyToOne, position field for ordering, MikroORM migration, NestJS module registration
API Resolver & Service Full CRUD (create, update, delete, list, findById, findBySlug), position ordering scoped by domain+language (increment/decrement helpers), server-side slug uniqueness validation with typed ProductCategoryValidationErrorCode enum
DataGrid Non-paginated grid with drag-and-drop row reordering via updateProductCategory mutation. Columns: name, slug, parentCategory (shows parent name). No search/filter per spec
Form Single "General" FieldSet with name, slug, parentCategory (AsyncAutocompleteField with server-side search, self-reference exclusion via excludeId). Slug uniqueness errors shown inline
Pages StackSwitch with grid/add/edit pages, entity toolbar showing category name, ContentScopeIndicator
MasterMenu Route entry with Domain icon at /product-categories
Product ↔ Category relation Added optional category ManyToOne on Product entity, migration, @ResolveField, conditional populate in findAll, category field in Product form (AsyncAutocompleteField in Details fieldset)
Product Grid: Category column New "Category" column showing category name, with custom Autocomplete-based filter component for server-side ManyToOneFilter filtering

Spec

See specs/product/02-product-category.md for the full requirements.

Header Header
DataGrid / Form Testing Screen Recording 2026-03-16 at 08 03 00_splitted
DataGrid Category Filtering Screen Recording 2026-03-16 at 08 05 52_splitted

Comment on lines +47 to +54
const populate: string[] = [];
if (fields?.includes("category")) {
populate.push("category");
}
if (populate.length > 0) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
options.populate = populate as any;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We won't need populate in Comet v9, we'll have to remove it from the skill then.

import { ProductCategoryResolver } from "./product-category.resolver";

@Module({
imports: [MikroOrmModule.forFeature([ProductCategory])],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The skill doesn't use repositories, right? Then it shouldn't be necessary to have those MikroOrmModule.forFeature calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants