Automated summary
This skill guides adding a small catalog dimension (tag, status, gender) by inheriting the TPH Party model instead of scaffolding a full entity.
Strengths
- Walks through the whole chain: Party entity, discriminator registration, inherited DTOs, BasePartyService-derived service, and endpoints
- Flags concrete gotchas (int key, extra columns must be nullable, missing discriminator registration yields empty type-scoped queries)
- Provides a clear decision table for when to apply the pattern versus using a full scaffold
- Covers party-to-party links through PartyRelation without inventing extra join tables
Limitations
- Highly specific to a .NET/EF Core codebase where Party, BasePartyService and ResourceIdentifiers already exist
- Assumes familiarity with TPH, policy-based caching and the project's endpoint conventions
- Of little use outside that foundation, since the class and API names are not generic
Use it when adding a shared-shape lookup dimension (id + description + state) that should live in the Parties table rather than its own entity.
Don't use it for an entity with a rich schema, its own relations or a non-integer key, which needs a full scaffold.
Security analysis
SafeThe skill is pure architectural documentation for an internal C# EF Core TPH pattern. It declares only Read, Grep and Glob — no bash, network, write, or execution capability — and contains no install scripts, curl|sh pipelines, credential handling, obfuscated payloads, or instructions to disable safety. All code blocks are illustrative C# class/registration snippets for a known in-house codebase, so there is no meaningful execution risk.
No concerns found
How this analysis is madeExamples
Add a BlogTag catalog dimension using the Party TPH pattern: inherit Party with a Slug property, register the discriminator, create the inherited DTOs and a service derived from BasePartyService.I need a new BlogPostStatus lookup (id + description + state). Should I use the party catalog pattern or scaffold a full entity? Walk me through the steps if it fits.My SearchByCriteriaByPartyTypeAsync<Gender> returns nothing even though rows exist. Check whether the Party discriminator is registered and SetPolicies is called.name: "party-tph-catalog" description: "Use when adding a small polymorphic catalog dimension (Gender, BlogTag, BlogPostStatus, statuses, types, categories-as-lookup) instead of scaffolding a full entity. Covers the Party base (TPH, int key, PartyType discriminator), PartyRelation for party-to-party links, DTO inheritance from Info/Create/UpdatePartyDto, BasePartyService with SetPolicies and SearchByCriteriaByPartyTypeAsync, and discriminator registration. Domain: Persistence, Domain Modeling. Level: Intermediate. Tags: party, tph, discriminator, catalog, lookup." allowed-tools: [Read, Grep, Glob]
Activation
ACTIVATION:
triggers:
- "party pattern"
- "catalog dimension"
- "lookup table"
- "TPH"
- "new tag/status/type entity"
context: decision-point | implementation
anti-triggers:
- "Entities with their own rich schema — use scaffold-template-entity"
- "Anything needing its own table or non-int key"
Detail
Party (TPH) Catalog Pattern
Problem
Small catalog dimensions (Gender, BlogTag, BlogPostStatus, BlogPostVisibility…) each need audit fields, state, soft
delete, permissions and CRUD — but giving each its own table + migration + full scaffold is overkill for rows that are
basically (id, description).
Solution
All catalog dimensions share one table (Parties) via TPH with a PartyType string discriminator.
- Inherit
Party(which already implementsIEntity<int>,IAuditableEntity,IStateEntity;Descriptionserves as the display name). New properties must be nullable/defaulted so they don't interfere with sibling types:
public class BlogTag : Party
{
public string Slug { get; set; } = string.Empty;
public string TagName => Description ?? string.Empty; // computed alias for clarity
}
public class Gender : Party { }
- Register the discriminator in
PartyConfiguration(.HasValue<Gender>(ResourceIdentifiers.Gender)), addDbSet<Gender> GenderstoAppDbSetter, and theResourceIdentifiersconstant. No new table/migration for the type itself (only if you added columns). - DTOs inherit the Party DTOs in one file:
InfoGenderDto : InfoPartyDto,CreateGenderDto : CreatePartyDto,UpdateGenderDto : UpdatePartyDto(reuseDeletePartyDto). - Service inherits
BasePartyService<TParty, TInfo, TCreate, TUpdate, TDelete>(int key, extendsPayloadService<>): callSetPolicies(_cachePolicies)in the constructor;CreateAsyncstampscreateDto.PartyType = typeof(TParty).Nameautomatically; type-scoped reads viaSearchByCriteriaByPartyTypeAsync<TDerived>(model)/ExportByPartyTypeAsync<TDerived>(...)which filter by discriminator through_repository.AsQueryableOfType<TDerived>(false). - Party-to-party links use the
PartyRelationtable (PartyId,RelatedPartyId,RelationshipType,StartDate/EndDate, notes; auditable) — don't invent join tables between dimensions. - Endpoints/permissions follow the standard recipe (
GenderEndpoints : IEndpointDefinition, attribute triad).
Applicability
| Condition | Apply? |
|---|---|
| Small lookup shared-shape dimension (id + description + state) | ✅ Yes |
| Dimension with 1-3 extra nullable columns | ✅ Yes |
| Entity with rich schema, relations, own lifecycle | ❌ No — full scaffold |
| Read-only projection | ❌ No — QueryPayloadService<> |
Gotchas
- Key is
int(Party owns it) — not theGuiddefault of full entities. - New properties on a derived type live on the shared table — keep them nullable or defaulted, or sibling inserts break.
- Forgetting the discriminator registration makes EF treat rows as base
Party— type-scoped queries return empty. SearchByCriteriaByPartyTypeAsynccaches under the first policy (falls back toCacheRoutes.Parties) — callSetPoliciesor you share the generic Parties cache.- Root SKILL.md declares this pattern as its anti-trigger — one entry point per flow: full entity → root skill, catalog dimension → this one.
Related Skills
scaffold-template-entity,permission-model,cache-policy-eviction
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/party-tph-catalog-mryiqfv1/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/party-tph-catalog-mryiqfv1' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/party-tph-catalog-mryiqfv1/download' --output '.skill-downloads/party-tph-catalog-mryiqfv1/SKILL.md.part' && mv '.skill-downloads/party-tph-catalog-mryiqfv1/SKILL.md.part' '.skill-downloads/party-tph-catalog-mryiqfv1/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/party-tph-catalog-mryiqfv1/SKILL.md' && test -s '.skill-downloads/party-tph-catalog-mryiqfv1/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/party-tph-catalog' && cp -R '.skill-downloads/party-tph-catalog-mryiqfv1' '.claude/skills/party-tph-catalog'Cursor
test -f '.skill-downloads/party-tph-catalog-mryiqfv1/SKILL.md' && test -s '.skill-downloads/party-tph-catalog-mryiqfv1/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/party-tph-catalog' && cp -R '.skill-downloads/party-tph-catalog-mryiqfv1' '.cursor/skills/party-tph-catalog'Codex
test -f '.skill-downloads/party-tph-catalog-mryiqfv1/SKILL.md' && test -s '.skill-downloads/party-tph-catalog-mryiqfv1/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/party-tph-catalog' && cp -R '.skill-downloads/party-tph-catalog-mryiqfv1' '.agents/skills/party-tph-catalog'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/party-tph-catalog-mryiqfv1'openskills read 'party-tph-catalog-mryiqfv1'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/party-tph-catalog-mryiqfv1/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
React Hook Form Best Practices
Development
Master React Hook Form: avoid anti-patterns, manage subscriptions, and handle reset, dirty state, and controlled inputs correctly.
Emotion to Mantine Migration
Development
Migrate Emotion styled-components to Mantine components with style props and CSS modules. Use when converting .styled.tsx files or removing @emotion imports.
Scope Creep Detector
Development
Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad PRs, and oversized changes, then suggests keep, split, or justify actions.