convex-retention
Use when adding or changing ClawHub Convex tables, TTL fields, cleanup crons, retention policy, auth/session cleanup, metric dedupe cleanup, or deprecated table removal
- License 许可
- MIT
- 所属仓库
- openclaw/clawhub
- 最近更新
- 2026-11-15
- Stars
- ★ 9.6k
- Forks
- 1.5k
01 前言 Front Matter
- name
- convex-retention
- description
- Use when adding or changing ClawHub Convex tables, TTL fields, cleanup crons, retention policy, auth/session cleanup, metric dedupe cleanup, or deprecated table removal
03 SKILL.md 正文
Convex Retention
Overview
ClawHub retention is code-owned. Every current Convex table must be classified in
convex/lib/retentionPolicy.ts, and ephemeral tables need an indexed, bounded cleanup path unless
their lifecycle is handled by usage-time validation or a documented component.
Checklist
- Use
clawhub-convexand readconvex/_generated/ai/guidelines.mdfirst. - Add every new schema table to
RETENTION_POLICIES; theRecord<TableNames, RetentionPolicy>type is the enforcement gate. - For ephemeral tables, prefer an explicit expiration field plus index, then prune with
.withIndex()and.take(...). - For new generic TTL tables, prefer
expirationTimeto match Convex Auth. Keep existingexpiresAt,dayStart, andprocessedAtfields unless that table already needs a real migration. - Use
RETENTION_STANDARD_BATCH_SIZEfor ordinary retention jobs. Keep incident-tested special cases, such asskillStatEvents, on their documented caps. - Cron jobs should schedule bounded cleanup entrypoints only. Large one-off production migrations or
destructive backfills still start with
convex-migration-helper. - Do not bulk-clear active auth state. Expired
authSessionsandauthRefreshTokensare pruned byconvex/retention.ts.
Verification
- Add or update focused tests for policy classification and cleanup behavior.
- Run the focused Vitest slice for touched cleanup modules.
- Run
bunx convex codegenafter schema/API changes. - Run a real Convex runtime check such as
bunx convex dev --once --typecheck=disable.
04 同仓库更多 Skills
notes
Turn user-provided notes into a concise agenda.
hosted-research
Read approved reference material for the hosted proof.
convex-advisor
Read the Convex deployment's 72h insights (read limits, OCC contention), root-cause each event in code, report evidence-backed perf/cost findings with fixes.
convex-add
Add a capability to the CURRENT Convex app — consults the served Convex capability catalog for always-current procedures (billing, crons, auth, agent, search, …); falls back to built-in hosting or @convex-dev component search. TRIGGER when the user runs /add, or asks to add hosting/publishing or any backend capability to an existing Convex app.
convex-acquire-domain
Find and buy a domain for the current Convex app through Convex, then bind it (labs; spend action).
controlling-costs
Analyzes Axiom query patterns to find unused data, then builds dashboards and monitors for cost optimization. Use when asked to reduce Axiom costs, find unused columns or field values, identify data waste, or track ingest spend.