一键导入
api-routing
IMPORTANT: Load when creating or modifying Ktor routes. Covers auth wrappers, JWT, TOTP, rate limiting, and response patterns.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
IMPORTANT: Load when creating or modifying Ktor routes. Covers auth wrappers, JWT, TOTP, rate limiting, and response patterns.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Load when adding scheduled tasks, periodic jobs, or background coroutines. Covers the coroutine-based task pattern, error handling, and lifecycle management.
Load when configuring build pipeline, CI workflows, SonarCloud, JaCoCo, or the Gradle version catalog. Covers fatJar, ktlint, and dependency management.
Load when adding new configuration properties, modifying HOCON files, or understanding how config is loaded. Covers app.conf, application.conf, and the loading pipeline.
IMPORTANT: Load when adding error handling in routes, services, or repositories. Covers AcknowledgeBO vs exceptions, standardized responses, and proper logging.
Load when implementing multipart file upload, download, or file storage. Covers multipart parsing, validation, disk persistence, and URL generation.
IMPORTANT: Load when adding monitoring, metrics, or logging. Covers Micrometer/Prometheus, SLF4J usage, CallLogging, and observability patterns.
| name | api-routing |
| description | IMPORTANT: Load when creating or modifying Ktor routes. Covers auth wrappers, JWT, TOTP, rate limiting, and response patterns. |
es.wokis.routingdata-accessdata-accessrouting/
├── AuthRouting.kt
├── UserRouting.kt
├── RadioRouting.kt
├── SoundRouting.kt
├── StatsRouting.kt
└── utils/
└── Wrappers.kt
All routes registered in plugins/Routing.kt:
fun Application.configureRouting() {
routing {
setUpAuthRouting()
setUpUserRouting()
setUpSoundRouting()
setUpStatsRouting()
setUpRadioRouting()
}
}
authenticate {
get("/user") {
val user = call.principal<UserBO>()
// ...
}
}
post("/2fa") {
val user = call.principal<UserBO>()!!
withAuthenticator(user) {
// Requires TOTP code in request
}
}
Use the withAuthenticator inline function from TOTPService.
post("/user/image") {
val user = call.principal<UserBO>()!!
verified(user) {
// Only executes if user.emailVerified == true
}
}
Use the verified() wrapper from routing/utils/Wrappers.kt.
plugins/RateLimit.kt)/login, /register): Custom rate limit, 10 requests per minuteRateLimitPluginConfiguration in plugins/RateLimit.ktcall.respond(HttpStatusCode.OK, dtoObject)
call.respond(HttpStatusCode.Created, acknowledgeBO.toDTO())
call.respond(HttpStatusCode.ExpectationFailed, "User not verified")
fun Route.setUpXxxRouting() {
route("/api/path") {
authenticate {
get {
// ...
}
post {
// ...
}
}
}
}
authenticate {} block on protected routessrc/main/kotlin/es/wokis/routing/ — existing routessrc/main/kotlin/es/wokis/plugins/Security.kt — JWT setupsrc/main/kotlin/es/wokis/services/TOTPService.kt — TOTP logicsrc/main/kotlin/es/wokis/routing/utils/Wrappers.kt — verified() wrapper