Token导航 LogoToken导航

Agent Skill · 研究检索

archiving-databases(归档数据库)

用于辅助数据库表结构、查询语句、迁移脚本和数据维护任务。它适合让 Agent 分析 schema、编写 SQL、排查查询问题、整理索引或生成迁移建议。使用时需要明确数据库类型、连接环境和目标表,区分只读分析与写入变更;涉及删除、更新、迁移和批量导入时,应优先 dry-run、备份或事务保护,避免误操作。

archiving-databases 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 50,810。

总安装 606周安装 25GitHub Stars 2,129下载 198核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:archiving-databases(归档数据库)
来源仓库:https://github.com/jeremylongshore/claude-code-plugins-plus-skills
仓库路径:skills/archiving-databases
安装命令:
npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill archiving-databases
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill archiving-databases

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于自动化数据库数据归档流水线设计。archiving-databases 属于研究检索类 Skill,可作为该场景下的辅助能力补充。支持按年龄、状态或访问频率迁移历史记录。提供冷存储上传和多数据库类型适配能力。安装需指定 GitHub 仓库,使用时需确认数据库和云存储凭证。

涉及数据删除时应优先执行 dry-run 和备份验证。

来源仓库内路径:skills/archiving-databases

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skill…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

archiving-databases 怎么安装?

在终端执行 npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

archiving-databases 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

archiving-databases 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

archiving-databases 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

archiving-databases 用的人多吗?

公开数据是累计安装 606 次,近一周安装 25 次,下载 198 次,GitHub 2,129 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

archiving-databases 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 来源仓库有 2,129 星,维护活跃度相对可查。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
archiving-databases

归档数据库 · 本页

6062,129接触敏感数据未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Database Archival System

Overview

Implement automated data archival pipelines that move historical records from primary database tables to archive storage (archive tables, S3, Azure Blob, or GCS) based on age, status, or access frequency criteria.

Prerequisites

  • Database credentials with SELECT, INSERT, and DELETE permissions on source and archive tables
  • Cloud storage credentials (AWS S3, Azure Blob, or GCS) if archiving to cold storage
  • psql or mysql CLI for executing archival queries
  • aws s3, az storage, or gsutil CLI for cloud storage uploads
  • Understanding of data retention requirements and compliance policies (GDPR, HIPAA, SOX)
  • Current table sizes: SELECT pg_size_pretty(pg_total_relation_size('table_name')) to identify archival candidates

Instructions

  1. Identify archival candidates by finding large tables with time-based data:

- SELECT relname, n_live_tup, pg_size_pretty(pg_total_relation_size(relid)) FROM pg_stat_user_tables ORDER BY pg_total_relation_size(relid) DESC LIMIT 10 - Focus on tables where historical data is rarely queried: logs, audit trails, events, old orders, expired sessions

  1. Define archival criteria for each table:

- Age-based: Records older than N days/months (WHERE created_at < NOW() - INTERVAL '1 year') - Status-based: Records in terminal state (WHERE status IN ('completed', 'cancelled', 'expired')) - Combined: Old AND terminal (WHERE created_at < NOW() - INTERVAL '6 months' AND status = 'completed') - Calculate the expected volume: SELECT COUNT(*), pg_size_pretty(pg_column_size(t.*)) FROM table_name t WHERE <criteria>

  1. Handle referential integrity by archiving in dependency order:

- Archive child records first (order_items before orders) - For tables with active foreign key references, verify no active records reference the candidates: SELECT COUNT(*) FROM active_child WHERE parent_id IN (SELECT id FROM parent WHERE <archive_criteria>) - Option: cascade archive by archiving parent and all descendants together

  1. Create archive destination tables matching the source schema plus metadata columns:

- CREATE TABLE orders_archive (LIKE orders INCLUDING ALL) - ALTER TABLE orders_archive ADD COLUMN archived_at TIMESTAMPTZ DEFAULT NOW() - ALTER TABLE orders_archive ADD COLUMN archive_batch_id UUID - Remove foreign key constraints on archive tables (archived data is self-contained)

  1. Implement the archival operation as an atomic batch:

- Generate a batch ID: SELECT gen_random_uuid() AS batch_id - Insert into archive: INSERT INTO orders_archive SELECT *, NOW(), batch_id FROM orders WHERE <criteria> - Verify row counts match: SELECT COUNT(*) FROM orders_archive WHERE archive_batch_id = batch_id - Delete from source only after verification: DELETE FROM orders WHERE id IN (SELECT id FROM orders_archive WHERE archive_batch_id = batch_id) - Wrap in a transaction for atomicity

  1. For cloud storage archival, export data to files before upload:

- PostgreSQL: COPY (SELECT * FROM orders WHERE <criteria>) TO '/tmp/archive_orders_2023.csv' WITH CSV HEADER - Compress: gzip /tmp/archive_orders_2023.csv - Upload: aws s3 cp /tmp/archive_orders_2023.csv.gz s3://archive-bucket/orders/2023/ --sse aws:kms - Store manifest: record file path, row count, checksum, and date range in an archive_manifest table

  1. Process archival in batches to avoid long-running transactions and excessive lock time:

- Archive 10,000-50,000 rows per batch - Add a short delay between batches (100-500ms) to allow other transactions to proceed - Log progress after each batch for monitoring and restart capability

  1. Run VACUUM ANALYZE on source tables after archival to reclaim disk space and update statistics. For large archival operations (>30% of table), consider VACUUM FULL during a maintenance window (requires exclusive lock).
  2. Implement data retrieval procedures for archived data:

- For archive tables: direct SQL queries with UNION ALL between active and archive tables - For cloud storage: import script that restores specific date ranges from S3/GCS to temporary tables - Document retrieval procedures for support and compliance teams

  1. Schedule recurring archival with a cron job or database scheduler. Run weekly or monthly. Include monitoring that alerts on: archival job failure, unexpected archive volume (too many or too few records), and source table size not decreasing after archival.

Output

  • Archive table DDL with matching schema plus metadata columns
  • Archival scripts (SQL and shell) for batch extraction, verification, and deletion
  • Cloud storage upload scripts with compression and encryption
  • Archive manifest table tracking all archival batches with metadata
  • Retrieval scripts for restoring archived data when needed
  • Cron job configuration for scheduled recurring archival

Error Handling

ErrorCauseSolution
Foreign key violation during DELETEActive child records still reference archived parentArchive child records first; verify no active references exist before deleting parent records
Disk space not reclaimed after archivalPostgreSQL marks deleted rows as dead tuples but does not release spaceRun VACUUM FULL table_name during maintenance window; or use pg_repack for online space reclamation
Archive batch interrupted mid-transactionNetwork failure, timeout, or crash during archivalTransaction rollback ensures atomicity; restart from the last completed batch using batch_id tracking
Cloud storage upload failsNetwork timeout, credential expiration, or bucket permissionsImplement retry with exponential backoff; verify credentials before starting; use multipart upload for files >100MB
Archived data needed for auditCompliance request requires access to archived recordsQuery archive tables directly; or restore from cloud storage using the archive manifest to locate the correct files

Examples

Archiving 2 years of completed orders to reduce database size by 60%: An orders table with 50M rows (120GB) contains 30M completed orders older than 1 year. Archival moves these to orders_archive in batches of 50,000 rows over 3 hours during off-peak. Source table drops to 20M rows (48GB). VACUUM reclaims 72GB. Query performance on active orders improves by 40%.

Tiered archival to S3 with Parquet format: Orders 6-12 months old move to archive tables (warm tier, queryable via SQL). Orders older than 12 months export to S3 as Parquet files (cold tier, retrievable on request). Parquet format reduces storage costs by 80% compared to CSV. Archive manifest tracks 156 Parquet files across 36 monthly partitions.

GDPR-compliant data retention with automatic purging: Archival script moves user data older than 3 years to archive tables. A separate purge job permanently deletes archive records older than 7 years. Both jobs log actions to an immutable audit trail. Monthly compliance report shows record counts by age tier and confirms purge completion.

Resources

平台分布

Codex

36.66%
按下载量换算73

Claude

29.62%
按下载量换算59

Cursor

19.5%
按下载量换算39

Gemini CLI

9.12%
按下载量换算18

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills