@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44
55## Project
66
7- Gradeway is a work-in-progress Minecraft permission gateway ("gateway" — a LuckPerms-style permission/role/group system)
7+ Gradeway is a work-in-progress Minecraft permission gateway ("gateway" – a LuckPerms-style permission/role/group system)
88written in Kotlin, designed to run across multiple Minecraft server platforms (Bukkit, Paper, BungeeCord, Velocity)
99sharing one database-backed permission model.
1010
@@ -22,33 +22,33 @@ sharing one database-backed permission model.
2222```
2323
2424CI (` .github/workflows/ ` ) runs ` detekt ` , ` spotlessCheck ` , ` :core-common:test ` , then ` :core-common:build ` , in that order,
25- against JDK 25 —
25+ against JDK 25 -
2626mirror that sequence locally before considering work done.
2727
2828Tests use ` kotlin.test ` on JUnit Platform with backtick-quoted test names (`` fun `isUuid accepts valid uuids`() `` ).
2929New tests belong under ` core-common/src/test ` ; other modules have no test sources yet.
3030
31- Spotless enforces the license header from ` .assets/LICENSE_HEADER ` on every ` .kt ` file — new files need it,
31+ Spotless enforces the license header from ` .assets/LICENSE_HEADER ` on every ` .kt ` file - new files need it,
3232` spotlessApply ` will add it automatically.
3333
3434## Module layout
3535
36- - ` core-api ` — pure interfaces/data model, no implementation logic. Defines ` Driver ` ,
36+ - ` core-api ` - pure interfaces/data model, no implementation logic. Defines ` Driver ` ,
3737 ` *Manager ` /` *Service ` interfaces, entities (` PlayerEntity ` , ` RoleEntity ` , ` GroupEntity ` ,
3838 ` PermissionEntity ` , attribute types, etc.), the KSP processor, and config data classes. Almost everything here is
3939 meant to be implemented elsewhere.
40- - ` core-common ` — the actual engine: ` Common ` -prefixed implementations of every ` core-api `
40+ - ` core-common ` - the actual engine: ` Common ` -prefixed implementations of every ` core-api `
4141 interface (e.g. ` CommonPermissionService ` implements ` PermissionService ` ,
4242 ` CommonDriverManager ` implements ` DriverManager ` ), Exposed table definitions (` database/models/** ` ), Cloud command
4343 builders (` commands/** ` ), and the migration strategy for importing from LuckPerms. This is the module platform plugins
4444 depend on and the only one with meaningful test coverage.
45- - ` driver-database-* ` / ` driver-messaging-redis ` — standalone driver plugins for a single backend (Postgres, MySQL,
45+ - ` driver-database-* ` / ` driver-messaging-redis ` - standalone driver plugins for a single backend (Postgres, MySQL,
4646 MariaDB, SQLite, SQL Server, Oracle, H2, Redis). Each driver module compiles against ` core-api ` only (` compileOnly ` ),
4747 not ` core-common ` , and is shaded into its own fat jar via the Shadow plugin, dropped into a ` drivers/ ` folder the
4848 running plugin scans.
49- - ` plugin-bukkit-shared ` — code shared between ` plugin-bukkit ` and ` plugin-paper ` (plugin messaging driver/broker,
49+ - ` plugin-bukkit-shared ` - code shared between ` plugin-bukkit ` and ` plugin-paper ` (plugin messaging driver/broker,
5050 connection listener, custom ` PermissibleBase ` ).
51- - ` plugin-bukkit ` , ` plugin-paper ` , ` plugin-bungeecord ` , ` plugin-velocity ` — the actual platform entry points
51+ - ` plugin-bukkit ` , ` plugin-paper ` , ` plugin-bungeecord ` , ` plugin-velocity ` - the actual platform entry points
5252 (` GradewayPlugin ` /` GradewayVelocity ` ), each wiring a ` CommonGradeway<TheirPlatformConfig> `
5353 to platform APIs (command manager, audiences, permission providers, connection listeners).
5454
@@ -67,40 +67,40 @@ depending on their client libraries. The full loop:
67673 . At runtime, ` CommonDriverManager ` (` core-common/.../managers/CommonDriverManager.kt ` ) scans a
6868 ` drivers/ ` directory next to the plugin data folder, opens each jar as a ` ZipFile ` , reads
6969 ` driver.json ` , loads the class via a dedicated ` URLClassLoader ` , and instantiates it.
70- 4 . Platform-specific drivers that need direct access to a platform object (e.g. a Bukkit
70+ 4 . Platform-specific drivers that need direct access to a platform object (e.g., a Bukkit
7171 ` JavaPlugin ` for plugin-messaging) skip the jar-scanning path and are registered directly via
7272 ` DriverManager.registerDriver(...) ` (see ` GradewayPlugin.onEnable() ` ).
7373
7474When adding a new database/messaging backend, follow the pattern of an existing
7575` driver-database-* ` module: ` ksp(project(":core-api")) ` + ` compileOnly(project(":core-api")) ` , implement the adapter,
7676shade third-party client deps via the Shadow plugin, and disable the plain ` jar ` task in favor of ` shadowJar ` .
7777
78- ### Dependency injection & lifecycle
78+ ### Dependency injection and lifecycle
7979
8080` CommonGradeway<TPlatformConfig> ` (` core-common/.../CommonGradeway.kt ` ) is the root object each platform plugin
8181constructs and owns. It uses Koin (` startKoin ` /` stopKoin ` ) to wire every
8282` Common* ` implementation to its ` core-api ` interface, generic over the platform's own config type
83- (` BukkitPlatformConfig ` , ` VelocityPlatformConfig ` , etc. — see ` ConfigManager<TPlatformConfig> ` ). Lifecycle is explicit
83+ (` BukkitPlatformConfig ` , ` VelocityPlatformConfig ` , etc. - see ` ConfigManager<TPlatformConfig> ` ). Lifecycle is explicit
8484and ordered: ` load() ` starts Koin and loads configs → drivers → languages → messaging → confirmations; ` enable() ` /
8585` disable() ` toggle databases and messaging without tearing down Koin; ` unload() ` reverses ` load() ` and calls
86- ` stopKoin() ` (not ` koin.close() ` — ` stopKoin() `
86+ ` stopKoin() ` (not ` koin.close() ` - ` stopKoin() `
8787also deregisters from Koin's global context, which a plain ` close() ` doesn't, so a second
88- ` load() ` in the same JVM — e.g. a plugin disable/enable cycle — would otherwise fail with
88+ ` load() ` in the same JVM - e.g., a plugin disable/enable cycle - would otherwise fail with
8989` KoinApplicationAlreadyStartedException ` ). ` GradewayState ` gates re-entrant calls (` allowLoad ` /
9090` allowUnload ` ).
9191
9292### Error handling
9393
9494Manager/service methods that can fail return Arrow's ` Either<Throwable, T> ` , composed with
95- ` either { ... } ` / ` raise(...) ` blocks rather than thrown exceptions — follow this convention for new manager/service
95+ ` either { ... } ` / ` raise(...) ` blocks rather than thrown exceptions - follow this convention for new manager/service
9696code instead of introducing exceptions or nullable-return error signaling.
9797
9898### Persistence
9999
100100Exposed (` org.jetbrains.exposed ` ) DAO/DSL over JDBC. Tables live in
101101` core-common/.../database/models/** ` , one file per entity, generally paired with a "reference"
102102type in ` core-api ` (e.g. ` RoleEntity ` /` RoleReference ` ) used to pass around an identity without pulling in the full row.
103- Migrations are handled by ` MigrationManager ` /` MigrationStrategy ` — the existing ` LuckPermsMigrationStrategy ` is the
103+ Migrations are handled by ` MigrationManager ` /` MigrationStrategy ` - the existing ` LuckPermsMigrationStrategy ` is the
104104reference implementation for importing another plugin's data.
105105
106106### Commands
@@ -117,7 +117,7 @@ attributes, shared across role/group/player) live in
117117` SuggestionProcessor.passThrough() ` because id suggestions are UUIDs, not the name text the user typed, which the
118118default filtering processor would incorrectly exclude.
119119
120- User-facing text is never hardcoded — commands send ` Component.translatable("gradeway...") ` keys resolved against
120+ User-facing text is never hardcoded - commands send ` Component.translatable("gradeway...") ` keys resolved against
121121` core-common/src/main/resources/languages/en.properties ` . After touching any command builder, use the
122122** sync-translation-keys** skill to reconcile added/removed
123123` Component.translatable ` keys against ` en.properties ` , including the ` $entityType ` -templated keys used by the generic
0 commit comments