add-entity
Skill5 starsChanged 39 days agoMITView on GitHub
Use when creating a new database table, entity, or data model. ALWAYS use for any new TypeORM EntitySchema creation.
3 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- andy-dendy-repo/governtheir own version, first seen Nov 16, 2026
- fullstackhero/dotnet-starter-kittheir own version, first seen Oct 8, 2026
- jpoindexter/theft-kitedited, first seen May 20, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- jpoindexter/theft-kit★ 186% same
Wrote their own version · 2
- fullstackhero/dotnet-starter-kit★ 6.9ksame name
- andy-dendy-repo/govern★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository15 other files it gives its agents.
- .agents/features/agents.mdAGENTS.md
- AGENTS.mdAGENTS.md
- add-endpointSkill
- add-featureSkill
- agent-browserSkill
- db-migrationSkill
- designSkill
- grill-meSkill
- local-docker-deploySkill
- mcp-builderSkill
- mintlifySkill
- playwright-e2e-testingSkill
- qadam-builderSkill
- ubiquitous-languageSkill
- versioningSkill
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 1 is distinctive, and 7 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Create entity for $ARGUMENTS.
- Very specific: line 15
Use EntitySchema (NOT decorators)
- Very specific: line 17
Use ApIdSchema for foreign key columns ({ ...ApIdSchema, nullable: false })
- Very specific: line 18
Add projectId column + relation to project (CASCADE delete)
- Very specific: line 19
Add foreignKeyConstraintName on all join columns
- Very specific: line 22
Register entity: Import and add to getEntities() array in packages/server/api/src/app/database/database-connection.ts.
- Very specific: line 25
Read the migration playbook first: .agents/skills/db-migration/SKILL.md (skill /db-migration)
- Very specific: line 28
Add to getMigrations() array (chronological order)
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Add Database Entity
Create entity for $ARGUMENTS.
Steps
- Read the pattern: Open
packages/server/api/src/app/tables/table/table.entity.tsas reference. - Create entity file at
packages/server/api/src/app/{module}/{name}.entity.ts:- Use
EntitySchema(NOT decorators) - Include
...BaseColumnSchemaPart(id, created, updated) - Use
ApIdSchemafor foreign key columns ({ ...ApIdSchema, nullable: false }) - Add
projectIdcolumn + relation to project (CASCADE delete) - Add
foreignKeyConstraintNameon all join columns - Array columns:
{ type: String, array: true, nullable: false }
- Use
- Register entity: Import and add to
getEntities()array inpackages/server/api/src/app/database/database-connection.ts. This is REQUIRED — TypeORM does NOT auto-discover. - Create migration:
- Read the migration playbook first:
.agents/skills/db-migration/SKILL.md(skill/db-migration) - Name:
{Timestamp}{PascalCaseDescription}(e.g.,AddMyFeature1774500000000) - Import in
packages/server/api/src/app/database/postgres-connection.ts - Add to
getMigrations()array (chronological order) - Set
transaction = falsewhen usingCONCURRENTLY.
- Read the migration playbook first:
- Create repository:
const myRepo = repoFactory(MyEntity)— call asmyRepo()ormyRepo(entityManager)for transactions. - Verify:
npm run lint-dev
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

