agentleFS
LiriRaidLiriRaid/waymark/skills/dept-data/SKILL.md

dept-data

Skill2 starsChanged 6 days agoMITView on GitHub

Data & State. FIRST for schema, queries, state: \"migración\", \"nueva tabla\", \"índice\", \"consulta lenta\", \"N+1\", \"cache\", \"Redis\", \"estado global\".

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 10 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Mission: Keep data correct, consistent and fast, from the database schema to the client-side store.

    line 9
  2. Very specific:

    Does not own: endpoints and handlers → dept-backend · UI components → dept-frontend · authn/authz policy, secrets → dept-security · …

    line 32
  3. Distinctive:

    Keep migrations zero-downtime: old code must run against the new schema during deploy.

    line 47
  4. Distinctive:

    Use parameterized queries.

    line 50
  5. Distinctive:

    Keep one source of truth per piece of client state.

    line 53
  6. Very specific:

    Prefer: follow the stack's naming convention (e.g.

    line 54
  7. Distinctive:

    Prefer the simplest reactive primitive.

    line 55
  8. Distinctive:

    Prefer soft delete or archival only when a requirement asks for it.

    line 56
  9. Distinctive:

    Prefer: measure (EXPLAIN, profiler) before optimizing.

    line 57
  10. Distinctive:

    Never edit or delete a migration already applied in a shared environment.

    line 58
  11. Distinctive:

    Never store tokens, secrets or PII in browser storage.

    line 59
  12. Very specific:

    Never use loose types (any-like) in models.

    line 60
  13. Distinctive:

    Never run long data backfills inside a schema migration on large tables.

    line 61

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Data Engineering & State Management

Quick ref

Mission: Keep data correct, consistent and fast, from the database schema to the client-side store. Rules: migrations reversible and zero-downtime · index foreign keys and filtered columns · every cache has a key scheme, TTL and invalidation · single source of truth for client state · no secrets in client storage Skills by default: library-docs · code-review · Explore DoD: migration rollback tested · query plan checked · cache invalidation defined · state derived, not duplicated

Entry

Guest (no Waymark block in context) → ../waymark/references/coexistence.md §3. Reads:

  • Learnings: ~/.waymark/learnings/dept-data.md if it exists.
  • Stack profile: L1 Commands + Data/State, L2+ full.

Brief questions

The brief must answer before the first edit:

  1. What — which table/column/index/query/cache/store changes, and the exact shape (types, nullability, constraints, keys).
  2. Why / for whom — which feature or measured problem (latency, N+1, inconsistency) it serves; for caches, the measurement that justifies it.
  3. Where — migration, model, repository, cache and store locations per the architecture profile; who owns the data (one feature or shared).
  4. Change class — additive or destructive; if destructive, the expand/contract steps and release in which each runs.
  5. Integrity & access — constraints in the database, tenant/owner scoping, row-level policy, PII columns.
  6. Performance — indexes needed, expected row counts, EXPLAIN plan, pagination strategy, lock risk on large tables.
  7. Consistency — cache key scheme, TTL, invalidation trigger; client state owner, derived values, stale-event handling.
  8. How / done — procedure below, skills and MCP chosen, rollback proof and tests (zero/one/many rows, hit/miss/invalidation).

Scope

  • Owns: schema design, migrations, indexes, constraints, query performance, row-level access rules as data policy, server caches, client state stores, derived state, client persistence, data models and types, seeds and fixtures.
  • Does not own: endpoints and handlers → dept-backend · UI components → dept-frontend · authn/authz policy, secrets → dept-security · backups, DB provisioning → dept-devops · module boundaries → dept-architecture.

Procedures

In procedures.md (same folder), one section per task:

  • Schema migration
  • New query or repository method
  • Server cache
  • Client state store
  • Client persistence
  • Bug fix (data or state)
  • Refactor

Rules

  • Make every migration reversible, or document why it is irreversible and how to restore.
  • Keep migrations zero-downtime: old code must run against the new schema during deploy.
  • Index foreign keys and frequently filtered/sorted columns; add unique constraints for business uniqueness.
  • Enforce integrity in the database (constraints) in addition to application validation.
  • Use parameterized queries; no string-built SQL with input.
  • Scope every query on multi-tenant or user-owned data by tenant/owner, via row-level policies or a mandatory query scope.
  • Give every cache entry a namespaced key, explicit TTL and an invalidation trigger.
  • Keep one source of truth per piece of client state; derive, do not duplicate.
  • Prefer: follow the stack's naming convention (e.g. snake_case columns) and singular/plural consistently.
  • Prefer the simplest reactive primitive; use stream libraries only for real event streams (sockets, debounced input, cancellation).
  • Prefer soft delete or archival only when a requirement asks for it.
  • Prefer: measure (EXPLAIN, profiler) before optimizing.
  • Never edit or delete a migration already applied in a shared environment.
  • Never store tokens, secrets or PII in browser storage.
  • Never use loose types (any-like) in models; use precise types and narrow unknown input.
  • Never run long data backfills inside a schema migration on large tables; use a batched job.

Tools

CapabilitySkill / MCP / AgentWhenLevel
docs.librarylibrary-docs (→ the docs MCP servers the user has)ORM, migration DSL, DB engine, cache client, store/reactivity API not verified this sessionQ
memoryWaymark memory: the pack the hook hands over, W memory / tasks, and engram search (or mem_search)Prior decisions and root causes; what you learn goes in the Cierre's Aprendido (the hook saves it to engram)L1
search.codebaseExplore (agent)Find all readers/writers of a table, cache key or store (mandatory for destructive changes)L1
review.diffcode-reviewBefore declaring doneL2
plan.implementationPlan (agent)Destructive migration, new store architectureL3
db.inspect (live schema, EXPLAIN)none yet → waymark references/skills.mdInspect the real database or query planL2

Definition of Done

  • Migration applied, rolled back and re-applied locally
  • Destructive change split into expand/contract steps
  • Indexes on new foreign keys and filtered columns; EXPLAIN checked for new heavy queries
  • Row-level access defined for user/tenant data
  • Cache: key scheme, TTL and invalidation documented in code
  • Client state: single source of truth, derived values computed, loading/error/empty handled
  • No token, secret or PII in client storage or in the diff

Hand-offs

  • To dept-backend: endpoint changes required by the schema; job for backfills.
  • To dept-security: row-level policies, PII columns, encryption at rest, data retention.
  • To dept-frontend: store API or model type changes consumed by UI.
  • To dept-devops: migration ordering in deploy, backups before destructive change, cache infra.
  • To dept-architecture: where models/stores live, cross-feature shared state.
  • To dept-qa: data fixtures, migration test strategy.

Learned rules

Grows with use (../waymark/references/learning.md).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.