[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74FW2TAY85B2081F77JA16X":3,"skill-same:01M74FW2TAY85B2081F77JA16X":69},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":13,"repositoryHtmlUrl":25,"repositoryHomepageUrl":6,"ownerHtmlUrl":26,"ownerBlogUrl":6,"ownerDescription":27,"updatedAt":28,"install":29,"resources":42},"01M74FW2TAY85B2081F77JA16X","postgresql-exposed-orm",null,"Astrumon\u002Fspovishun-skills","Astrumon","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F67917191?v=4","01M74FSGPFMM3XWY2PMSEN8Z2W","Danylo Bidnyk","01M74FSGQ12JX4QM4FEY6NEH6N",0,"MIT","https:\u002F\u002Fgithub.com\u002FAstrumon\u002Fspovishun-skills\u002Fblob\u002Fmain\u002Fskills\u002Fpostgresql-exposed-orm\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"# PostgreSQL with Kotlin Exposed ORM\n\n## Workflow\n\n1. Identify the task area from the user's request.\n2. Match it to the **Decision Table** below.\n3. Read `references\u002F\u003Cchosen>.md` using the `Read` tool.\n4. Apply patterns from that reference, combined with the Always-Active Rules below.\n\n## Decision Table\n\n| If the task involves… | Read first |\n|---|---|\n| Table design, column types, indexes, composite keys, foreign keys | `references\u002Ftable-definitions.md` |\n| SELECT, JOIN, WHERE, GROUP BY, batchInsert, DSL vs DAO, N+1 | `references\u002Fquery-patterns.md` |\n| `transaction{}`, `newSuspendedTransaction`, rollback, retry on deadlock | `references\u002Ftransactions.md` |\n| Flyway SQL migrations, naming convention, `generateMigration` task | `references\u002Fmigrations-flyway.md` |\n| HikariCP pool sizing, timeouts, Neon\u002Fcloud config | `references\u002Fhikaricp-config.md` |\n\n## Always-Active Rules\n\n- **Always use `safeDbQuery { }`** — never bare `transaction { }` or a hand-rolled `ResultContainer.catching { transaction { } }`.\n- `safeDbQuery` lives in `data\u002Fdb\u002FDatabaseFactory.kt` and is the only DB entry point — it does `withContext(Dispatchers.IO)` + `transaction { }` + `ResultContainer.catching` itself.\n- **Only `DatabaseFactory.kt` may use `Dispatchers.IO`.**\n- DDL changes require a Flyway migration via `.\u002Fgradlew generateMigration` — never hand-edit applied files.\n\n## Output Format\n\nWhen reviewing or designing DB code:\n1. **Schema assessment** — table structure, index coverage, constraint correctness\n2. **Query analysis** — N+1 risks, missing indexes, transaction boundaries\n3. **Migration note** — if DDL changes are needed, generate via `.\u002Fgradlew generateMigration`\n4. **Code issues** — violations of `safeDbQuery` rule or layer boundary (`data → domain`)\n\n## Do NOT\n\n- Do NOT load all reference files at once — pick exactly one per the Decision Table.\n- Do NOT bypass `safeDbQuery` by wrapping `transaction {}` in `ResultContainer.catching {}` manually.\n- Do NOT use bare `transaction {}` directly in repository `data\u002F` layer code.\n- Do NOT edit a Flyway migration file that has already been applied to any database.\n- Do NOT use `Dispatchers.IO` outside of `DatabaseFactory.kt`.\n\n## Error Handling\n\n- If the task type does not match any Decision Table row, ask the user to clarify before proceeding.\n- If a reference file is missing, STOP and report the expected path.\n\n## Related Skills\n\n- `database-optimizer` — query performance, index design, EXPLAIN ANALYZE\n- `kotlin-specialist` — Kotlin coroutines and dispatcher rules that apply in DB context\n- `unit-testing-kotlin` — how to test repositories with MockImpl (no live DB in unit tests)\n\n## Example Invocation\n\n- User: \"Add a unique index to the Members table\" → load `references\u002Ftable-definitions.md`, apply the index pattern.\n- User: \"Why is my query slow?\" → load `references\u002Fquery-patterns.md`, check N+1 and missing indexes.\n",{},"main","4ad702b3d4f403306c1a016277020693dd669f55","skills\u002Fpostgresql-exposed-orm","https:\u002F\u002Fgithub.com\u002FAstrumon\u002Fspovishun-skills","https:\u002F\u002Fgithub.com\u002FAstrumon","Software Engineer","2026-10-14 01:01:46",{"source":7,"skillName":5,"commands":30,"prompt":40,"zipAvailable":41},[31,34,37],{"tool":32,"command":33},"npx","npx skills add Astrumon\u002Fspovishun-skills --skill postgresql-exposed-orm",{"tool":35,"command":36},"bunx","bunx skills add Astrumon\u002Fspovishun-skills --skill postgresql-exposed-orm",{"tool":38,"command":39},"pnpm","pnpm dlx skills add Astrumon\u002Fspovishun-skills --skill postgresql-exposed-orm","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAstrumon\u002Fspovishun-skills\u002Fblob\u002Fmain\u002Fskills\u002Fpostgresql-exposed-orm\u002FSKILL.md",true,[43,49,53,57,61,65],{"path":44,"resourceType":45,"resourceTypeDesc":46,"sizeBytes":47,"sourceHtmlUrl":48},"manifest.yaml","REFERENCE","参考文档",511,"https:\u002F\u002Fgithub.com\u002FAstrumon\u002Fspovishun-skills\u002Fblob\u002Fmain\u002Fskills\u002Fpostgresql-exposed-orm\u002Fmanifest.yaml",{"path":50,"resourceType":45,"resourceTypeDesc":46,"sizeBytes":51,"sourceHtmlUrl":52},"references\u002Fhikaricp-config.md",1739,"https:\u002F\u002Fgithub.com\u002FAstrumon\u002Fspovishun-skills\u002Fblob\u002Fmain\u002Fskills\u002Fpostgresql-exposed-orm\u002Freferences\u002Fhikaricp-config.md",{"path":54,"resourceType":45,"resourceTypeDesc":46,"sizeBytes":55,"sourceHtmlUrl":56},"references\u002Fmigrations-flyway.md",2071,"https:\u002F\u002Fgithub.com\u002FAstrumon\u002Fspovishun-skills\u002Fblob\u002Fmain\u002Fskills\u002Fpostgresql-exposed-orm\u002Freferences\u002Fmigrations-flyway.md",{"path":58,"resourceType":45,"resourceTypeDesc":46,"sizeBytes":59,"sourceHtmlUrl":60},"references\u002Fquery-patterns.md",2889,"https:\u002F\u002Fgithub.com\u002FAstrumon\u002Fspovishun-skills\u002Fblob\u002Fmain\u002Fskills\u002Fpostgresql-exposed-orm\u002Freferences\u002Fquery-patterns.md",{"path":62,"resourceType":45,"resourceTypeDesc":46,"sizeBytes":63,"sourceHtmlUrl":64},"references\u002Ftable-definitions.md",2670,"https:\u002F\u002Fgithub.com\u002FAstrumon\u002Fspovishun-skills\u002Fblob\u002Fmain\u002Fskills\u002Fpostgresql-exposed-orm\u002Freferences\u002Ftable-definitions.md",{"path":66,"resourceType":45,"resourceTypeDesc":46,"sizeBytes":67,"sourceHtmlUrl":68},"references\u002Ftransactions.md",3418,"https:\u002F\u002Fgithub.com\u002FAstrumon\u002Fspovishun-skills\u002Fblob\u002Fmain\u002Fskills\u002Fpostgresql-exposed-orm\u002Freferences\u002Ftransactions.md",[70,76,82,89,94,99],{"skillNo":71,"name":72,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":18},"01M74FX71JH2KNG5KX7TZHSKCB","universal-skill","https:\u002F\u002Fgithub.com\u002FAstrumon\u002Fspovishun-skills\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fsource\u002Fskills\u002Funiversal-skill\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":18},"01M74FX57GTEFPJVCPWPSP6CCW","notion-skill","https:\u002F\u002Fgithub.com\u002FAstrumon\u002Fspovishun-skills\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fsource\u002Fskills\u002Fnotion-skill\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":18},"01M74FX30F3K8906P5ASQ3DNXR","inline-frontmatter-skill","Hand-authored description that already lives in the body and must not be double-wrapped.","https:\u002F\u002Fgithub.com\u002FAstrumon\u002Fspovishun-skills\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fsource\u002Fskills\u002Finline-frontmatter-skill\u002FSKILL.md",[],[],{"skillNo":90,"name":72,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":18},"01M74FX18AGHM2KHQ502PMJZRJ","https:\u002F\u002Fgithub.com\u002FAstrumon\u002Fspovishun-skills\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fsource-v2\u002Fskills\u002Funiversal-skill\u002FSKILL.md",[],[],{"skillNo":95,"name":78,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":18},"01M74FWZJ193G810P0ZJ1PKEZ9","https:\u002F\u002Fgithub.com\u002FAstrumon\u002Fspovishun-skills\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fsource-v2\u002Fskills\u002Fnotion-skill\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":18},"01M74FWPNEZWWGQ2Q37N6MMWP1","write-a-skill","https:\u002F\u002Fgithub.com\u002FAstrumon\u002Fspovishun-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwrite-a-skill\u002FSKILL.md",[],[]]