CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

kv-cache-design

优化 Agent 推理延迟与成本、诊断首 token 变慢或缓存命中率下降时使用——KV Cache 前缀不变性原则、三条铁律、五种破坏缓存的错误上下文管理模式、Chat Template 与历史思维链回传策略、缓存作为架构约束(缓存边界、子 Agent 字节级对齐、替换字符串冻结)。

Quality

80%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Passed

No findings from the security scan

Fix and improve this skill with Tessl

tessl review fix ./skills/kv-cache-design/SKILL.md
SKILL.md
Quality
Evals
Security

Quality

Content

63%Weight 40%Scale 1-5

Reviews the quality of instructions and guidance provided to agents. Good implementation is clear, handles edge cases, and produces reliable results.

The body delivers dense, high-value operational knowledge with concrete rules, contrast tables, and a verification checklist — clearly the work of someone with real production experience. Its weaknesses are re-explanations of transformer fundamentals Claude already knows and a broken progressive-disclosure story: the referenced companion files are absent from the bundle and substantial detail (vendor policies, research frontier) is inlined rather than split out.

Suggestions

Cut or compress the explanations of concepts Claude already knows — the KV Cache mechanism intro, the quadratic-prefill/linear-decode cost aside, and the causal-attention justification — down to one framing sentence each, keeping only the operational implications.

Fix progressive disclosure: either ship the referenced files (chapter2/kv-cache/ experiment code, book/chapter2.md) in the bundle or remove/repair the dangling '配套代码' and '深度阅读' references so every path resolves.

Move the per-vendor CoT-return policy table and the research-frontier paragraph (Models Take Notes at Prefill, RoPE re-location) into a one-level-deep reference file (e.g. references/vendor-policies.md), leaving a short summary and a clearly signaled pointer in SKILL.md.

DimensionReasoningScore

Conciseness

Several passages re-explain transformer fundamentals Claude already knows: 'KV Cache 把前文 token 的键值对(K/V)缓存下来', '无缓存时 prefill 注意力计算量随上下文长度平方级增长', '因果注意力决定每个 token 的 KV 只依赖它之前的 token', and the long research-frontier paragraph. Most other content (vendor-specific CoT policies, quantified failure cases) is genuinely non-obvious, so this matches anchor 3 ('mostly efficient but includes some unnecessary explanation or could be tightened') rather than 4.

3 / 5

Actionability

Guidance is concrete and checkable: three explicit iron rules, the layered layout diagram, vendor-specific API contracts ('必须原样回传 reasoning_content,否则 API 直接返回 400'), and a copy-ready checklist ('[ ] system prompt 与 tools 顺序在代码中是常量'). Matches anchor 4 (mostly executable guidance with minor gaps, e.g. no command for reading cached_tokens); as an instruction-only skill with actionable guidance it is not penalized for lacking code.

4 / 5

Workflow Clarity

The flow 何时使用 → 核心原则 → 实践模式 → 常见陷阱 → 落地检查清单 forms a clear diagnostic/application sequence, and the checklist provides explicit verification checkpoints ('会话恢复时能重建与缓存字节流一致的消息序列'). Matches anchor 4 (clear sequence, most checkpoints present); not 5 because there is no error-recovery feedback loop, and not 3 because checkpoints are explicit rather than implicit.

4 / 5

Progressive Disclosure

Section headers are well organized, but the referenced paths 'chapter2/kv-cache/', 'book/chapter2.md' and 'context-compression' do not exist in the bundle (no references/, scripts/, or assets/ directories are present), so the references are dangling. Additionally the ~90-line body inlines content (per-vendor CoT return policies, research-frontier notes) that belongs in one-level-deep reference files. Matches anchor 3 ('some structure; references present but not clearly signaled; content that should be separate is inline'), not 4 because the dangling references are not usable navigation.

3 / 5

Total

14

/

20

Passed

Description

87%Weight 40%Scale 1-5

Based on the skill's description, can an agent find and select it at the right time? Clear, specific descriptions lead to better discovery.

A strong description: it names a precise niche, gives explicit 'use when' triggers in natural language, and inventories the skill's distinctive content. The only weakness is that it reads slightly more as a table of contents than as a list of capabilities.

DimensionReasoningScore

Specificity

The description enumerates many specific items ('前缀不变性原则', '三条铁律', '五种破坏缓存的错误上下文管理模式', '子 Agent 字节级对齐', '替换字符串冻结') but frames them as a topic inventory rather than concrete actions — only '优化 Agent 推理延迟与成本、诊断首 token 变慢或缓存命中率下降' states actions. Closest to anchor 4; not 5 because it lists covered topics more than executable actions, and not 3 because coverage is broad and precise.

4 / 5

Completeness

Both halves are explicit: 'when' via '诊断首 token 变慢或缓存命中率下降时使用' and 'what' via the enumerated principles and strategies (cache boundary, byte-level alignment, Chat Template/CoT return policies). This matches anchor 5 — both what and when answered with concrete trigger phrases — and not 4, since neither side lacks specificity.

5 / 5

Trigger Term Quality

Natural phrases a user would actually say are present: '推理延迟与成本', '首 token 变慢', '缓存命中率下降'. A few common synonyms are missing (e.g. 'TTFT', 'Prompt Cache 不命中', '推理账单翻倍'), matching anchor 4 (good coverage, a few natural terms missing) rather than 5.

4 / 5

Distinctiveness Conflict Risk

The KV-cache/prompt-cache context-design niche with triggers like '缓存命中率下降' and 'Chat Template 与历史思维链回传策略' is clearly distinct from other skills' trigger surfaces. Matches anchor 5 (clear niche, distinct triggers, minimal conflict risk); no closely related skill would collide on these phrases.

5 / 5

Total

18

/

20

Passed

Validation

100%

Checks the skill against the spec for correct structure and formatting. All validation checks must pass before discovery and implementation can be scored.

Validation — 16 / 16 Passed

Validation for skill structure

No warnings or errors.

Repository

bojieli/ai-agent-book

Path

skills/kv-cache-design/SKILL.md

Reviewed

Table of Contents

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.