Agent Skillsopenclaw/clawhub › convex-retention

convex-retention

GitHub

规范 ClawHub Convex 数据表的生命周期管理,包括定义保留策略、配置 TTL 字段、执行清理定时任务及废弃表移除,确保数据合规与存储优化。

.agents/skills/convex-retention/SKILL.md openclaw/clawhub

Trigger Scenarios

修改或添加 Convex 数据表结构 配置或调整数据保留策略和 TTL 编写数据清理定时任务(Cron) 处理会话认证数据的过期清理

Install

npx skills add openclaw/clawhub --skill convex-retention -g -y
More Options

Non-standard path

npx skills add https://github.com/openclaw/clawhub/tree/main/.agents/skills/convex-retention -g -y

Use without installing

npx skills use openclaw/clawhub@convex-retention

指定 Agent (Claude Code)

npx skills add openclaw/clawhub --skill convex-retention -a claude-code -g -y

安装 repo 全部 skill

npx skills add openclaw/clawhub --all -g -y

预览 repo 内 skill

npx skills add openclaw/clawhub --list

SKILL.md

Frontmatter
{
    "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"
}

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-convex and read convex/_generated/ai/guidelines.md first.
  • Add every new schema table to RETENTION_POLICIES; the Record<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 expirationTime to match Convex Auth. Keep existing expiresAt, dayStart, and processedAt fields unless that table already needs a real migration.
  • Use RETENTION_STANDARD_BATCH_SIZE for ordinary retention jobs. Keep incident-tested special cases, such as skillStatEvents, 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 authSessions and authRefreshTokens are pruned by convex/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 codegen after schema/API changes.
  • Run a real Convex runtime check such as bunx convex dev --once --typecheck=disable.

Version History

  • 5a3b050 Current 2026-07-25 08:43

Same Skill Collection

.agents/skills/autoreview/SKILL.md
.agents/skills/axiom-alerting/SKILL.md
.agents/skills/axiom-sre/SKILL.md
.agents/skills/building-dashboards/SKILL.md
.agents/skills/clawhub-content-rights-correspondence/SKILL.md
.agents/skills/clawhub-convex/SKILL.md
.agents/skills/clawhub-moderation/SKILL.md
.agents/skills/clawhub-pr-maintainer/SKILL.md
.agents/skills/clawhub-production-release/SKILL.md
.agents/skills/controlling-costs/SKILL.md
.agents/skills/convex-acquire-domain/SKILL.md
.agents/skills/convex-add/SKILL.md
.agents/skills/convex-advisor/SKILL.md
.agents/skills/convex-agent/SKILL.md
.agents/skills/convex-auth/SKILL.md
.agents/skills/convex-authz/SKILL.md
.agents/skills/convex-backup/SKILL.md
.agents/skills/convex-billing/SKILL.md
.agents/skills/convex-check-updates/SKILL.md
.agents/skills/convex-cost/SKILL.md
.agents/skills/convex-create-component/SKILL.md
.agents/skills/convex-crons/SKILL.md
.agents/skills/convex-deploy-guard/SKILL.md
.agents/skills/convex-design/SKILL.md
.agents/skills/convex-docs/SKILL.md
.agents/skills/convex-domains/SKILL.md
.agents/skills/convex-env/SKILL.md
.agents/skills/convex-expert/SKILL.md
.agents/skills/convex-explain-app/SKILL.md
.agents/skills/convex-improve-convex-plugin/SKILL.md
.agents/skills/convex-insights/SKILL.md
.agents/skills/convex-launch-readiness/SKILL.md
.agents/skills/convex-migrate-rehearse/SKILL.md
.agents/skills/convex-migrate/SKILL.md
.agents/skills/convex-migration-helper/SKILL.md
.agents/skills/convex-monitor/SKILL.md
.agents/skills/convex-optimize/SKILL.md
.agents/skills/convex-performance-audit/SKILL.md
.agents/skills/convex-quickstart/SKILL.md
.agents/skills/convex-reviewer/SKILL.md
.agents/skills/convex-self-heal/SKILL.md
.agents/skills/convex-sentinel/SKILL.md
.agents/skills/convex-setup-auth/SKILL.md
.agents/skills/convex-ship/SKILL.md
.agents/skills/convex-suggest/SKILL.md
.agents/skills/convex-test/SKILL.md
.agents/skills/convex-verify/SKILL.md
.agents/skills/create-and-cleanup-migration/SKILL.md
.agents/skills/openclaw-brand/SKILL.md

Metadata

Files
0
Version
d6a8c68
Hash
b251d921
Indexed
2026-07-25 08:43

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 04:44
浙ICP备14020137号-1 $mapa de visitantes$