chat-compactor

GitHub

生成面向AI代理的结构化会话摘要,保留决策依据、死胡同和当前状态,优化上下文切换与任务交接,避免重复探索。

planning/chat-compactor/SKILL.md ZhanlinCui/Agent-Skills-Hunter

触发场景

用户指令包含compact, wrap up, save session等 上下文窗口容量超过50%且任务进行中 即将进行重大上下文切换前 调试或实现会话结束时

安装

npx skills add ZhanlinCui/Agent-Skills-Hunter --skill chat-compactor -g -y
更多选项

非标准路径

npx skills add https://github.com/ZhanlinCui/Agent-Skills-Hunter/tree/main/planning/chat-compactor -g -y

不安装直接使用

npx skills use ZhanlinCui/Agent-Skills-Hunter@chat-compactor

指定 Agent (Claude Code)

npx skills add ZhanlinCui/Agent-Skills-Hunter --skill chat-compactor -a claude-code -g -y

安装 repo 全部 skill

npx skills add ZhanlinCui/Agent-Skills-Hunter --all -g -y

预览 repo 内 skill

npx skills add ZhanlinCui/Agent-Skills-Hunter --list

SKILL.md

Frontmatter
{
    "name": "chat-compactor",
    "description": "Generate structured session summaries optimized for future AI agent consumption. Use when (1) ending a coding\/debugging session, (2) user says \"compact\", \"summarize session\", \"save context\", or \"wrap up\", (3) context window is getting long and continuity matters, (4) before switching tasks or taking a break. Produces machine-readable handoff documents that let the next session start fluently without re-explaining."
}

Chat Compactor

Generate structured summaries optimized for AI agent continuity across sessions.

Why This Exists

Human-written summaries and ad-hoc AI summaries lose critical context:

  • Decision rationale gets lost (why X, not Y)
  • Dead ends get forgotten (agent re-tries failed approaches)
  • Implicit knowledge isn't captured (file locations, naming conventions, gotchas)
  • State is unclear (what's done, what's pending, what's blocked)

This skill produces agent-optimized handoff documents that prime the next session.

Output Format

Generate a markdown file with this structure:

# Session: [Brief Title]
Date: [YYYY-MM-DD]
Duration: ~[X] messages

## Context Snapshot
[1-2 sentences: What project/task, what state it's in right now]

## What Was Accomplished
- [Concrete outcome 1]
- [Concrete outcome 2]

## Key Decisions & Rationale
| Decision | Why | Alternatives Rejected |
|----------|-----|----------------------|
| [Choice] | [Reason] | [What didn't work and why] |

## Current State
- **Working**: [files/features that are functional]
- **Broken/Blocked**: [what's not working and why]
- **Modified files**: [list with brief note on changes]

## Dead Ends (Don't Retry)
- ❌ [Approach that failed] — [why it failed]

## Next Steps (Prioritized)
1. [ ] [Most important next action]
2. [ ] [Second priority]

## Environment & Gotchas
- [Any setup notes, versions, quirks discovered]

## Key Code/Commands Reference
[Only if there are non-obvious commands or snippets the next session needs]

Workflow

  1. Scan conversation for: decisions, outcomes, failures, file changes, blockers
  2. Identify the "handoff moment" — what would a fresh agent need to continue?
  3. Generate structured summary using format above
  4. Save to file: session-[topic]-[date].md in project root or /home/claude/sessions/

Compaction Triggers

Invoke this skill when:

  • User says: "compact", "wrap up", "save session", "summarize for next time"
  • Context window exceeds ~50% capacity and task is ongoing
  • Before major context switches
  • End of debugging/implementation session

Quality Criteria

Good compactions are:

  • Scannable: Next agent gets orientation in <30 seconds
  • Actionable: Clear next steps, not vague summaries
  • Defensive: Dead ends documented to prevent re-exploration
  • Minimal: No fluff, every line earns its tokens

Anti-Patterns

Avoid:

  • Narrative prose ("First we tried X, then Y, then Z...")
  • Redundant context (don't repeat what's in code comments)
  • Vague summaries ("Made good progress on the feature")
  • Missing failure documentation (most valuable part!)

Example Trigger & Response

User: "Let's wrap up, compact this session"

Agent:

  1. Reviews conversation for key decisions, outcomes, failures
  2. Generates structured markdown per format above
  3. Saves to session-[topic]-[date].md
  4. Confirms: "Session compacted to session-auth-refactor-2025-01-06.md — ready for next time."

版本历史

  • 849c38a 当前 2026-07-05 09:21

同 Skill 集合

agent/dispatching-parallel-agents/SKILL.md
agent/subagent-driven-development/SKILL.md
agent/using-superpowers/SKILL.md
agent/writing-skills/SKILL.md
creative/algorithmic-art/SKILL.md
creative/brand-guidelines/SKILL.md
creative/canvas-design/SKILL.md
creative/frontend-design/SKILL.md
creative/slack-gif-creator/SKILL.md
creative/theme-factory/SKILL.md
dev/deploying-to-production/SKILL.md
dev/internationalizing-websites/SKILL.md
dev/mcp-builder/SKILL.md
dev/skill-creator/SKILL.md
dev/web-artifacts-builder/SKILL.md
dev/webapp-testing/SKILL.md
docs/doc-coauthoring/SKILL.md
docs/docx/SKILL.md
docs/github-release-assistant/SKILL.md
docs/internal-comms/SKILL.md
docs/pdf/SKILL.md
docs/pptx/SKILL.md
docs/xlsx/SKILL.md
git-workflow/finishing-a-development-branch/SKILL.md
git-workflow/using-git-worktrees/SKILL.md
integration/daily-news/SKILL.md
integration/doc-sync-tool/SKILL.md
integration/notebooklm/SKILL.md
integration/web-access/SKILL.md
integration/x-article-publisher/SKILL.md
obsidian/json-canvas/SKILL.md
obsidian/obsidian-bases/SKILL.md
obsidian/obsidian-helper/SKILL.md
obsidian/obsidian-markdown/SKILL.md
obsidian/project-to-obsidian/SKILL.md
planning/brainstorming/SKILL.md
planning/executing-plans/SKILL.md
planning/planning-with-files/SKILL.md
planning/writing-plans/SKILL.md
quality/receiving-code-review/SKILL.md
quality/requesting-code-review/SKILL.md
quality/systematic-debugging/SKILL.md
quality/test-driven-development/SKILL.md
quality/verification-before-completion/SKILL.md
seo/google-official-seo-guide/SKILL.md
seo/web-performance-seo/SKILL.md
vercel/vercel-deploy/SKILL.md
vercel/vercel-react-best-practices/SKILL.md
vercel/vercel-web-design-guidelines/SKILL.md
creative/ui-ux-pro-max/SKILL.md

元信息

文件数
0
版本
849c38a
Hash
af0083c3
收录时间
2026-07-05 09:21

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-15 05:48
浙ICP备14020137号-1 $访客地图$