[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77R75J8K7675B4AF5CRC1C3":3,"skill-same:01M77R75J8K7675B4AF5CRC1C3":84},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":28,"commitSha":29,"skillDirectory":30,"forksCount":31,"repositoryHtmlUrl":32,"repositoryHomepageUrl":33,"ownerHtmlUrl":34,"ownerBlogUrl":35,"ownerDescription":36,"updatedAt":37,"install":38,"resources":51},"01M77R75J8K7675B4AF5CRC1C3","litestream",null,"Expert knowledge for contributing to Litestream, a standalone disaster recovery tool for SQLite. Provides architectural understanding, code patterns, critical rules, and debugging procedures for WAL monitoring, LTX replication format, storage backend implementation, multi-level compaction, and SQLite page management. Use when working with Litestream source code, writing storage backends, debugging replication issues, implementing compaction logic, or handling SQLite WAL operations.","imjasonh\u002Fplayground","imjasonh","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F210737?v=4","01M77R04048MZ4VPYAHJ5DFJME","Jason Hall","01M77R04189XHX6A07D7FGV0Z4",3,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fimjasonh\u002Fplayground\u002Fblob\u002Fmain\u002Flitestream\u002Fskills\u002Flitestream\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: litestream\ndescription: >-\n  Expert knowledge for contributing to Litestream, a standalone disaster recovery\n  tool for SQLite. Provides architectural understanding, code patterns, critical\n  rules, and debugging procedures for WAL monitoring, LTX replication format,\n  storage backend implementation, multi-level compaction, and SQLite page\n  management. Use when working with Litestream source code, writing storage\n  backends, debugging replication issues, implementing compaction logic, or\n  handling SQLite WAL operations.\nlicense: Apache-2.0\nmetadata:\n  author: benbjohnson\n  version: \"1.0\"\n  repository: https:\u002F\u002Fgithub.com\u002Fbenbjohnson\u002Flitestream\n---\n\n# Litestream Agent Skill\n\nLitestream is a standalone disaster recovery tool for SQLite. It runs as a\nbackground process, monitors the SQLite WAL (Write-Ahead Log), converts changes\nto immutable LTX files, and replicates them to cloud storage. It uses\n`modernc.org\u002Fsqlite` (pure Go, no CGO required).\n\n## Quick Start\n\n```bash\n# Build\ngo build -o bin\u002Flitestream .\u002Fcmd\u002Flitestream\n\n# Test (always use race detector)\ngo test -race -v .\u002F...\n\n# Code quality\npre-commit run --all-files\n```\n\n## Critical Rules\n\nThese invariants must never be violated:\n\n### 1. Lock Page at 1GB\n\nSQLite reserves a page at byte offset 0x40000000 (1 GB). Always skip it during\nreplication and compaction. The page number varies by page size:\n\n| Page Size | Lock Page Number |\n|-----------|------------------|\n| 4 KB      | 262145           |\n| 8 KB      | 131073           |\n| 16 KB     | 65537            |\n| 32 KB     | 32769            |\n\n```go\nlockPgno := ltx.LockPgno(pageSize)\nif pgno == lockPgno {\n    continue\n}\n```\n\n### 2. LTX Files Are Immutable\n\nOnce an LTX file is written, it must never be modified. New changes create new\nfiles. This guarantees point-in-time recovery integrity.\n\n### 3. Single Replica per Database\n\nEach database replicates to exactly one destination. The Replica component\nmanages replication mechanics; database state belongs in the DB layer.\n\n### 4. Read Local Before Remote During Compaction\n\nCloud storage is eventually consistent. Always read from local disk first:\n\n```go\nf, err := os.Open(db.LTXPath(info.Level, info.MinTXID, info.MaxTXID))\nif err == nil {\n    return f, nil \u002F\u002F Use local copy\n}\nreturn replica.Client.OpenLTXFile(...) \u002F\u002F Fall back to remote\n```\n\n### 5. Preserve Timestamps During Compaction\n\nSet the compacted file's `CreatedAt` to the earliest source file timestamp to\nmaintain temporal granularity for point-in-time restoration.\n\n```go\ninfo.CreatedAt = oldestSourceFile.CreatedAt\n```\n\n### 6. Use Lock() Not RLock() for Writes\n\n```go\n\u002F\u002F CORRECT\nr.mu.Lock()\ndefer r.mu.Unlock()\nr.pos = pos\n\n\u002F\u002F WRONG - race condition\nr.mu.RLock()\ndefer r.mu.RUnlock()\nr.pos = pos\n```\n\n### 7. Atomic File Operations\n\nAlways write to a temp file then rename. Never write directly to the final path.\n\n```go\ntmpFile, err := os.CreateTemp(dir, \".tmp-*\")\n\u002F\u002F ... write data, sync ...\nos.Rename(tmpFile.Name(), finalPath)\n```\n\n## Architecture\n\n### System Layers\n\n| Layer   | File(s)                  | Responsibility                            |\n|---------|--------------------------|-------------------------------------------|\n| App     | `cmd\u002Flitestream\u002F`        | CLI commands, YAML\u002Fenv config             |\n| Store   | `store.go`               | Multi-DB coordination, compaction         |\n| DB      | `db.go`                  | Single DB management, WAL monitoring      |\n| Replica | `replica.go`             | Replication to one destination            |\n| Storage | `*\u002Freplica_client.go`    | Backend implementations (S3, GCS, etc.)   |\n\nDatabase state logic belongs in the DB layer, not the Replica layer.\n\n### ReplicaClient Interface\n\nAll storage backends implement this interface from `replica_client.go`:\n\n```go\ntype ReplicaClient interface {\n    Type() string\n    Init(ctx context.Context) error\n    LTXFiles(ctx context.Context, level int, seek ltx.TXID, useMetadata bool) (ltx.FileIterator, error)\n    OpenLTXFile(ctx context.Context, level int, minTXID, maxTXID ltx.TXID, offset, size int64) (io.ReadCloser, error)\n    WriteLTXFile(ctx context.Context, level int, minTXID, maxTXID ltx.TXID, r io.Reader) (*ltx.FileInfo, error)\n    DeleteLTXFiles(ctx context.Context, a []*ltx.FileInfo) error\n    DeleteAll(ctx context.Context) error\n}\n```\n\nKey contract details:\n- `OpenLTXFile` must return `os.ErrNotExist` when file is missing\n- `WriteLTXFile` must set `CreatedAt` from backend metadata or upload time\n- `LTXFiles` with `useMetadata=true` fetches accurate timestamps (for PIT restore)\n- `LTXFiles` with `useMetadata=false` uses fast timestamps (normal operations)\n\n### Lock Ordering\n\nAlways acquire locks in this order to prevent deadlocks:\n\n1. `Store.mu`\n2. `DB.mu`\n3. `DB.chkMu`\n4. `Replica.mu`\n\n### Core Components\n\n**DB** (`db.go`): Manages SQLite connection, WAL monitoring, checkpointing, and\nlong-running read transaction for consistency. Key fields: `path`, `db`, `rtx`\n(read transaction), `pageSize`, `notify` channel.\n\n**Replica** (`replica.go`): Tracks replication position (`ltx.Pos` with TXID,\nPageNo, Checksum). One replica per database.\n\n**Store** (`store.go`): Coordinates multiple databases and schedules compaction\nacross levels.\n\n## LTX File Format\n\nLTX (Log Transaction) files are immutable, checksummed archives of database\nchanges. Structure:\n\n```\n+------------------+\n|     Header       |  100 bytes (magic \"LTX1\", page size, TXID range, timestamp)\n+------------------+\n|   Page Frames    |  4-byte pgno + pageSize bytes data, per page\n+------------------+\n|   Page Index     |  Binary search index for page lookup\n+------------------+\n|     Trailer      |  16 bytes (post-apply checksum, file checksum)\n+------------------+\n```\n\n### Naming Convention\n\n```\nFormat:  MMMMMMMMMMMMMMMM-NNNNNNNNNNNNNNNN.ltx\nExample: 0000000000000001-0000000000000064.ltx  (TXID 1-100)\n```\n\n### Compaction Levels\n\n```\nLevel 0: \u002Fltx\u002F0000\u002F  Raw LTX files (no compaction)\nLevel 1: \u002Fltx\u002F0001\u002F  Compacted periodically\nLevel 2: \u002Fltx\u002F0002\u002F  Compacted less frequently\n```\n\nDefault compaction levels: L0 (raw), L1 (30s), L2 (5min), L3 (1h), plus daily\nsnapshots. Compaction merges files by deduplicating pages (latest version wins)\nand always skips the lock page.\n\n## Code Patterns\n\n### DO\n\n- Return errors immediately; let callers decide handling\n- Use `fmt.Errorf(\"context: %w\", err)` for error wrapping\n- Handle database state in the DB layer, not Replica\n- Use `db.verify()` to trigger snapshots (don't reimplement)\n- Test with race detector: `go test -race`\n- Use lazy iterators for `LTXFiles` (paginate, don't load all at once)\n\n### DON'T\n\n- Write data at the 1 GB lock page boundary\n- Modify LTX files after creation\n- Put database state logic in the Replica layer\n- Use `RLock()` when writing shared state\n- Write directly to final file paths (use temp + rename)\n- Ignore context cancellation in long operations\n- Return generic errors instead of `os.ErrNotExist` for missing files\n\n## Specialized Knowledge Areas\n\nLoad reference files on demand based on the task:\n\n| Task                              | Reference File                          |\n|-----------------------------------|-----------------------------------------|\n| Understanding system design       | `references\u002FARCHITECTURE.md`            |\n| Writing or reviewing code         | `references\u002FPATTERNS.md`                |\n| Working with LTX files            | `references\u002FLTX_FORMAT.md`              |\n| WAL monitoring or page operations | `references\u002FSQLITE_INTERNALS.md`        |\n| Implementing storage backends     | `references\u002FREPLICA_CLIENT_GUIDE.md`    |\n| Writing or debugging tests        | `references\u002FTESTING_GUIDE.md`           |\n\n## Common Debugging Procedures\n\n### Replication Not Working\n\n1. Verify WAL mode: `PRAGMA journal_mode` must return `wal`\n2. Check monitor interval and that the monitor goroutine is running\n3. Confirm `db.notify` channel is being signaled on WAL changes\n4. Check replica position: `replica.Pos()` should advance with writes\n5. Look for `os.ErrNotExist` from `OpenLTXFile` (file not replicated yet)\n\n### Large Database Issues (>1 GB)\n\n1. Verify lock page is being skipped: check `ltx.LockPgno(pageSize)`\n2. Test with multiple page sizes (4K, 8K, 16K, 32K)\n3. Run with databases both smaller and larger than 1 GB\n4. Ensure page iteration loops include the `continue` guard for lock page\n\n### Compaction Problems\n\n1. Confirm local L0 files exist before compaction reads them\n2. Check that `CreatedAt` timestamps are preserved (earliest source)\n3. Verify compaction level intervals in `Store.levels`\n4. Look for eventual consistency issues if reading from remote storage\n\n### Storage Backend Issues\n\n1. Return `os.ErrNotExist` for missing files (not generic errors)\n2. Support partial reads via `offset`\u002F`size` in `OpenLTXFile`\n3. Handle context cancellation in all methods\n4. Test concurrent operations with `-race` flag\n5. For eventually consistent backends, add retry logic with backoff\n\n### Corrupted or Missing LTX Files\n\n1. Check logs for `LTXError` messages - they include context (Op, Path, Level, TXID) and recovery hints\n2. Common error messages: \"nonsequential page numbers\", \"non-contiguous transaction files\", \"ltx validation failed\"\n3. Manual fix: `litestream reset \u003Cdb-path>` clears local LTX state and forces fresh snapshot on next sync (database file is not modified)\n4. Automatic fix: set `auto-recover: true` on the replica config to auto-reset on LTX errors (disabled by default)\n5. Reference: `cmd\u002Flitestream\u002Freset.go`, `replica.go` (auto-recover logic), `db.go` (`ResetLocalState`)\n\n## Contribution Guidelines\n\n### What's Accepted\n\n- Bug fixes and patches (welcome)\n- Documentation improvements\n- Small code improvements and performance optimizations\n- Security vulnerability reports (report privately)\n\n### Discuss First\n\n- Feature requests: open an issue before implementing\n- Large changes: discuss approach in an issue first\n\n### Pre-Submit Checklist\n\n- [ ] Read relevant docs from the reference table above\n- [ ] Follow patterns in `references\u002FPATTERNS.md`\n- [ ] Run `go test -race -v .\u002F...`\n- [ ] Run `pre-commit run --all-files`\n- [ ] For page iteration: test with >1 GB databases\n- [ ] Show investigation evidence in PR (see CONTRIBUTING.md)\n\n## Testing\n\n```bash\n# Full test suite with race detection\ngo test -race -v .\u002F...\n\n# Specific areas\ngo test -race -v -run TestReplica_Sync .\u002F...\ngo test -race -v -run TestDB_Sync .\u002F...\ngo test -race -v -run TestStore_CompactDB .\u002F...\n\n# Coverage\ngo test -coverprofile=coverage.out .\u002F...\ngo tool cover -html=coverage.out\n```\n\nKey testing areas:\n- Lock page handling with >1 GB databases and multiple page sizes\n- Race conditions in position updates, WAL monitoring, and checkpointing\n- Eventual consistency in storage backend operations\n- Atomic file operations and cleanup on error paths\n\n## Environment Validation\n\nRun `scripts\u002Fvalidate-setup.sh` to verify your development environment is\ncorrectly configured for Litestream development.\n","# Litestream Agent Skill\n\nLitestream is a standalone disaster recovery tool for SQLite. It runs as a\nbackground process, monitors the SQLite WAL (Write-Ahead Log), converts changes\nto immutable LTX files, and replicates them to cloud storage. It uses\n`modernc.org\u002Fsqlite` (pure Go, no CGO required).\n\n## Quick Start\n\n```bash\n# Build\ngo build -o bin\u002Flitestream .\u002Fcmd\u002Flitestream\n\n# Test (always use race detector)\ngo test -race -v .\u002F...\n\n# Code quality\npre-commit run --all-files\n```\n\n## Critical Rules\n\nThese invariants must never be violated:\n\n### 1. Lock Page at 1GB\n\nSQLite reserves a page at byte offset 0x40000000 (1 GB). Always skip it during\nreplication and compaction. The page number varies by page size:\n\n| Page Size | Lock Page Number |\n|-----------|------------------|\n| 4 KB      | 262145           |\n| 8 KB      | 131073           |\n| 16 KB     | 65537            |\n| 32 KB     | 32769            |\n\n```go\nlockPgno := ltx.LockPgno(pageSize)\nif pgno == lockPgno {\n    continue\n}\n```\n\n### 2. LTX Files Are Immutable\n\nOnce an LTX file is written, it must never be modified. New changes create new\nfiles. This guarantees point-in-time recovery integrity.\n\n### 3. Single Replica per Database\n\nEach database replicates to exactly one destination. The Replica component\nmanages replication mechanics; database state belongs in the DB layer.\n\n### 4. Read Local Before Remote During Compaction\n\nCloud storage is eventually consistent. Always read from local disk first:\n\n```go\nf, err := os.Open(db.LTXPath(info.Level, info.MinTXID, info.MaxTXID))\nif err == nil {\n    return f, nil \u002F\u002F Use local copy\n}\nreturn replica.Client.OpenLTXFile(...) \u002F\u002F Fall back to remote\n```\n\n### 5. Preserve Timestamps During Compaction\n\nSet the compacted file's `CreatedAt` to the earliest source file timestamp to\nmaintain temporal granularity for point-in-time restoration.\n\n```go\ninfo.CreatedAt = oldestSourceFile.CreatedAt\n```\n\n### 6. Use Lock() Not RLock() for Writes\n\n```go\n\u002F\u002F CORRECT\nr.mu.Lock()\ndefer r.mu.Unlock()\nr.pos = pos\n\n\u002F\u002F WRONG - race condition\nr.mu.RLock()\ndefer r.mu.RUnlock()\nr.pos = pos\n```\n\n### 7. Atomic File Operations\n\nAlways write to a temp file then rename. Never write directly to the final path.\n\n```go\ntmpFile, err := os.CreateTemp(dir, \".tmp-*\")\n\u002F\u002F ... write data, sync ...\nos.Rename(tmpFile.Name(), finalPath)\n```\n\n## Architecture\n\n### System Layers\n\n| Layer   | File(s)                  | Responsibility                            |\n|---------|--------------------------|-------------------------------------------|\n| App     | `cmd\u002Flitestream\u002F`        | CLI commands, YAML\u002Fenv config             |\n| Store   | `store.go`               | Multi-DB coordination, compaction         |\n| DB      | `db.go`                  | Single DB management, WAL monitoring      |\n| Replica | `replica.go`             | Replication to one destination            |\n| Storage | `*\u002Freplica_client.go`    | Backend implementations (S3, GCS, etc.)   |\n\nDatabase state logic belongs in the DB layer, not the Replica layer.\n\n### ReplicaClient Interface\n\nAll storage backends implement this interface from `replica_client.go`:\n\n```go\ntype ReplicaClient interface {\n    Type() string\n    Init(ctx context.Context) error\n    LTXFiles(ctx context.Context, level int, seek ltx.TXID, useMetadata bool) (ltx.FileIterator, error)\n    OpenLTXFile(ctx context.Context, level int, minTXID, maxTXID ltx.TXID, offset, size int64) (io.ReadCloser, error)\n    WriteLTXFile(ctx context.Context, level int, minTXID, maxTXID ltx.TXID, r io.Reader) (*ltx.FileInfo, error)\n    DeleteLTXFiles(ctx context.Context, a []*ltx.FileInfo) error\n    DeleteAll(ctx context.Context) error\n}\n```\n\nKey contract details:\n- `OpenLTXFile` must return `os.ErrNotExist` when file is missing\n- `WriteLTXFile` must set `CreatedAt` from backend metadata or upload time\n- `LTXFiles` with `useMetadata=true` fetches accurate timestamps (for PIT restore)\n- `LTXFiles` with `useMetadata=false` uses fast timestamps (normal operations)\n\n### Lock Ordering\n\nAlways acquire locks in this order to prevent deadlocks:\n\n1. `Store.mu`\n2. `DB.mu`\n3. `DB.chkMu`\n4. `Replica.mu`\n\n### Core Components\n\n**DB** (`db.go`): Manages SQLite connection, WAL monitoring, checkpointing, and\nlong-running read transaction for consistency. Key fields: `path`, `db`, `rtx`\n(read transaction), `pageSize`, `notify` channel.\n\n**Replica** (`replica.go`): Tracks replication position (`ltx.Pos` with TXID,\nPageNo, Checksum). One replica per database.\n\n**Store** (`store.go`): Coordinates multiple databases and schedules compaction\nacross levels.\n\n## LTX File Format\n\nLTX (Log Transaction) files are immutable, checksummed archives of database\nchanges. Structure:\n\n```\n+------------------+\n|     Header       |  100 bytes (magic \"LTX1\", page size, TXID range, timestamp)\n+------------------+\n|   Page Frames    |  4-byte pgno + pageSize bytes data, per page\n+------------------+\n|   Page Index     |  Binary search index for page lookup\n+------------------+\n|     Trailer      |  16 bytes (post-apply checksum, file checksum)\n+------------------+\n```\n\n### Naming Convention\n\n```\nFormat:  MMMMMMMMMMMMMMMM-NNNNNNNNNNNNNNNN.ltx\nExample: 0000000000000001-0000000000000064.ltx  (TXID 1-100)\n```\n\n### Compaction Levels\n\n```\nLevel 0: \u002Fltx\u002F0000\u002F  Raw LTX files (no compaction)\nLevel 1: \u002Fltx\u002F0001\u002F  Compacted periodically\nLevel 2: \u002Fltx\u002F0002\u002F  Compacted less frequently\n```\n\nDefault compaction levels: L0 (raw), L1 (30s), L2 (5min), L3 (1h), plus daily\nsnapshots. Compaction merges files by deduplicating pages (latest version wins)\nand always skips the lock page.\n\n## Code Patterns\n\n### DO\n\n- Return errors immediately; let callers decide handling\n- Use `fmt.Errorf(\"context: %w\", err)` for error wrapping\n- Handle database state in the DB layer, not Replica\n- Use `db.verify()` to trigger snapshots (don't reimplement)\n- Test with race detector: `go test -race`\n- Use lazy iterators for `LTXFiles` (paginate, don't load all at once)\n\n### DON'T\n\n- Write data at the 1 GB lock page boundary\n- Modify LTX files after creation\n- Put database state logic in the Replica layer\n- Use `RLock()` when writing shared state\n- Write directly to final file paths (use temp + rename)\n- Ignore context cancellation in long operations\n- Return generic errors instead of `os.ErrNotExist` for missing files\n\n## Specialized Knowledge Areas\n\nLoad reference files on demand based on the task:\n\n| Task                              | Reference File                          |\n|-----------------------------------|-----------------------------------------|\n| Understanding system design       | `references\u002FARCHITECTURE.md`            |\n| Writing or reviewing code         | `references\u002FPATTERNS.md`                |\n| Working with LTX files            | `references\u002FLTX_FORMAT.md`              |\n| WAL monitoring or page operations | `references\u002FSQLITE_INTERNALS.md`        |\n| Implementing storage backends     | `references\u002FREPLICA_CLIENT_GUIDE.md`    |\n| Writing or debugging tests        | `references\u002FTESTING_GUIDE.md`           |\n\n## Common Debugging Procedures\n\n### Replication Not Working\n\n1. Verify WAL mode: `PRAGMA journal_mode` must return `wal`\n2. Check monitor interval and that the monitor goroutine is running\n3. Confirm `db.notify` channel is being signaled on WAL changes\n4. Check replica position: `replica.Pos()` should advance with writes\n5. Look for `os.ErrNotExist` from `OpenLTXFile` (file not replicated yet)\n\n### Large Database Issues (>1 GB)\n\n1. Verify lock page is being skipped: check `ltx.LockPgno(pageSize)`\n2. Test with multiple page sizes (4K, 8K, 16K, 32K)\n3. Run with databases both smaller and larger than 1 GB\n4. Ensure page iteration loops include the `continue` guard for lock page\n\n### Compaction Problems\n\n1. Confirm local L0 files exist before compaction reads them\n2. Check that `CreatedAt` timestamps are preserved (earliest source)\n3. Verify compaction level intervals in `Store.levels`\n4. Look for eventual consistency issues if reading from remote storage\n\n### Storage Backend Issues\n\n1. Return `os.ErrNotExist` for missing files (not generic errors)\n2. Support partial reads via `offset`\u002F`size` in `OpenLTXFile`\n3. Handle context cancellation in all methods\n4. Test concurrent operations with `-race` flag\n5. For eventually consistent backends, add retry logic with backoff\n\n### Corrupted or Missing LTX Files\n\n1. Check logs for `LTXError` messages - they include context (Op, Path, Level, TXID) and recovery hints\n2. Common error messages: \"nonsequential page numbers\", \"non-contiguous transaction files\", \"ltx validation failed\"\n3. Manual fix: `litestream reset \u003Cdb-path>` clears local LTX state and forces fresh snapshot on next sync (database file is not modified)\n4. Automatic fix: set `auto-recover: true` on the replica config to auto-reset on LTX errors (disabled by default)\n5. Reference: `cmd\u002Flitestream\u002Freset.go`, `replica.go` (auto-recover logic), `db.go` (`ResetLocalState`)\n\n## Contribution Guidelines\n\n### What's Accepted\n\n- Bug fixes and patches (welcome)\n- Documentation improvements\n- Small code improvements and performance optimizations\n- Security vulnerability reports (report privately)\n\n### Discuss First\n\n- Feature requests: open an issue before implementing\n- Large changes: discuss approach in an issue first\n\n### Pre-Submit Checklist\n\n- [ ] Read relevant docs from the reference table above\n- [ ] Follow patterns in `references\u002FPATTERNS.md`\n- [ ] Run `go test -race -v .\u002F...`\n- [ ] Run `pre-commit run --all-files`\n- [ ] For page iteration: test with >1 GB databases\n- [ ] Show investigation evidence in PR (see CONTRIBUTING.md)\n\n## Testing\n\n```bash\n# Full test suite with race detection\ngo test -race -v .\u002F...\n\n# Specific areas\ngo test -race -v -run TestReplica_Sync .\u002F...\ngo test -race -v -run TestDB_Sync .\u002F...\ngo test -race -v -run TestStore_CompactDB .\u002F...\n\n# Coverage\ngo test -coverprofile=coverage.out .\u002F...\ngo tool cover -html=coverage.out\n```\n\nKey testing areas:\n- Lock page handling with >1 GB databases and multiple page sizes\n- Race conditions in position updates, WAL monitoring, and checkpointing\n- Eventual consistency in storage backend operations\n- Atomic file operations and cleanup on error paths\n\n## Environment Validation\n\nRun `scripts\u002Fvalidate-setup.sh` to verify your development environment is\ncorrectly configured for Litestream development.\n",{"name":5,"license":15,"metadata":24,"description":7},{"author":25,"version":26,"repository":27},"benbjohnson","1.0","https:\u002F\u002Fgithub.com\u002Fbenbjohnson\u002Flitestream","main","9c4f92e42a0c2c51c3c092a456ec4945f6278eeb","litestream\u002Fskills\u002Flitestream",0,"https:\u002F\u002Fgithub.com\u002Fimjasonh\u002Fplayground","https:\u002F\u002Fimjasonh.github.io\u002Fplayground\u002F","https:\u002F\u002Fgithub.com\u002Fimjasonh","https:\u002F\u002Fimjasonh.com","Doin stuff","2026-11-15 03:03:19",{"source":8,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add imjasonh\u002Fplayground --skill litestream",{"tool":44,"command":45},"bunx","bunx skills add imjasonh\u002Fplayground --skill litestream",{"tool":47,"command":48},"pnpm","pnpm dlx skills add imjasonh\u002Fplayground --skill litestream","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fimjasonh\u002Fplayground\u002Fblob\u002Fmain\u002Flitestream\u002Fskills\u002Flitestream\u002FSKILL.md",true,[52,58,62,66,70,74,78],{"path":53,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":56,"sourceHtmlUrl":57},"references\u002FARCHITECTURE.md","REFERENCE","参考文档",5559,"https:\u002F\u002Fgithub.com\u002Fimjasonh\u002Fplayground\u002Fblob\u002Fmain\u002Flitestream\u002Fskills\u002Flitestream\u002Freferences\u002FARCHITECTURE.md",{"path":59,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":60,"sourceHtmlUrl":61},"references\u002FLTX_FORMAT.md",4730,"https:\u002F\u002Fgithub.com\u002Fimjasonh\u002Fplayground\u002Fblob\u002Fmain\u002Flitestream\u002Fskills\u002Flitestream\u002Freferences\u002FLTX_FORMAT.md",{"path":63,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":64,"sourceHtmlUrl":65},"references\u002FPATTERNS.md",4556,"https:\u002F\u002Fgithub.com\u002Fimjasonh\u002Fplayground\u002Fblob\u002Fmain\u002Flitestream\u002Fskills\u002Flitestream\u002Freferences\u002FPATTERNS.md",{"path":67,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":68,"sourceHtmlUrl":69},"references\u002FREPLICA_CLIENT_GUIDE.md",5555,"https:\u002F\u002Fgithub.com\u002Fimjasonh\u002Fplayground\u002Fblob\u002Fmain\u002Flitestream\u002Fskills\u002Flitestream\u002Freferences\u002FREPLICA_CLIENT_GUIDE.md",{"path":71,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":72,"sourceHtmlUrl":73},"references\u002FSQLITE_INTERNALS.md",5151,"https:\u002F\u002Fgithub.com\u002Fimjasonh\u002Fplayground\u002Fblob\u002Fmain\u002Flitestream\u002Fskills\u002Flitestream\u002Freferences\u002FSQLITE_INTERNALS.md",{"path":75,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002FTESTING_GUIDE.md",4372,"https:\u002F\u002Fgithub.com\u002Fimjasonh\u002Fplayground\u002Fblob\u002Fmain\u002Flitestream\u002Fskills\u002Flitestream\u002Freferences\u002FTESTING_GUIDE.md",{"path":79,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":82,"sourceHtmlUrl":83},"scripts\u002Fvalidate-setup.sh","SCRIPT","脚本",2613,"https:\u002F\u002Fgithub.com\u002Fimjasonh\u002Fplayground\u002Fblob\u002Fmain\u002Flitestream\u002Fskills\u002Flitestream\u002Fscripts\u002Fvalidate-setup.sh",[85,94],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":89,"licenseFileUrl":90,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M77R6V70544YMHYWTJFGM8J6","web-typography","Select, pair, and implement typefaces for web projects. Use when the user mentions \"font pairing\", \"which typeface\", \"line height\", \"responsive typography\", \"web font loading\", \"type hierarchy\", \"variable fonts\", \"FOUT\u002FFOIT\", \"typographic scale\", or \"the text is hard to read\". Also trigger when choosing between system fonts and web fonts, optimizing font-loading performance, or designing readable long-form content. Covers readability evaluation, CSS implementation, and performance optimization. For overall UI design systems, see refactoring-ui. For dramatic typographic experiences, see top-design.","MIT","https:\u002F\u002Fgithub.com\u002Fimjasonh\u002Fplayground\u002Fblob\u002Fmain\u002F.cursor\u002Fskills\u002Fweb-typography\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fimjasonh\u002Fplayground\u002Fblob\u002Fmain\u002F.cursor\u002Fskills\u002Fweb-typography\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":89,"licenseFileUrl":98,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":19},"01M77R6S98SB467YWCCRSJA9H7","unslop","Cut AI tells from any writing. Must always apply.","https:\u002F\u002Fgithub.com\u002Fimjasonh\u002Fplayground\u002Fblob\u002Fmain\u002F.cursor\u002Fskills\u002Funslop\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fimjasonh\u002Fplayground\u002Fblob\u002Fmain\u002F.cursor\u002Fskills\u002Funslop\u002FSKILL.md",[],[]]