Agent skill
chat-compactor
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.
Install this agent skill to your Project
npx add-skill https://github.com/aiskillstore/marketplace/tree/main/skills/zhanlincui/chat-compactor
SKILL.md
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
- Scan conversation for: decisions, outcomes, failures, file changes, blockers
- Identify the "handoff moment" — what would a fresh agent need to continue?
- Generate structured summary using format above
- Save to file:
session-[topic]-[date].mdin 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:
- Reviews conversation for key decisions, outcomes, failures
- Generates structured markdown per format above
- Saves to
session-[topic]-[date].md - Confirms: "Session compacted to
session-auth-refactor-2025-01-06.md— ready for next time."
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
perigon-backend
Perigon ASP.NET Core + EF Core + Aspire conventions
perigon-agent
Pointers for Copilot/agents to apply Perigon conventions
perigon-angular
Angular 21+ standalone/Material/signal conventions for Perigon WebApp
fastapi-mastery
Comprehensive FastAPI development skill covering REST API creation, routing, request/response handling, validation, authentication, database integration, middleware, and deployment. Use when working with FastAPI projects, building APIs, implementing CRUD operations, setting up authentication/authorization, integrating databases (SQL/NoSQL), adding middleware, handling WebSockets, or deploying FastAPI applications. Triggered by requests involving .py files with FastAPI code, API endpoint creation, Pydantic models, or FastAPI-specific features.
context7-efficient
Token-efficient library documentation fetcher using Context7 MCP with 86.8% token savings through intelligent shell pipeline filtering. Fetches code examples, API references, and best practices for JavaScript, Python, Go, Rust, and other libraries. Use when users ask about library documentation, need code examples, want API usage patterns, are learning a new framework, need syntax reference, or troubleshooting with library-specific information. Triggers include questions like "Show me React hooks", "How do I use Prisma", "What's the Next.js routing syntax", or any request for library/framework documentation.
browser-use
Browser automation using Playwright MCP. Navigate websites, fill forms, click elements, take screenshots, and extract data. Use when tasks require web browsing, form submission, web scraping, UI testing, or any browser interaction.
Didn't find tool you were looking for?