Skip to main content
ClaudeWave
EN, English
Skill288 repo starsupdated 7d ago

strategic-compact

Strategic Compact provides guidance for manually compressing context during extended conversations by identifying logical transition points where compression is appropriate and specifying what information must be retained versus discarded. Use this skill when approaching token limits in long sessions to preserve critical decisions, constraints, and task objectives while removing intermediate exploration details and completed steps that no longer serve the current phase.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/majiayu000/spellbook /tmp/strategic-compact && cp -r /tmp/strategic-compact/skills/strategic-compact ~/.claude/skills/strategic-compact
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# Strategic Compact

## 概述

在长会话中,上下文窗口有限。此 skill 指导何时压缩、保留什么、丢弃什么。

核心原则:**在逻辑边界压缩,不在任意时刻压缩。**

## 压缩决策表

| 当前阶段 | 下一阶段 | 是否压缩 | 理由 |
|----------|----------|----------|------|
| 研究/探索 | 规划 | 是 | 探索细节不需要带入规划 |
| 规划 | 实现 | 是 | 保留计划,丢弃规划过程 |
| 实现步骤 N | 实现步骤 N+1 | 否 | 实现中途压缩会丢失上下文 |
| 实现完成 | 验证 | 可选 | 如果上下文接近上限 |
| 验证 | 提交 | 否 | 验证结果需要带入提交 |
| 任务 A 完成 | 任务 B 开始 | 是 | 不同任务间压缩 |

## 压缩后保留清单

必须保留:
- 当前任务目标和约束
- 已做的架构决策及理由
- 已修改的文件列表
- 未完成的步骤
- 发现的问题和 TODO
- VibeGuard 约束(始终保留)

可以丢弃:
- 文件内容的完整引用(保留路径即可)
- 搜索过程中的中间结果
- 已解决的错误的完整堆栈
- 探索性的代码阅读记录

## 使用方式

当感觉上下文即将耗尽时:

1. 判断当前处于哪个阶段
2. 查压缩决策表,确认是否适合压缩
3. 如果适合,按保留清单整理摘要
4. 执行压缩

## 反模式

- 在实现中途压缩 → 丢失关键上下文,导致重复工作
- 压缩时丢弃约束 → 后续步骤违反规则
- 不压缩直到溢出 → 被动截断比主动压缩更危险
agentsmd-optimizeSkill

Audit AND optimize a CLAUDE.md / AGENTS.md instruction file — score it against the five high-leverage patterns, flag anti-patterns, then apply approved fixes in place. Use when the user says 优化 CLAUDE.md / 优化 AGENTS.md / optimize my agent doc / 帮我改 claudemd, or after an audit when they want the fixes applied (not just reported).

agentsmd-scaffoldSkill

Generate or update repository-specific AGENTS.md instruction files from real repo evidence. Use when asked to create, design, scaffold, split, or improve root or scoped AGENTS.md files for Codex/Claude/agent workflows, especially when a repo needs directory-specific rules, validation commands, generated-file boundaries, or a short agent onboarding router.

api-designSkill

REST/GraphQL/gRPC API design best practices. Use when designing APIs, defining contracts, handling versioning. Covers OpenAPI 3.2, GraphQL Federation, gRPC streaming.

app-ui-designSkill

Mobile app UI design expert for iOS and Android. Use when designing app interfaces, creating design systems, ensuring accessibility, or following platform guidelines. Covers Material Design 3, Human Interface Guidelines, color theory, typography, and 2025 trends.

app-user-story-qaSkill

End-to-end app feature inventory and user-story testing workflow with a canonical tracker. Use when the user asks to audit every feature, derive expected behavior from code, test user journeys, or explicitly fix and retest documented UX or logistical defects.

architecture-foundationSkill

Design architecture foundations before implementation. Use when asked to design or refactor architecture, choose Rust/Go crate, package, module, runtime, workflow, or service boundaries, compare mature project architecture, prevent stacked one-off PRs, audit migration debt in existing repos, or produce a spec before coding.

architecture-researchSkill

Evidence-driven architecture research for understanding real systems and making technical decisions. Use when doing architecture landscape studies, source-backed system archaeology, build-vs-buy or adopt/adapt/build decisions, open-source and commercial comparisons, revisiting an earlier architecture choice, or handling requests such as 架构调研, 架构选型, 竞品架构, 技术尽调, 同类方案, 开源替代, how is X built, and what should we learn from X. Do not use for small mechanical changes, market-only discovery, or detailed design after the technology direction is already fixed.

ask-opencliSkill

Ask Grok or Gemini via opencli (browser-session based, no API cost). Use when the user says "问 grok", "问 gemini", "ask grok", "ask gemini", "用 grok 查", "grok 怎么看", "让 gemini 分析", or wants a second opinion from Grok/Gemini without paying API tokens. Routes to opencli which drives the already-logged-in Chrome session.