compact-chat-history
compact-chat-history is a Claude Code skill that compresses lengthy conversation histories into structured context snapshots by summarizing task goals, file locations, required skills, and current progress, then saves this snapshot via the compact_chat_history tool. Use this skill when conversation length threatens to exceed token limits and you need to preserve continuity for resuming work across multiple sessions.
git clone --depth 1 https://github.com/dtyq/magic /tmp/compact-chat-history && cp -r /tmp/compact-chat-history/backend/super-magic/agents/skills/compact-chat-history ~/.claude/skills/compact-chat-historySKILL.md
# Compact Chat History Compress the current conversation into a structured summary, then call `compact_chat_history` immediately with the result. --- ## Instructions The conversation history is too long and must be compressed. You must call the `compact_chat_history` tool immediately to complete the summary. Your task is to create a thorough summary of the conversation so far, with special attention to the user's explicit requests and your prior actions. The summary must capture all important details, work results, and file locations to ensure continuity, since we follow an "everything-is-a-file" architecture. Remember: subsequent work will restore context by reading files, so you must provide accurate file paths. For content already saved to files, note the location — do not repeat large blocks of text in the summary itself. Treat the summary as a recovery index, not a transcript. Inline only information that cannot be reliably recovered by reading files or reloading skills: exact URLs, external IDs, user-provided constraints, active runtime references, and critical failure evidence. If a User Input Reference Index is provided, do not reproduce full user messages yourself. Select the indexes of user messages that must be preserved exactly, mention those indexes in Section 6 with short reasons, and pass the same indexes to `compact_chat_history` as `preserved_user_input_indexes`. The system restores the exact text from the original chat history. Use indexes only from the latest User Input Reference Index visible in context. If no current index is available, pass an empty list instead of guessing. Your summary must include the following sections: **1. Task Goals and Approach** - Record all of the user's explicit requests and intent in detail (not just high-level business goals — be specific about every requirement) - Describe the methods and strategies you used (e.g. data processing approach, content generation strategy, information organization method), but do not repeat system prompt content; if there is nothing beyond the system prompt, write "N/A" **2. Key Files and Context Resources** *(most important part — be thorough and precise)* - List all relevant files and resources in order of importance for the current task, without distinguishing between "must-read" and "reference" - For each item, include: full path, purpose, and recommended read timing - Preserve path fidelity: - If a path is inside the current `.workspace` root, it may be relative to `.workspace`, but it must include the full relative path from that root. - If a path is outside `.workspace`, use the absolute filesystem path starting with `/`. - Never shorten a path to only the basename or last folder name. - If a file read failed, record the exact attempted path and the current working directory used for that attempt. - If the path is ambiguous or only partially known, quote the original user-provided path and mark it as unresolved instead of inventing a normalized path. - Prioritize: currently active files and folders, project outline/plan files, user-specified reference files, project config files (e.g. `magic.project.js`) - If some information is not stored in any file (no accurate path available), explicitly note it and provide a method to re-acquire it - Suggest reading the most critical items first, then proceeding in order as needed - Warn that reading all files at once may again fill up the context - For tasks requiring high consistency (e.g. PPT, serial content, same-type pages/chapters), suggest reading a suitable number of already-completed items as style/structure reference **2.5 External Links and Irrecoverable References** - List exact non-file references that may still be needed after compression: internet URLs, media URLs, API endpoints, documentation links, repository/issue/PR links, dashboard/share links, object keys, external IDs, usernames, commit SHAs, branch names, tags, job IDs, run IDs, session IDs, active localhost URLs, ports, and UI attachment identifiers. - For each item, include: exact value, purpose, current status, and which upcoming task needs it. - Preserve exact URL text, including query strings and fragments. Do not shorten, rewrite, infer, or replace URLs with domain-only summaries. - Do not include external references that were already fully processed and have no future use. - For secrets or credentials, prefer the secure storage location, environment variable name, or config key. Include an exact secret value only when the user already provided it in chat and the current task cannot continue without that value. - If an external reference was mentioned but is now unavailable, record how to reacquire it. **3. Skills Needed to Resume This Task** - List skills that are helpful or relevant to continuing the current task, in order of importance - Include skill name and a one-line purpose description - Do NOT reproduce, summarize, or paraphrase any skill content — skills will be re-loaded via `read_skills()` after compression, so repeating their content here wastes context budget - Write "None" if there are no relevant skills **4. Resolved Issues and Current State** - Record resolved issues and any ongoing troubleshooting - Describe in detail what you were doing just before the summary was requested, with special attention to the latest messages from both user and assistant - Include file names; for short content quote directly (under 150 chars); for long content note the line range - Keep unresolved failure evidence visible until it is fixed, intentionally abandoned, or superseded by the user: failed tool/command name, critical error message, attempted path or URL, and the next recovery step. **5. Incomplete Tasks, Next Steps, and Continuity Confirmation** - List all incomplete tasks in execution order (no priority concept) - Describe your intended next action - Important: ensure next steps are directly tied to the user's explicit requests and the task you were w
Query the list of all agents (employees) available to the current user. Use when generating code that requires a real agentId, or when the user asks "which agents/employees do I have".
|
Migrate existing antd-style CSS-in-JS (createStyles) components to Tailwind CSS utility classes with full dark mode support, following the project's style system transition strategy. Use when the user asks to migrate, convert, or rewrite antd-style components to Tailwind, or when working on new components in files that already use antd-style.
Open and operate webpages in a real browser: navigate, read rendered content, inspect interactive elements, click, type, submit forms, press keys, select options, check boxes, hover, scroll, upload files, wait for page changes, manage pages, take and save screenshots, analyze visual layout, and inspect page errors and network activity.
Core canvas design skill covering project management, multimedia principles, AI image generation, web image search, and design marker processing. Load for any canvas design task. CRITICAL - When user message contains [@design_canvas_project:...] or [@design_marker:...] mentions, or when the user wants to generate video/animation/clip on a canvas project, you MUST load this skill first before any operations.
Use when details may have been lost after context compaction, or when the Agent needs to inspect earlier compacted messages or previously created sub-agents.
Manage persistence for user-installed third-party CLI tools in the Super Magic sandbox. Use when the user wants to install, configure, adopt, restore, inspect, or remove a CLI, or when an external skill, webpage, or installer asks to run CLI install commands such as curl|sh, npm install -g, pipx install, uv tool install, go install, cargo install, or brew install. Do not persist runtime-provided CLIs.
Expert code review of current git changes with a senior engineer lens. Detects SOLID violations, security risks, and proposes actionable improvements.