SBK Driver Development Skill
Helps AI agents add new storage drivers or modify existing drivers in the SBK repository.
When to use this skill
Invoke this skill when:
- Adding a new storage driver to SBK
- Modifying an existing driver (adding CLI flags, fixing bugs, changing behavior)
- A driver change requires updating build configuration
What this skill provides
Context
- SBK driver SPI contract and implementation patterns
- File structure conventions for drivers
- Build system integration (settings-drivers.gradle, build-drivers.gradle)
- Checkstyle and import-control requirements
- Common gotchas specific to SBK drivers
Guidance
- Step-by-step workflow for adding a new driver from the sbktemplate scaffold
- Pattern for adding CLI flags (addArgs → Config class → properties file)
- Verification checklist specific to driver changes
- Error handling patterns for driver shutdown
Permissions granted
- Read access to:
drivers/, settings-drivers.gradle, build-drivers.gradle, checkstyle/import-control.xml
- Write access to:
drivers/<name>/, settings-drivers.gradle, build-drivers.gradle, checkstyle/import-control.xml
- Exec permissions:
./gradlew (for :drivers::check, installDist)
Workflow
Adding a new driver
- Copy scaffold:
cp -r drivers/sbktemplate drivers/<newname>
- Rename packages and classes: Replace
SbkTemplate with PascalCaseName throughout
- Edit build.gradle: Add vendor SDK dependency
- Register in build system:
- Add
include 'drivers:<name>' to settings-drivers.gradle
- Add
api project(':drivers:<name>') to build-drivers.gradle
- Update checkstyle: If SDK brings new top-level packages, add to
checkstyle/import-control.xml
- Implement the four classes:
<Name>.java, <Name>Writer.java, <Name>Reader.java, <Name>Config.java
- Add README.md: Document driver with at least one write and one read example
- Verify: Run
./gradlew :drivers:<name>:check, ./gradlew check, ./gradlew installDist, smoke test
Modifying an existing driver
- Add flag in addArgs():
params.addOption("flag", true, "description")
- Add field to Config class: Match the property name
- Add default to properties file: In
drivers/<name>/src/main/resources/<name>.properties
- Parse in parseArgs(): Read the flag value into config
- Use the flag: Act on it in
openStorage(), createWriter(), or createReader()
- Update README.md: Document the new flag with an example
- Verify: Run
./gradlew :drivers:<name>:check and test the new flag
Common gotchas
Dual Gradle file requirement
New drivers MUST be added to BOTH:
settings-drivers.gradle (include statement)
build-drivers.gradle (api dependency)
Forgetting either causes "driver not found" errors.
Checkstyle import control
If the vendor SDK introduces a new top-level package (e.g., software.amazon, okhttp3), you MUST add it to checkstyle/import-control.xml:
<allow pkg="package.name" />
Package naming convention
Driver directory: lowercase (minio)
Java package: PascalCase (io.sbk.driver.MinIO)
Class name: PascalCase, matches directory case (MinIO)
Shutdown handling
Drivers MUST treat InterruptedIOException and RejectedExecutionException as clean shutdowns, not errors. SBK tears down HTTP clients mid-call when the benchmark duration expires.
No synchronization in hot path
Do NOT add synchronized blocks or Lock usage in writeAsync() or read() methods. The harness depends on lock-free behavior.
Verification checklist
Before considering a driver change complete:
Related documentation
- - Repository conventions and gotchas
- - Recipe 1: Add a new storage driver
- - Spec template for drivers
- - Starting scaffold
Source: kmgowda/SBK — distributed by TomeVault.
1---2name: kmgowda-sbk-sbk3description: SBK Driver Development Skill4---5# SBK Driver Development Skill67> Helps AI agents add new storage drivers or modify existing drivers in the SBK repository.89## When to use this skill1011Invoke this skill when:12- Adding a new storage driver to SBK13- Modifying an existing driver (adding CLI flags, fixing bugs, changing behavior)14- A driver change requires updating build configuration1516## What this skill provides1718### Context19- SBK driver SPI contract and implementation patterns20- File structure conventions for drivers21- Build system integration (settings-drivers.gradle, build-drivers.gradle)22- Checkstyle and import-control requirements23- Common gotchas specific to SBK drivers2425### Guidance26- Step-by-step workflow for adding a new driver from the sbktemplate scaffold27- Pattern for adding CLI flags (addArgs → Config class → properties file)28- Verification checklist specific to driver changes29- Error handling patterns for driver shutdown3031### Permissions granted32- Read access to: `drivers/`, `settings-drivers.gradle`, `build-drivers.gradle`, `checkstyle/import-control.xml`33- Write access to: `drivers/<name>/`, `settings-drivers.gradle`, `build-drivers.gradle`, `checkstyle/import-control.xml`34- Exec permissions: `./gradlew` (for :drivers:<name>:check, installDist)3536## Workflow3738### Adding a new driver39401. **Copy scaffold**: `cp -r drivers/sbktemplate drivers/<newname>`412. **Rename packages and classes**: Replace `SbkTemplate` with `PascalCaseName` throughout423. **Edit build.gradle**: Add vendor SDK dependency434. **Register in build system**:44 - Add `include 'drivers:<name>'` to `settings-drivers.gradle`45 - Add `api project(':drivers:<name>')` to `build-drivers.gradle`465. **Update checkstyle**: If SDK brings new top-level packages, add to `checkstyle/import-control.xml`476. **Implement the four classes**: `<Name>.java`, `<Name>Writer.java`, `<Name>Reader.java`, `<Name>Config.java`487. **Add README.md**: Document driver with at least one write and one read example498. **Verify**: Run `./gradlew :drivers:<name>:check`, `./gradlew check`, `./gradlew installDist`, smoke test5051### Modifying an existing driver52531. **Add flag in addArgs()**: `params.addOption("flag", true, "description")`542. **Add field to Config class**: Match the property name553. **Add default to properties file**: In `drivers/<name>/src/main/resources/<name>.properties`564. **Parse in parseArgs()**: Read the flag value into config575. **Use the flag**: Act on it in `openStorage()`, `createWriter()`, or `createReader()`586. **Update README.md**: Document the new flag with an example597. **Verify**: Run `./gradlew :drivers:<name>:check` and test the new flag6061## Common gotchas6263### Dual Gradle file requirement64New drivers MUST be added to BOTH:65- `settings-drivers.gradle` (include statement)66- `build-drivers.gradle` (api dependency)6768Forgetting either causes "driver not found" errors.6970### Checkstyle import control71If the vendor SDK introduces a new top-level package (e.g., `software.amazon`, `okhttp3`), you MUST add it to `checkstyle/import-control.xml`:72```xml73<allow pkg="package.name" />74```7576### Package naming convention77Driver directory: lowercase (`minio`)78Java package: PascalCase (`io.sbk.driver.MinIO`)79Class name: PascalCase, matches directory case (`MinIO`)8081### Shutdown handling82Drivers MUST treat `InterruptedIOException` and `RejectedExecutionException` as clean shutdowns, not errors. SBK tears down HTTP clients mid-call when the benchmark duration expires.8384### No synchronization in hot path85Do NOT add `synchronized` blocks or `Lock` usage in `writeAsync()` or `read()` methods. The harness depends on lock-free behavior.8687## Verification checklist8889Before considering a driver change complete:90- [ ] `./gradlew :drivers:<name>:check` passes91- [ ] `./gradlew check` passes (no regression elsewhere)92- [ ] `./gradlew installDist` produces working distribution93- [ ] `sbk -class <name> -help` lists the driver (and new flags if any)94- [ ] Smoke test against real backend runs for 30+ seconds without errors95- [ ] Driver README.md exists with at least one write and one read example96- [ ] If new packages introduced, `checkstyle/import-control.xml` is updated97- [ ] Both `settings-drivers.gradle` and `build-drivers.gradle` include the driver98- [ ] No `synchronized` blocks or `Lock` usage in per-record hot path99100## Related documentation101102- <ref_file file="/root/projects/SBK/AGENTS.md" /> - Repository conventions and gotchas103- <ref_file file="/root/projects/SBK/docs/AGENT_RECIPES.md" /> - Recipe 1: Add a new storage driver104- <ref_file file="/root/projects/SBK/docs/DRIVER_SPECIFICATION.md" /> - Spec template for drivers105- <ref_file file="/root/projects/SBK/drivers/sbktemplate/" /> - Starting scaffold106107---108> Source: [kmgowda/SBK](https://github.com/kmgowda/SBK) — distributed by [TomeVault](https://tomevault.io).109<!-- tomevault:4.0:skill_md:2026-06-29 -->