Skip to content
Back to skills

Smart Compact

ASecurity

Smarter /compact — shows a topic menu from the current session so you choose what survives the summary. Use when the user types /smart-compact, says 'smart compact', asks to 'compact with options', wants to 'choose what to focus the compact on', wants to reduce context or tokens while staying in control of what gets kept, or says things like 'context is getting big, help me compact smartly' or 'let's compact but I want to pick what to keep'. Surfaces the top 5 topics most-recent-first, lets t...

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 6, 2026
ai-agentsgodebugging

Works with

  • cli
  • mcp

Security analysis

A100/100

Scanned December 6, 2026

npx -y skills add flopperj/dotfiles-core --skill smart-compact --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Smart Compact?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Smart Compact
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/flopperj-smart-compact/badge)](https://www.skillsdirectory.com/skills/flopperj-smart-compact)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: smart-compact
description: "Smarter /compact — shows a topic menu from the current session so you choose what survives the summary. Use when the user types /smart-compact, says 'smart compact', asks to 'compact with options', wants to 'choose what to focus the compact on', wants to reduce context or tokens while staying in control of what gets kept, or says things like 'context is getting big, help me compact smartly' or 'let's compact but I want to pick what to keep'. Surfaces the top 5 topics most-recent-first, lets the user pick by number, select all, smart-pick, custom, or default, then generates the exact /compact command to run."
user-invocable: true
---

# Smart Compact

The user wants to compact the conversation but stay in control of what survives
the summary. Your job is to reflect on the conversation, surface the key topics
as a clean menu, let the user pick, then run `/compact` with a precise focus
string.

This costs almost nothing extra — the conversation is already in your context,
so topic extraction is just reflection, not a new scan.

## Step 1: Show topic menu

Show the topic menu. Extract the 5 most meaningful discussion
topics from this session, **sorted most recent first** — the freshest work at
the top since that's most likely what the user wants to preserve.

Be specific, not generic. "Discussed billing code" is bad.
"OrderPaymentService null pointer bug — root cause traced to getPricingPlan()" is good.

Format:
```
🧠 Smart Compact — here's what we covered this session:

1. {topic — one line, specific, includes key outcome or artifact}
2. {topic}
3. {topic}
4. {topic}
5. {topic}

💬 Showing top 5 by recency — type 'm' to see all topics

What to keep in the summary?
  → Enter numbers (e.g. 1,3,5)
  → a  = all of the above
  → m  = show more topics
  → c  = custom focus (you type it)
  → s  = smart pick (I'll choose what matters most for continuing work)
  → d  = default   (no focus — /compact decides everything)
```

Good topics mention: the specific thing worked on, what was found/decided/built,
and any artifact (file, ticket, PR, fix). Avoid vague phrases like "discussed X"
— say what the outcome was.

If the user types **m**, show all topics (up to 10), numbered continuing from 6,
then re-show the options menu so they can pick from the full list.

## Step 2: Wait for user input

Wait for the user to respond. Don't proceed until they pick.

## Step 3: Confirm and compact

Based on their choice:

After determining the focus, always end with this exact format so the user knows
what to do — `/compact` is a built-in CLI command that only the user can run,
not Claude:

```
📋 Copy and run this in your chat input to compact:

/compact Focus on: {focus string}
```

**Numbers (e.g. "1,3")** — combine those topics into a focused sentence:
```
Got it — compacting with focus on:
  • {topic 1 title}
  • {topic 3 title}

📋 Copy and run this in your chat input to compact:

/compact Focus on: {one sentence combining the selected topics, specific enough
that the summary will preserve the key facts, decisions, and artifacts from each}
```

**"a" (all)** — cover ALL topics discussed in the session, not just the 5 shown.
Reflect on the full conversation to write a comprehensive focus string:
```
Got it — keeping everything.

📋 Copy and run this in your chat input to compact:

/compact Focus on: {comprehensive sentence covering all topics discussed}
```

**"c" (custom)** — ask them to type their focus, then:
```
📋 Copy and run this in your chat input to compact:

/compact Focus on: {their exact words}
```

**"d" (default)** — no focus string, let `/compact` decide everything:
```
Got it — running default compact, no focus guidance.

📋 Copy and run this in your chat input to compact:

/compact
```

**"s" (smart pick)** — choose the 2-3 topics most likely to matter for
continuing work (prefer: decisions made, code changed, open tickets, unresolved
issues over: background research, debugging dead-ends, already-resolved issues):
```
Smart pick — keeping the topics most useful for continuing:
  • {topic A}
  • {topic B}

📋 Copy and run this in your chat input to compact:

/compact Focus on: {focused sentence on chosen topics}
```

## What makes a good focus string

The focus string tells `/compact` what to prioritize in the summary. A good one:
- Names specific files, tickets, PRs, functions, or decisions
- Mentions what was concluded, not just what was discussed
- Is one sentence, 20-40 words

Bad: "Focus on: the work we did today"
Good: "Focus on: FINOPS-4925 open PR #311134 payment validation logging,
OrderPaymentService null pointer root cause at line 894, and Jira MCP auth fix
via token refresh"

## Maintenance

If you discover something during this task that would improve this skill,
propose the change and ask me to confirm before saving it.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.