SkillsReviewed · maxrave-dev

Data-layer footguns: Room, SQL and repositories

Data-layer footguns is a reference skill for AI coding assistants and Kotlin developers, but its app-specific examples need review before reuse. Its 26 guides cover Room/SQLite, DataStore, imports, analytics, repository flows, caching and paging, with explanations of silent failures and suggested checks.

Researched 16 Nov 2026

In short.

Data-layer footguns is a reference skill for AI coding assistants and Kotlin developers, but its examples need adaptation to each project's schema, dependencies and behavior. Its strongest material explains failures that return plausible data or report success while doing nothing. The documentation includes corrected examples, known defects and project-specific observations; these need distinguishing before copying code. Runtime correctness, compatibility and performance have not been assessed.

Researched and written by an AI model and checked by a second AI model. How it works

The scope is skills/data-layer-footguns at commit 2c391bc9c9f873580aa855d7a7b1c3a2ed9e68ae: SKILL.md and all 26 reference files, plus the repository-root LICENSE as the related notice. Sibling skills and the original application source are outside this scope. All supplied source texts were considered. No code, commands, builds, migrations or application journeys were executed; host compatibility, runtime correctness, performance and subsequent revisions remain unassessed.

The overview

Identity

The resource is the skills/data-layer-footguns folder in maxrave-dev/kotlin-footguns. It contains SKILL.md and 26 Markdown references about database and repository mistakes. It is assistant-loadable guidance with illustrative code, rather than an executable database library.

The original folder at the documented revision is available at [https://github.com/maxrave-dev/kotlin-footguns/tree/2c391bc9c9f873580aa855d7a7b1c3a2ed9e68ae/skills/data-layer-footguns].

Assessment

This is useful when a Kotlin app's data looks plausible but is wrong: cleanup deletes nothing, a loading indicator never resolves, or a cached screen disappears after a network failure. The references connect those symptoms to specific query, flow and state-handling mistakes.

Its value is explanatory rather than turnkey. Several examples deliberately correct defects in the original app, while others display faulty code to explain it. The text often identifies that distinction, but readers still need to inspect the surrounding explanation before adopting a snippet.

Users

The closest fit is developers maintaining Android or Kotlin Multiplatform apps with local storage and remote APIs. Experienced developers can use it before migrations, query changes or repository reviews. Beginners get concrete explanations of failure symptoms, but the examples assume familiarity with Kotlin, SQL, coroutines and application layers.

AI coding assistants can use the index to retrieve relevant guidance before proposing changes. Supported assistant products and host-specific compatibility are not established.

Capabilities

Database coverage includes nullable SQL filters, wildcard escaping, cache deletion order, dependent-row cleanup, Room setup, migration paths and compaction. It distinguishes rows that are disposable from rows representing user choices, such as favourites and downloads.

Analytics guidance covers event-table design, timestamp conversion, local-time grouping, first-seen counts, period boundaries and complete distributions for share calculations. It also explains how retention can change the meaning of 'first ever' and how incomplete periods distort comparisons.

Repository guidance covers observable preferences, success/error flows, cache policies, continuation tokens, local sorting, paged search and imports. Additional references address preserving API section order and mirroring local flags to a remote account while keeping local actions independent of network success.

Using it

Requirements

Reading requires access to Markdown files. Applying the examples requires a relevant Kotlin codebase; individual topics assume Room/SQLite, DataStore, coroutine Flow, serialization or dependency injection. The folder does not establish a complete dependency set or minimum supported versions.

Suggested checks use tools including grep, Python, sqlite3, curl and unzip, depending on the topic. Paths and expected counts often belong to the source app and must be replaced with equivalents in the target project.

Mechanism

SKILL.md maps tasks and symptoms to short reference files. Each reference explains a pattern, its failure modes and suggested verification. Some cross-references point to sibling skills outside this folder.

The technical explanations focus on hidden assumptions. A NULL in a NOT IN subquery can prevent unmatched rows from passing the filter; bound LIKE parameters still contain active wildcards; and changing a timestamp projection from LocalDateTime to Long bypasses the converter shown in the example. The local-bucketing guide then derives several figures from one sample query, while warning that the returned rows grow with the time window.

Setup

Obtain the original folder and retain SKILL.md beside its references directory so relative links remain meaningful. Keep the repository licence with redistributed copies. No host-specific installation command or registration procedure is documented in the supplied folder.

For assistant use, the host needs to make the files readable. Start with the index and the references relevant to the intended change. A self-contained use of every cross-reference would also require material from sibling skill folders.

Example

For a screen that displays cached content and then turns into an error, cache-then-network describes emitting the cached value before requesting fresh data. A failed refresh emits an error only if no cached value was served. Its proposed checks distinguish warm-cache failure, cold-cache failure and successful refresh by inspecting the full emission sequence. These are expected behaviors, not observed results.

For a large import, the guides describe rejecting an empty decoded envelope before writing, inserting parent records in chunks, reporting progress per chunk and filtering invalid child references. The illustrated batch size is 500 songs; the guide explicitly says to choose the size using a real maximum-size file. Its documented format limits are examples from that app, not general limits for import systems.

Assessment & evidence

Limitations

The examples depend on particular schemas, timestamp encodings and consumer behavior. For example, keeping cached content after a refresh failure assumes the UI would otherwise replace that content with an error. Wall-clock timestamp advice applies to the demonstrated converter, not every integer timestamp.

Some verification labels describe existing defects rather than a desirable target. The Room setup and migration guides identify Android-only migration and callback registration as a problem, yet their verification sections call Android-only matches a pass condition. That wording should not be adopted as a cross-platform acceptance criterion.

Illustrative snippets also retain gaps: the full-table accumulator has no iteration ceiling, and the local-token guide documents malformed-token exits that can leave paging stuck. Runtime behavior, installation and performance have not been tested or run.

Reasoning

The strongest recurring principle is to verify what the consumer actually needs: a complete distribution for a share, whole retained history for a first-seen count, or every page for an export. Similar return types do not establish equivalent meaning.

There is a concrete error in the accumulator's verification explanation. It says changing the stopping condition from size < PAGE to size <= PAGE loses the last page for exactly PAGE rows. Reading the displayed code shows that rows are appended before the check, so that one-page case still returns all rows. With multiple pages, the changed condition instead stops after the first full page. This is a code-reading inference, not an execution result, and supports checking the guide's assertions against the actual implementation.

Alternatives

The folder offers implementation alternatives rather than comparisons with competing skills. Cache-then-network refreshes on each collection while serving a stored value first; the TTL cache skips a request for a fresh entry. A small JSON preferences map suits a different scale from the indexed-table cache described for a large remote catalogue.

For search, the guide distinguishes querying the backing store of a paged collection from filtering a collection already fully loaded in memory. The appropriate choice depends on the data contract. Comparative quality against other skills or documentation sets is unknown.

Evidence

The evidence consists of the skill index, all 26 reference files and the repository's root licence at one commit. The references contain adapted code, author-reported observations and proposed verification procedures. The underlying app implementation and execution records are not supplied.

The cleanup guide reports one database shrinking from 57 MB to roughly 12 MB. The distribution guide illustrates truncation using a Zipf-shaped 500-entity example. These support understanding the authors' cases; they do not establish expected savings or statistical effects for another dataset.

Access & freshness

Costs

No acquisition price, subscription requirement, assistant usage cost or implementation estimate is stated. Those costs are unknown.

The documentation identifies potential operating costs without establishing measurements for a reader's app: offset paging performs increasing work, a JSON-map lookup decodes the whole cache, and compaction rewrites the database and needs additional disk space. The ETag guide proposes reducing repeat downloads, but actual savings are not assessed.

Rights

The repository supplies GNU General Public License version 3 in its root LICENSE. For covered material, its terms permit copying, modification and distribution subject to conditions, including preserving applicable notices and supplying the licence. Distribution of modified covered works carries additional notice and licensing requirements.

The licence disclaims warranty. Its generic instructions for applying GPL to new programs contain 'or later' wording, but that template alone does not establish an or-later grant for this specific skill. The original licence is available at [https://raw.githubusercontent.com/maxrave-dev/kotlin-footguns/2c391bc9c9f873580aa855d7a7b1c3a2ed9e68ae/LICENSE].

Freshness

The available snapshot identifies commit 2c391bc9c9f873580aa855d7a7b1c3a2ed9e68ae and a capture time of 2026-11-16T00:21:14.356Z. That timestamp does not establish when individual guides were last edited. Later changes and release cadence are unknown.

Version-sensitive claims need particular care. The raw-query guide discusses Room 2.8, while the setup guide records native slices for a SQLite driver artifact identified as 2.7.0 and explicitly warns against treating recorded architecture lists as current support guarantees.

Actions

Use the index to identify relevant references, then confirm their schema, version and consumer assumptions before changing code. Treat source-project counts and paths as examples. For migrations, inspect registration on every supported platform and exercise upgrades from old databases rather than relying on fresh installation.

Choose checks that expose the relevant failure: fail a later page and confirm retry remains possible, supply malformed local tokens and confirm paging recovers, search for an unloaded item, or compare LIKE matches using near-identical IDs. These are recommended next steps; their outcomes remain unknown.

Evidence for this report

LICENSEnotice · checked 2026-11-16
skills/data-layer-footguns/SKILL.mdselected · checked 2026-11-16