[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74NFXKGAPJC0ZCK0E01WJ3M":3,"skill-same:01M74NFXKGAPJC0ZCK0E01WJ3M":87},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":32,"repositoryHtmlUrl":33,"repositoryHomepageUrl":34,"ownerHtmlUrl":35,"ownerBlogUrl":36,"ownerDescription":37,"updatedAt":38,"install":39,"resources":52},"01M74NFXKGAPJC0ZCK0E01WJ3M","stack-kotlin",null,"Kotlin language guidelines — idioms, coroutines and flows, Ktor servers, Exposed ORM, and testing with Kotest and MockK","Snakeblack\u002Fospec-workflow","Snakeblack","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F49766621?v=4","01M74NA5A4XHJYFRMG9JHM2R4K","Michael Snake","01M74NA5ASKTH7DG1P6DKC8WTX",3,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FSnakeblack\u002Fospec-workflow\u002Fblob\u002Fmain\u002Fskills\u002Fstack-kotlin\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: stack-kotlin\ndescription: \"Kotlin language guidelines — idioms, coroutines and flows, Ktor servers, Exposed ORM, and testing with Kotest and MockK\"\nlicense: Apache-2.0\nmetadata:\n  author: manuel-retamozo-garcia\n  version: \"1.0\"\ncapabilities: [kotlin]\n---\n\n# Kotlin Development Patterns\n\nIdiomatic Kotlin patterns and best practices for building robust, efficient, and maintainable applications.\n\n## When to Use\n\n- Writing new Kotlin code\n- Reviewing Kotlin code\n- Refactoring existing Kotlin code\n- Designing Kotlin modules or libraries\n- Configuring Gradle Kotlin DSL builds\n- Writing coroutines, flows, Ktor routes, Exposed queries, or Kotlin tests\n\n## Core Rules\n\n1. **Null Safety**: Leverage Kotlin's type system (non-nullable by default). Use safe-call (`?.`) and Elvis (`?:`) operators; never use force-unwarp (`!!`).\n2. **Immutability by Default**: Use `val` for variables, immutable collections, and data class `copy()` for transformations.\n3. **Sealed Types**: Model restricted hierarchies and results with `sealed class` or `sealed interface` for exhaustive `when` expressions.\n4. **Structured Concurrency**: Scope async calls using `coroutineScope` or `supervisorScope`. Respect coroutine cancellation via `ensureActive()`.\n5. **DSL Builders**: Implement type-safe builders using `@DslMarker` and lambda receivers.\n6. **Coroutines and Flows** (`references\u002Fcoroutines-flows.md`): Never `GlobalScope`; `Dispatchers.IO` for blocking I\u002FO, `Default` for CPU work; expose `StateFlow` for state and `SharedFlow` for one-time events; never catch `CancellationException`.\n7. **Ktor** (`references\u002Fktor.md`): Thin routes as `Route` extensions delegating to services; errors mapped centrally in `StatusPages`; protected routes inside `authenticate(\"jwt\")`.\n8. **Exposed** (`references\u002Fexposed.md`): Every query inside `newSuspendedTransaction`; HikariCP with `isAutoCommit = false`; schema through Flyway migrations.\n9. **Testing** (`references\u002Ftesting.md`): Failing test first; Kotest specs, MockK `coEvery`\u002F`coVerify` for suspend functions (never mock data classes); `runTest` with virtual time.\n\n## References\n\nLoad on demand, only the file the task needs:\n* [Kotlin Coding Patterns & Examples](references\u002Fpatterns.md)\n* [Coroutines and Flows](references\u002Fcoroutines-flows.md) — scopes, dispatchers, flow operators, cancellation, Turbine\n* [Ktor Server](references\u002Fktor.md) — routing, content negotiation, auth, Koin; examples in [ktor-patterns.md](references\u002Fktor-patterns.md)\n* [Exposed ORM](references\u002Fexposed.md) — DSL vs DAO, transactions, pooling, migrations; examples in [exposed-patterns.md](references\u002Fexposed-patterns.md)\n* [Testing](references\u002Ftesting.md) — Kotest, MockK, coroutine tests, Kover; examples in [testing-patterns.md](references\u002Ftesting-patterns.md)\n","# Kotlin Development Patterns\n\nIdiomatic Kotlin patterns and best practices for building robust, efficient, and maintainable applications.\n\n## When to Use\n\n- Writing new Kotlin code\n- Reviewing Kotlin code\n- Refactoring existing Kotlin code\n- Designing Kotlin modules or libraries\n- Configuring Gradle Kotlin DSL builds\n- Writing coroutines, flows, Ktor routes, Exposed queries, or Kotlin tests\n\n## Core Rules\n\n1. **Null Safety**: Leverage Kotlin's type system (non-nullable by default). Use safe-call (`?.`) and Elvis (`?:`) operators; never use force-unwarp (`!!`).\n2. **Immutability by Default**: Use `val` for variables, immutable collections, and data class `copy()` for transformations.\n3. **Sealed Types**: Model restricted hierarchies and results with `sealed class` or `sealed interface` for exhaustive `when` expressions.\n4. **Structured Concurrency**: Scope async calls using `coroutineScope` or `supervisorScope`. Respect coroutine cancellation via `ensureActive()`.\n5. **DSL Builders**: Implement type-safe builders using `@DslMarker` and lambda receivers.\n6. **Coroutines and Flows** (`references\u002Fcoroutines-flows.md`): Never `GlobalScope`; `Dispatchers.IO` for blocking I\u002FO, `Default` for CPU work; expose `StateFlow` for state and `SharedFlow` for one-time events; never catch `CancellationException`.\n7. **Ktor** (`references\u002Fktor.md`): Thin routes as `Route` extensions delegating to services; errors mapped centrally in `StatusPages`; protected routes inside `authenticate(\"jwt\")`.\n8. **Exposed** (`references\u002Fexposed.md`): Every query inside `newSuspendedTransaction`; HikariCP with `isAutoCommit = false`; schema through Flyway migrations.\n9. **Testing** (`references\u002Ftesting.md`): Failing test first; Kotest specs, MockK `coEvery`\u002F`coVerify` for suspend functions (never mock data classes); `runTest` with virtual time.\n\n## References\n\nLoad on demand, only the file the task needs:\n* [Kotlin Coding Patterns & Examples](references\u002Fpatterns.md)\n* [Coroutines and Flows](references\u002Fcoroutines-flows.md) — scopes, dispatchers, flow operators, cancellation, Turbine\n* [Ktor Server](references\u002Fktor.md) — routing, content negotiation, auth, Koin; examples in [ktor-patterns.md](references\u002Fktor-patterns.md)\n* [Exposed ORM](references\u002Fexposed.md) — DSL vs DAO, transactions, pooling, migrations; examples in [exposed-patterns.md](references\u002Fexposed-patterns.md)\n* [Testing](references\u002Ftesting.md) — Kotest, MockK, coroutine tests, Kover; examples in [testing-patterns.md](references\u002Ftesting-patterns.md)\n",{"name":5,"license":15,"metadata":24,"description":7,"capabilities":27},{"author":25,"version":26},"manuel-retamozo-garcia","1.0",[28],"kotlin","main","e5fa11517ba3d433260f3077a2b8fadfad290896","skills\u002Fstack-kotlin",0,"https:\u002F\u002Fgithub.com\u002FSnakeblack\u002Fospec-workflow","https:\u002F\u002Fospec-workflow.mretamozo.com","https:\u002F\u002Fgithub.com\u002FSnakeblack","mretamozo.com","Full Stack Developer | Lifelong learner","2026-11-15 04:24:36",{"source":8,"skillName":5,"commands":40,"prompt":50,"zipAvailable":51},[41,44,47],{"tool":42,"command":43},"npx","npx skills add Snakeblack\u002Fospec-workflow --skill stack-kotlin",{"tool":45,"command":46},"bunx","bunx skills add Snakeblack\u002Fospec-workflow --skill stack-kotlin",{"tool":48,"command":49},"pnpm","pnpm dlx skills add Snakeblack\u002Fospec-workflow --skill stack-kotlin","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSnakeblack\u002Fospec-workflow\u002Fblob\u002Fmain\u002Fskills\u002Fstack-kotlin\u002FSKILL.md",true,[53,59,63,67,71,75,79,83],{"path":54,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":57,"sourceHtmlUrl":58},"references\u002Fcoroutines-flows.md","REFERENCE","参考文档",7551,"https:\u002F\u002Fgithub.com\u002FSnakeblack\u002Fospec-workflow\u002Fblob\u002Fmain\u002Fskills\u002Fstack-kotlin\u002Freferences\u002Fcoroutines-flows.md",{"path":60,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":61,"sourceHtmlUrl":62},"references\u002Fexposed-patterns.md",19114,"https:\u002F\u002Fgithub.com\u002FSnakeblack\u002Fospec-workflow\u002Fblob\u002Fmain\u002Fskills\u002Fstack-kotlin\u002Freferences\u002Fexposed-patterns.md",{"path":64,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":65,"sourceHtmlUrl":66},"references\u002Fexposed.md",1518,"https:\u002F\u002Fgithub.com\u002FSnakeblack\u002Fospec-workflow\u002Fblob\u002Fmain\u002Fskills\u002Fstack-kotlin\u002Freferences\u002Fexposed.md",{"path":68,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":69,"sourceHtmlUrl":70},"references\u002Fktor-patterns.md",16701,"https:\u002F\u002Fgithub.com\u002FSnakeblack\u002Fospec-workflow\u002Fblob\u002Fmain\u002Fskills\u002Fstack-kotlin\u002Freferences\u002Fktor-patterns.md",{"path":72,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":73,"sourceHtmlUrl":74},"references\u002Fktor.md",1515,"https:\u002F\u002Fgithub.com\u002FSnakeblack\u002Fospec-workflow\u002Fblob\u002Fmain\u002Fskills\u002Fstack-kotlin\u002Freferences\u002Fktor.md",{"path":76,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":77,"sourceHtmlUrl":78},"references\u002Fpatterns.md",16921,"https:\u002F\u002Fgithub.com\u002FSnakeblack\u002Fospec-workflow\u002Fblob\u002Fmain\u002Fskills\u002Fstack-kotlin\u002Freferences\u002Fpatterns.md",{"path":80,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Ftesting-patterns.md",8841,"https:\u002F\u002Fgithub.com\u002FSnakeblack\u002Fospec-workflow\u002Fblob\u002Fmain\u002Fskills\u002Fstack-kotlin\u002Freferences\u002Ftesting-patterns.md",{"path":84,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":85,"sourceHtmlUrl":86},"references\u002Ftesting.md",1462,"https:\u002F\u002Fgithub.com\u002FSnakeblack\u002Fospec-workflow\u002Fblob\u002Fmain\u002Fskills\u002Fstack-kotlin\u002Freferences\u002Ftesting.md",[88,95,102,109,116,123],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M74NGTKSC65ZZZMZH9SVP86D","work-unit-commits","Plan commits as reviewable work units. Trigger: implementation, commit splitting, chained PRs, or keeping tests and docs with code.","https:\u002F\u002Fgithub.com\u002FSnakeblack\u002Fospec-workflow\u002Fblob\u002Fmain\u002Fskills\u002Fwork-unit-commits\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":19},"01M74NGQBZ2BPFSNGREJJ2RKHG","stack-webmcp","Trigger: WebMCP, document.modelContext, web tools, AI browser agent. Web Model Context Protocol client-side tool standard.","https:\u002F\u002Fgithub.com\u002FSnakeblack\u002Fospec-workflow\u002Fblob\u002Fmain\u002Fskills\u002Fstack-webmcp\u002FSKILL.md",[],[],{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":19},"01M74NGM8GVVSMC8T2CHGR8DFZ","stack-vite","Vite frontend build tool — configuration, plugins, asset loading","https:\u002F\u002Fgithub.com\u002FSnakeblack\u002Fospec-workflow\u002Fblob\u002Fmain\u002Fskills\u002Fstack-vite\u002FSKILL.md",[],[],{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":19},"01M74NGHF902XYK25R6AZ1XK2T","stack-starlight","Astro Starlight documentation framework — setup, sidebar navigation, frontmatter, built-in components, asides, theming, i18n, search","https:\u002F\u002Fgithub.com\u002FSnakeblack\u002Fospec-workflow\u002Fblob\u002Fmain\u002Fskills\u002Fstack-starlight\u002FSKILL.md",[],[],{"skillNo":117,"name":118,"nameZh":6,"description":119,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":19},"01M74NGFD2Q6GKDA7C233756X8","stack-sqlserver","Microsoft SQL Server database — indexing, RCSI, set-based operations, SARGable queries, transaction scopes","https:\u002F\u002Fgithub.com\u002FSnakeblack\u002Fospec-workflow\u002Fblob\u002Fmain\u002Fskills\u002Fstack-sqlserver\u002FSKILL.md",[],[],{"skillNo":124,"name":125,"nameZh":6,"description":126,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":19},"01M74NGACCR2QG9EE5HPN51QBD","stack-springboot","Spring Boot architecture patterns — REST API design, layered services, JPA, caching, Spring Security, TDD with MockMvc and Testcontainers, and pre-release verification","https:\u002F\u002Fgithub.com\u002FSnakeblack\u002Fospec-workflow\u002Fblob\u002Fmain\u002Fskills\u002Fstack-springboot\u002FSKILL.md",[],[]]