Skip to content

Instantly share code, notes, and snippets.

@AOrobator
AOrobator / CI_SPEC_EXAMPLE.md
Created January 11, 2026 17:18
CI Job Documentation - Example from Vibe Engineering Starter Kit

CI Spec Example: Job Documentation

This example shows how to document CI jobs so that failures are self-explanatory. Each job links back to why it exists and how to fix common failures.


Prisma Validation

Why this exists: Per post-mortem 2025-12-25_migration-ordering-failure.md: Two migrations were out of order. Prisma replays migrations into a shadow

@AOrobator
AOrobator / SYSTEM_SPEC_EXAMPLE.md
Created January 11, 2026 17:18
API Contract - System Spec Example from Vibe Engineering Starter Kit

System Spec Example: API Contract

This example shows how to document an API contract before implementation. Define the request shape, success response, and every error code upfront. The AI gets everything it needs in one place.


API Contract: POST /invoices

Request

@AOrobator
AOrobator / PRODUCT_SPEC_EXAMPLE.md
Created January 11, 2026 17:18
User Registration Flow - Spec Example from Vibe Engineering Starter Kit

Product Spec Example: User Registration Flow

This example shows how to document a user flow in your PRODUCT_SPEC.md. Notice how it covers happy paths, sad paths, and constraints—giving the AI everything it needs to implement without guessing.


User Registration Flow

Happy Path

  1. User enters email on /login

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@AOrobator
AOrobator / OkHttp.kt
Created July 21, 2018 17:21
OkHttpExtensions
import okhttp3.mockwebserver.MockWebServer
import okhttp3.mockwebserver.RecordedRequest
import org.amshove.kluent.`should equal`
/**
* OkHttp3 extensions for syntactic sugar while testing
*/
enum class HttpMethod {
DELETE,
GET,
fun realmTransactionSync(transaction: (Realm) -> Unit) {
val realm = Realm.getDefaultInstance()
var canceled = false
realm.beginTransaction()
try {
transaction(realm)
} catch (e: Exception) {
e.printStackTrace()
realm.cancelTransaction()
override fun scanSongIntoLibrary(filePath: String): SongId {
var newSongId: SongId = InvalidSongId
realmTransaction {
if (getSongForFilepath(it, filePath) == null) {
val song = Song {
id = Database.getNextId(it, Song::class.java)
newSongId = // get next ValidSongId
// Initialize title, artist, and album for the song
}
it.copyToRealm(song)
@AOrobator
AOrobator / RealmAction.kt
Created April 7, 2018 19:32
RealmTransaction
fun realmTransaction(onError: (Throwable) -> Unit = {}, transaction: (Realm) -> Unit) {
val realm = Realm.getDefaultInstance()
try {
realm.executeTransactionAsync { transaction(it) }
} catch (e: Exception) {
onError(e)
}
realm.close()
class RealmSongRepository : SongRepository {
override fun addSongToLibrary(filePath: String): Single<SongId> {
return Single.fromCallable {
scanSongIntoLibrary(filePath)
}
.subscribeOn(io())
.observeOn(mainThread())
}
override fun scanSongIntoLibrary(filePath: String): SongId {
@AOrobator
AOrobator / FolderBrowsingPresenterTest.kt
Created April 7, 2018 17:00
Tests don't cover all bugs
@Test
fun `When unscanned song clicked, song is scanned into library`() {
val presenter = FolderBrowsingPresenter(queue, MockSongRepository())
val target: FolderBrowsingPresenter.Target = mock()
presenter.attach(target)
presenter.onUnscannedSongClicked(
DirectoryItemSong(
name = "01 Get You.m4a",
lastModifiedTime = 1234L,