Files
mtusi2026lab5/.agents/skills/messenger-kotlin-exposed/SKILL.md
T
2026-11-16 19:54:38 +03:00

2.8 KiB

name, description
name description
messenger-kotlin-exposed Implement and review Kotlin repository, service, transaction, DI and library-DSL changes in this messenger project using its existing Exposed JDBC conventions. Use when editing persistence or its Kotlin callers, rather than for unrelated infrastructure or contract-only work.

Messenger Kotlin and Exposed

Use the project's existing implementations to choose APIs, layout and transaction boundaries. Repository-root paths below identify live sources; inspect the relevant ones instead of copying snippets or rereading the whole application.

Choose the smallest useful context

  • For CRUD, start with the affected interface/model and ExposedUserRepository or ExposedSessionRepository.
  • For multi-write operations or pagination, use ExposedChatRepository and its controller/test.
  • For services/DI, use DefaultChatService, RepositoriesModule and plugins/Koin.kt.
  • Read only the relevant section of project patterns for source links, transaction ownership, pinned dependencies and checks.
  • The attachment/upload/storage implementations are not default style anchors merely because they are nearby; compare their changes with the established examples above.

Implement in the project's idiom

  • Follow the chosen analogue's multiline signatures and constructor parameters, named arguments, vertical query chains, small mapping functions and blank lines between logical stages.
  • Keep Exposed 1.0.0 and its org.jetbrains.exposed.v1.* imports; recheck gradle/libs.versions.toml if dependencies have changed.
  • Use the Table/column DSL for CRUD and expressions. Check utils/exposed/operations before introducing a separate SQL path.
  • Before raw SQL, establish which required operation the pinned DSL and existing extensions cannot express; explain that limitation and parameterize values in the smallest fallback. Migration SQL is a separate, existing workflow.
  • Follow the caller's transaction boundary. Ordinary repositories operate inside it so related writes commit/roll back together; reuse plugins.suspendedTransaction at the existing orchestration layer rather than wrapping each repository method.
  • Use Kotlin library DSLs only where the dependency provides them. The project has Ktor/Koin/Exposed DSLs and the AWS SDK for Kotlin; builders in Java-based integrations can still be appropriate. Check the dependency and local wrapper before deciding.
  • Preserve @Single, constructor injection, interface-based dependencies and existing Koin/KSP module discovery.

Finish the change

Compare the complete diff with the chosen analogues, including other code affected by the user's applicable corrections. Run the relevant checks from the reference, scale them to the change, and state which ran. A passing compile alone does not establish query semantics or transaction atomicity.