一键导入
smart-compact
Analyze session context and generate a targeted prompt for /compact to preserve important information.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Analyze session context and generate a targeted prompt for /compact to preserve important information.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Publish agent research as a durable Markdown vault entry, optionally with a GitHub Gist share artifact.
Iteratively ask clarifying questions to enrich the current Plan before review.
Create, switch, list, and delete git worktrees with `git wt` (the git-wt CLI). Use when working on multiple branches in parallel, isolating an experiment in its own checkout, or whenever the user mentions worktrees or `git wt`.
Extract technical learnings from the session and save them to the learn repository.
Iteratively refine the current Plan by applying Codex review feedback until Codex has no more issues to raise.
Review the current plan by auto-selecting appropriate reviewer agents based on project characteristics.
| name | smart-compact |
| description | Analyze session context and generate a targeted prompt for /compact to preserve important information. |
| disable-model-invocation | true |
Analyze the session context and generate a user-tailored /compact prompt that preserves the most important information.
Analyze the full conversation history and extract:
Display the analysis as concise bullet points.
Based on the Phase 1 analysis, ask the user via AskUserQuestion what to preserve.
Question generation rules:
Question template:
Question: "Which information should /compact prioritize preserving?"
header: "Preserve"
multiSelect: true
Example choices (dynamically generated from session):
- "Implementation progress and remaining work for <specific task>"
- "Error investigation context around <filename>"
- "Design decisions and rationale for <technology>"
- "API specification and type definitions for <feature>"
Important: Generate concrete choices derived from the session analysis, not generic presets.
Based on the user's selections, generate a /compact prompt.
Prompt generation guidelines:
Output format:
Please compress the context while prioritizing the following information:
1. [Specific content of preserve item 1]
2. [Specific content of preserve item 2]
3. [Specific content of preserve item 3]
Preserve the following accurately:
- [Important identifiers, paths, commands, etc.]
Present the generated prompt and confirm via AskUserQuestion.
Via AskUserQuestion:
- "Run compact with this prompt?"
- "Run it" — display the command
- "Modify" — apply modifications
- "Cancel"
On approval:
Output the command in a copyable format:
Copy and run the following command:
```
/compact <generated prompt>
```
On modification request:
Regenerate the prompt reflecting the user's feedback and re-confirm.
| Situation | Response |
|---|---|
| Session too short for compaction | Notify that compact is likely unnecessary |
| Nothing worth preserving | Suggest a bare /compact with no arguments |
| User cancels | Do nothing and exit |
/compact is a built-in Claude Code command and cannot be invoked programmatically from a skill