← スキル一覧に戻る

rescue-optimization
by blt
Claude skills for experimenting with datadog-agent
⭐ 0🍴 0📅 2026年1月14日
SKILL.md
name: rescue-optimization description: Salvages optimization work lacking benchmarks. Generates missing evidence, validates claims. Bugs discovered during rescue are valuable - invoke /validate-correctness.
Optimization Rescue
Salvage optimization work done without proper benchmarks. Generate evidence, validate claims, and discover bugs hiding in "optimizations."
Valuable Outcomes
| Outcome | Value | Action |
|---|---|---|
| Change validated | Real improvement proven | KEEP, include in rescued branch |
| Change invalidated | No improvement | DISCARD, record lesson |
| Bug discovered | Correctness issue found | Invoke /validate-correctness |
Bugs found during rescue are SUCCESS, not failure.
Phase 0: Pre-flight
Run /preflight first.
Phase 1: Audit
git diff --name-only origin/main...HEAD | grep '\.go$'
For each change, categorize:
- Preallocation
- Pooling
- Buffer reuse
- Data structure change
- Potential bug (suspicious patterns)
Phase 2: Triage
| Hot Path? | Decision |
|---|---|
| Yes (top 10%) | INVESTIGATE |
| Warm (10-25%) | SKEPTICAL |
| Cold | LIKELY DISCARD |
| Looks buggy | INVESTIGATE for correctness |
Bug Warning Signs
make([]T, n)followed byappend- Missing nil checks
- Changed return semantics
- Slice aliasing
Phase 3: Generate Evidence
Create Benchmarks
func BenchmarkFunction(b *testing.B) {
data := createTestData()
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
_ = Function(data)
}
}
Run Comparison
benchstat /tmp/baseline.txt /tmp/optimized.txt
Phase 4: Validate
| benchstat Result | Decision |
|---|---|
| >=5% improvement, p<0.05 | KEEP |
| No significant change | DISCARD |
| Tests fail | Possible BUG → /validate-correctness |
| Behavior differs | Possible BUG → /validate-correctness |
Phase 5: Handle Bug Discovery
If rescue uncovers a bug instead of an optimization:
/validate-correctness
After validation:
- Record bug in validations.yaml (via validate-correctness)
- Record rescue as BUG_FOUND in rescues.yaml
- The bug fix becomes part of rescued branch (with tests!)
Phase 6: Reconstruct
git checkout main
git checkout -b mem-opt/<name>-rescued
Apply only:
- KEEP changes (validated optimizations)
- BUG_FOUND changes (with tests from /validate-correctness)
Discard everything else.
Phase 7: Record
# Append to rescues.yaml
- branch: mem-opt/original
date: 2026-01-06
audited: 12
kept: 3
discarded: 7
bugs_found: 2
rescued_as: mem-opt/original-rescued
lesson: "<pattern>"
Usage
/rescue-optimization
スコア
総合スコア
55/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
○言語
プログラミング言語が設定されている
0/5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です