Agent Skillsrcarmo/piclaw › timeline-cleanup

timeline-cleanup

GitHub

按关键词模式清理时间线中的低价值消息,默认保护含附件的消息。支持自定义或内置模式组,提供节流、重试及数据库真空选项,返回清理统计结果。

skel/.pi/skills/timeline-cleanup/SKILL.md rcarmo/piclaw

Trigger Scenarios

需要清理聊天记录或时间线数据 执行自动化数据维护任务

Install

npx skills add rcarmo/piclaw --skill timeline-cleanup -g -y
More Options

Non-standard path

npx skills add https://github.com/rcarmo/piclaw/tree/main/skel/.pi/skills/timeline-cleanup -g -y

Use without installing

npx skills use rcarmo/piclaw@timeline-cleanup

指定 Agent (Claude Code)

npx skills add rcarmo/piclaw --skill timeline-cleanup -a claude-code -g -y

安装 repo 全部 skill

npx skills add rcarmo/piclaw --all -g -y

预览 repo 内 skill

npx skills add rcarmo/piclaw --list

SKILL.md

Frontmatter
{
    "name": "timeline-cleanup",
    "description": "Delete low-value messages from the web timeline by keyword patterns. Protects messages with user-uploaded images. Optionally vacuums the DB afterward.",
    "distribution": "private"
}

Timeline Cleanup

Delete low-value timeline messages by pattern, with attachment protection by default.

Default chat scope:

  • if chatJid is omitted, the cleanup targets web:default
  • for web:* chats, the helper resolves the full web session scope (root chat plus branches)

Usage

Cleanup is available both as an import and as a CLI.

Import

import { cleanupTimeline } from "/workspace/.pi/skills/timeline-cleanup/cleanup.ts";

const result = await cleanupTimeline({
  patterns: ["reload", "compaction"],
  // dryRun: true,
  // includeMedia: false,
  // vacuum: false,
  // beforeRowid: 99999,
  // chatJid: "web:default",
  // maxLength: 300,
  // senderFilter: "web-agent",
  // throttleMs: 1100,
  // retryOn429: true,
  // maxRetries: 2,
});

CLI

bun run /workspace/.pi/skills/timeline-cleanup/cleanup.ts \
  --patterns "reload,compaction,compacting" \
  --before 5000 \
  --dry-run

Result shape

cleanupTimeline() returns a CleanupResult shaped like:

{
  matched: number,
  skipped: number,
  deleted: number,
  failed: number,
  dbSizeBefore: string,
  dbSizeAfter: string
}

cleanupAll() returns a record of those per built-in pattern group.

Built-in pattern groups

Use cleanupAll() for a full housekeeping pass:

import { cleanupAll } from "/workspace/.pi/skills/timeline-cleanup/cleanup.ts";
const results = await cleanupAll({ beforeRowid: 5000, dryRun: true });
Group Patterns Sender Max length
Reloads reload, supervisorctl restart, restart-piclaw, local-install, bun pm pack any 500
Compaction compaction, compacting, auto-compact any 500
Greetings (user) exact: hey, hello, hi, Hello?, hey there, etc. user 30
Agent intros Hey! ..., Hello! ..., good to see you, ready to help agent 300
Slash commands lines starting with / any 50
Slash responses Unknown command:, Current model:, Switched...model, Switching...model, Model switched, Cycle model, Cycle thinking, Thinking level, Thinking set, Supports thinking agent 300
One-word acks exact: yes, ok, go, done, well?, so?, etc. any 30
Transition filler let me check, let me look, now let me, etc. agent 200
Version bumps bumped version, tagged v0., bump patch any 300
Build/lint/test make lint, make test, bun run build, pass...0 fail any 300
Git operations git add, git commit -m, git push, git status any 200
Package installs bun install, bun add, bun update, packages installed any 300

Behaviour

  • delete operations are throttled by default (1100ms) with optional retry on HTTP 429 responses
  • media-bearing messages are skipped unless --include-media is set
  • vacuuming is optional and only makes sense after actual deletions

Vacuum

Vacuuming requires exclusive DB access. The helper can copy the DB to /tmp, vacuum the copy, swap it in, and restart piclaw briefly.

Environment

  • PICLAW_STORE — message DB parent directory (default /workspace/.piclaw/store)
  • PICLAW_WEB_PORT — web server port (default 8080)
  • PICLAW_INTERNAL_SECRET / PICLAW_WEB_INTERNAL_SECRET — internal API auth

Related

  • close-of-day uses the same cleanup strategy as part of end-of-day maintenance.

Version History

  • 5fa0ce5 Current 2026-07-25 10:26

Same Skill Collection

runtime/skills/builtin/reload/SKILL.md
runtime/skills/builtin/remote-peer/SKILL.md
runtime/skills/builtin/schedule/SKILL.md
runtime/skills/builtin/script-discovery-annotation/SKILL.md
runtime/skills/builtin/send-message/SKILL.md
runtime/skills/integrations/playwright/SKILL.md
runtime/skills/operator/graphite-power-chart/SKILL.md
runtime/skills/operator/token-chart/SKILL.md
skel/.pi/skills/adaptive-cards-authoring/SKILL.md
skel/.pi/skills/bootstrap-container/SKILL.md
skel/.pi/skills/debug/SKILL.md
skel/.pi/skills/export-timeline-pdf/SKILL.md
skel/.pi/skills/extension-design/SKILL.md
skel/.pi/skills/extension-troubleshoot/SKILL.md
skel/.pi/skills/feature-refinement-flow/SKILL.md
skel/.pi/skills/feed-digest/SKILL.md
skel/.pi/skills/graph-design/SKILL.md
skel/.pi/skills/graphite-power-chart/SKILL.md
skel/.pi/skills/kanban-management/SKILL.md
skel/.pi/skills/mcp-adapter/SKILL.md
skel/.pi/skills/playwright/SKILL.md
skel/.pi/skills/reload/SKILL.md
skel/.pi/skills/remote-peer/SKILL.md
skel/.pi/skills/schedule/SKILL.md
skel/.pi/skills/script-discovery-annotation/SKILL.md
skel/.pi/skills/send-message/SKILL.md
skel/.pi/skills/setup/SKILL.md
skel/.pi/skills/situate-daily-notes/SKILL.md
skel/.pi/skills/technical-docs/SKILL.md
skel/.pi/skills/token-chart/SKILL.md
skel/.pi/skills/twitter-summary/SKILL.md
skel/.pi/skills/web-search-summary/SKILL.md
skel/.pi/skills/web-search/SKILL.md

Metadata

Files
0
Version
ae927fb
Hash
085e3fee
Indexed
2026-07-25 10:26

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 11:19
浙ICP备14020137号-1 $Гость$