optimize-size
Use only when explicitly invoked: reduce CaseDash executable size.
от casedash★ 31 звезда на GitHub
Установить optimize-size в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Optimize Size
Overview
Use this skill to run measured, high-leverage executable-size experiments for CaseDash. Aim for a retained build\CaseDash.exe reduction of at least 10 KiB when plausible, and keep going past the first small win while credible larger hypotheses remain.
Required Context
- Read
AGENTS.md. - Read
docs/optimize_size.mdbefore forming hypotheses. Treat it as the source of truth for size constraints, retained size shape, active negative guidance, map workflow, current baseline, and size pitfall notes. - Read
docs/build.mdfor build and validation entrypoints. - Read
docs/profile_benchmark.mdbefore changing renderer, widget layout, layout resolver, telemetry, provider sampling, or other hot paths. - Read
docs/architecture.mdand the relevantdocs/architecture/*.mdfiles before removing or bypassing package boundaries, middle-man layers, or shared abstractions.
Baseline
- Inspect
git status --short; ignore unrelated dirty work and do not revert changes made by others. - Build a fresh Release app with
.\build.cmd. - Record the shipped executable size:
(Get-Item .\build\CaseDash.exe).Length
- Generate maps with
.\build_maps.cmd. - Inspect
build\CaseDash.map.summary.txt. Use focused ad hoc map analysis when needed:
python .\tools\analyze_link_map.py .\build\CaseDash.map --top 25
- Compare the largest sections, project objects, and symbols against the maintained notes in
docs/optimize_size.md. Treat MSVC map symbol sizes as estimates.
Hypothesis Selection
Prioritize changes that can delete whole families of generated code, metadata, unwind data, resources, descriptors, or repeated cold-path machinery. Look for:
- Repeated code patterns across multiple source files or branches of one large method.
- Large methods with repeated construction, formatting, tracing, or validation chains.
- Inefficient metadata layouts, duplicated descriptor tables, redundant field facts, or extra data stored in maps.
- Repeated construction or copying of large structures, especially config, layout, telemetry, dump, and edit-tree payloads.
- APIs whose many parameters cause repeated call-site code, wide/narrow string churn, or template instantiations.
- Small fixed domains still using broad STL containers, sorting, callbacks, type erasure, or local algorithm variants.
- Middle-man abstractions that can be removed only when package boundaries and
lint.cmdarchitecture checks allow it.
Do not spend the main effort on tiny localized cleanups unless they are part of a broader measured pattern or unblock a larger deletion. Avoid experiments covered by active negative guidance in docs/optimize_size.md unless new surrounding code makes the old measurement stale, and record why the retry is justified.
Experiment Discipline
- Rank hypotheses by expected executable delta, behavioral risk, performance risk, and blast radius.
- Change one coherent hypothesis at a time.
- Prefer cold-path, resource, metadata, and linker-shape wins before changing renderer, widget draw, layout resolver, or telemetry hot paths.
- Preserve the full feature set: supported hardware providers, diagnostics, layout-edit, localization, embedded default config/localization, app icon behavior, and
/default-configbehavior. - Keep normal builds free of map generation; use
build_maps.cmdonly for size analysis. - Rebuild and remeasure after each serious experiment. If an experiment is neutral or regresses and does not improve source clarity enough to keep, revert only your own changes from that experiment.
- Leave concise
Size:comments near non-obvious retained code shapes where a conventional cleanup would likely reintroduce larger code. - Keep going until the retained executable reduction reaches at least 10 KiB, or until the remaining plausible hypotheses are too risky, already disproven, or only tiny localized wins.
Validation
- Run
.\format.cmd changedafter C++ edits; use.\format.cmd fix changedif formatting needs repair. - Run
.\lint.cmd includes changedafter retained C++ refactorings or code-shape rewrites, because size-oriented reshaping often breaks architecture, source-policy, include-style, or unused-include checks. - Run
.\build.cmdbefore every shipped-size measurement and before headless validation. - Run
.\build_maps.cmdafter the final retained build and inspectbuild\CaseDash.map.summary.txt. - Run
.\test.cmdwhen source behavior changes beyond trivial code-shape cleanup. - Prefer the smallest headless app validation that proves the edited paths. For broad size work, use
/default-config /fake /exitand put explicit diagnostics outputs underbuild\, for example:
.\build\CaseDash.exe /default-config /fake /exit /trace:build\size_optimization_validation_trace.txt /dump:build\size_optimization_validation_dump.txt /screenshot:build\size_optimization_validation_screenshot.png /layout-guide
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл optimize-size?
Use only when explicitly invoked: reduce CaseDash executable size.
Как установить скилл optimize-size?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл optimize-size запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…