opencode-skills-collection 1.0.185 → 1.0.187

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/bundled-skills/.antigravity-install-manifest.json +5 -1
  2. package/bundled-skills/3d-web-experience/SKILL.md +152 -37
  3. package/bundled-skills/agent-evaluation/SKILL.md +1088 -26
  4. package/bundled-skills/agent-memory-systems/SKILL.md +1037 -25
  5. package/bundled-skills/agent-tool-builder/SKILL.md +668 -16
  6. package/bundled-skills/ai-agents-architect/SKILL.md +271 -31
  7. package/bundled-skills/ai-product/SKILL.md +716 -26
  8. package/bundled-skills/ai-wrapper-product/SKILL.md +450 -44
  9. package/bundled-skills/algolia-search/SKILL.md +867 -15
  10. package/bundled-skills/autonomous-agents/SKILL.md +1033 -26
  11. package/bundled-skills/aws-serverless/SKILL.md +1046 -35
  12. package/bundled-skills/azure-functions/SKILL.md +1318 -19
  13. package/bundled-skills/browser-automation/SKILL.md +1065 -28
  14. package/bundled-skills/browser-extension-builder/SKILL.md +159 -32
  15. package/bundled-skills/bullmq-specialist/SKILL.md +347 -16
  16. package/bundled-skills/clerk-auth/SKILL.md +796 -15
  17. package/bundled-skills/computer-use-agents/SKILL.md +1870 -28
  18. package/bundled-skills/context-window-management/SKILL.md +271 -18
  19. package/bundled-skills/conversation-memory/SKILL.md +453 -24
  20. package/bundled-skills/crewai/SKILL.md +252 -46
  21. package/bundled-skills/discord-bot-architect/SKILL.md +1207 -34
  22. package/bundled-skills/docs/integrations/jetski-cortex.md +3 -3
  23. package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +1 -1
  24. package/bundled-skills/docs/maintainers/repo-growth-seo.md +3 -3
  25. package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
  26. package/bundled-skills/docs/users/bundles.md +1 -1
  27. package/bundled-skills/docs/users/claude-code-skills.md +1 -1
  28. package/bundled-skills/docs/users/gemini-cli-skills.md +1 -1
  29. package/bundled-skills/docs/users/getting-started.md +1 -1
  30. package/bundled-skills/docs/users/kiro-integration.md +1 -1
  31. package/bundled-skills/docs/users/usage.md +4 -4
  32. package/bundled-skills/docs/users/visual-guide.md +4 -4
  33. package/bundled-skills/email-systems/SKILL.md +646 -26
  34. package/bundled-skills/faf-expert/SKILL.md +221 -0
  35. package/bundled-skills/faf-wizard/SKILL.md +252 -0
  36. package/bundled-skills/file-uploads/SKILL.md +212 -11
  37. package/bundled-skills/firebase/SKILL.md +646 -16
  38. package/bundled-skills/gcp-cloud-run/SKILL.md +1117 -32
  39. package/bundled-skills/graphql/SKILL.md +1026 -27
  40. package/bundled-skills/hubspot-integration/SKILL.md +804 -19
  41. package/bundled-skills/idea-darwin/SKILL.md +120 -0
  42. package/bundled-skills/inngest/SKILL.md +431 -16
  43. package/bundled-skills/interactive-portfolio/SKILL.md +342 -44
  44. package/bundled-skills/langfuse/SKILL.md +296 -41
  45. package/bundled-skills/langgraph/SKILL.md +259 -50
  46. package/bundled-skills/micro-saas-launcher/SKILL.md +343 -44
  47. package/bundled-skills/neon-postgres/SKILL.md +572 -15
  48. package/bundled-skills/nextjs-supabase-auth/SKILL.md +269 -21
  49. package/bundled-skills/notion-template-business/SKILL.md +371 -44
  50. package/bundled-skills/personal-tool-builder/SKILL.md +537 -44
  51. package/bundled-skills/plaid-fintech/SKILL.md +825 -19
  52. package/bundled-skills/prompt-caching/SKILL.md +438 -25
  53. package/bundled-skills/rag-engineer/SKILL.md +271 -29
  54. package/bundled-skills/salesforce-development/SKILL.md +912 -19
  55. package/bundled-skills/satori/SKILL.md +54 -0
  56. package/bundled-skills/scroll-experience/SKILL.md +381 -44
  57. package/bundled-skills/segment-cdp/SKILL.md +817 -19
  58. package/bundled-skills/shopify-apps/SKILL.md +1475 -19
  59. package/bundled-skills/slack-bot-builder/SKILL.md +1162 -28
  60. package/bundled-skills/telegram-bot-builder/SKILL.md +152 -37
  61. package/bundled-skills/telegram-mini-app/SKILL.md +445 -44
  62. package/bundled-skills/trigger-dev/SKILL.md +916 -27
  63. package/bundled-skills/twilio-communications/SKILL.md +1310 -28
  64. package/bundled-skills/upstash-qstash/SKILL.md +898 -27
  65. package/bundled-skills/vercel-deployment/SKILL.md +637 -39
  66. package/bundled-skills/viral-generator-builder/SKILL.md +132 -37
  67. package/bundled-skills/voice-agents/SKILL.md +937 -27
  68. package/bundled-skills/voice-ai-development/SKILL.md +375 -46
  69. package/bundled-skills/workflow-automation/SKILL.md +982 -29
  70. package/bundled-skills/zapier-make-patterns/SKILL.md +772 -27
  71. package/package.json +1 -1
@@ -1,24 +1,15 @@
1
1
  ---
2
2
  name: prompt-caching
3
- description: "You're a caching specialist who has reduced LLM costs by 90% through strategic caching. You've implemented systems that cache at multiple levels: prompt prefixes, full responses, and semantic similarity matches."
3
+ description: Caching strategies for LLM prompts including Anthropic prompt
4
+ caching, response caching, and CAG (Cache Augmented Generation)
4
5
  risk: none
5
- source: "vibeship-spawner-skills (Apache 2.0)"
6
- date_added: "2026-02-27"
6
+ source: vibeship-spawner-skills (Apache 2.0)
7
+ date_added: 2026-02-27
7
8
  ---
8
9
 
9
10
  # Prompt Caching
10
11
 
11
- You're a caching specialist who has reduced LLM costs by 90% through strategic caching.
12
- You've implemented systems that cache at multiple levels: prompt prefixes, full responses,
13
- and semantic similarity matches.
14
-
15
- You understand that LLM caching is different from traditional caching—prompts have
16
- prefixes that can be cached, responses vary with temperature, and semantic similarity
17
- often matters more than exact match.
18
-
19
- Your core principles:
20
- 1. Cache at the right level—prefix, response, or both
21
- 2. K
12
+ Caching strategies for LLM prompts including Anthropic prompt caching, response caching, and CAG (Cache Augmented Generation)
22
13
 
23
14
  ## Capabilities
24
15
 
@@ -28,39 +19,461 @@ Your core principles:
28
19
  - cag-patterns
29
20
  - cache-invalidation
30
21
 
22
+ ## Prerequisites
23
+
24
+ - Knowledge: Caching fundamentals, LLM API usage, Hash functions
25
+ - Skills_recommended: context-window-management
26
+
27
+ ## Scope
28
+
29
+ - Does_not_cover: CDN caching, Database query caching, Static asset caching
30
+ - Boundaries: Focus is LLM-specific caching, Covers prompt and response caching
31
+
32
+ ## Ecosystem
33
+
34
+ ### Primary_tools
35
+
36
+ - Anthropic Prompt Caching - Native prompt caching in Claude API
37
+ - Redis - In-memory cache for responses
38
+ - OpenAI Caching - Automatic caching in OpenAI API
39
+
31
40
  ## Patterns
32
41
 
33
42
  ### Anthropic Prompt Caching
34
43
 
35
44
  Use Claude's native prompt caching for repeated prefixes
36
45
 
46
+ **When to use**: Using Claude API with stable system prompts or context
47
+
48
+ import Anthropic from '@anthropic-ai/sdk';
49
+
50
+ const client = new Anthropic();
51
+
52
+ // Cache the stable parts of your prompt
53
+ async function queryWithCaching(userQuery: string) {
54
+ const response = await client.messages.create({
55
+ model: "claude-sonnet-4-20250514",
56
+ max_tokens: 1024,
57
+ system: [
58
+ {
59
+ type: "text",
60
+ text: LONG_SYSTEM_PROMPT, // Your detailed instructions
61
+ cache_control: { type: "ephemeral" } // Cache this!
62
+ },
63
+ {
64
+ type: "text",
65
+ text: KNOWLEDGE_BASE, // Large static context
66
+ cache_control: { type: "ephemeral" }
67
+ }
68
+ ],
69
+ messages: [
70
+ { role: "user", content: userQuery } // Dynamic part
71
+ ]
72
+ });
73
+
74
+ // Check cache usage
75
+ console.log(`Cache read: ${response.usage.cache_read_input_tokens}`);
76
+ console.log(`Cache write: ${response.usage.cache_creation_input_tokens}`);
77
+
78
+ return response;
79
+ }
80
+
81
+ // Cost savings: 90% reduction on cached tokens
82
+ // Latency savings: Up to 2x faster
83
+
37
84
  ### Response Caching
38
85
 
39
86
  Cache full LLM responses for identical or similar queries
40
87
 
88
+ **When to use**: Same queries asked repeatedly
89
+
90
+ import { createHash } from 'crypto';
91
+ import Redis from 'ioredis';
92
+
93
+ const redis = new Redis(process.env.REDIS_URL);
94
+
95
+ class ResponseCache {
96
+ private ttl = 3600; // 1 hour default
97
+
98
+ // Exact match caching
99
+ async getCached(prompt: string): Promise<string | null> {
100
+ const key = this.hashPrompt(prompt);
101
+ return await redis.get(`response:${key}`);
102
+ }
103
+
104
+ async setCached(prompt: string, response: string): Promise<void> {
105
+ const key = this.hashPrompt(prompt);
106
+ await redis.set(`response:${key}`, response, 'EX', this.ttl);
107
+ }
108
+
109
+ private hashPrompt(prompt: string): string {
110
+ return createHash('sha256').update(prompt).digest('hex');
111
+ }
112
+
113
+ // Semantic similarity caching
114
+ async getSemanticallySimilar(
115
+ prompt: string,
116
+ threshold: number = 0.95
117
+ ): Promise<string | null> {
118
+ const embedding = await embed(prompt);
119
+ const similar = await this.vectorCache.search(embedding, 1);
120
+
121
+ if (similar.length && similar[0].similarity > threshold) {
122
+ return await redis.get(`response:${similar[0].id}`);
123
+ }
124
+ return null;
125
+ }
126
+
127
+ // Temperature-aware caching
128
+ async getCachedWithParams(
129
+ prompt: string,
130
+ params: { temperature: number; model: string }
131
+ ): Promise<string | null> {
132
+ // Only cache low-temperature responses
133
+ if (params.temperature > 0.5) return null;
134
+
135
+ const key = this.hashPrompt(
136
+ `${prompt}|${params.model}|${params.temperature}`
137
+ );
138
+ return await redis.get(`response:${key}`);
139
+ }
140
+ }
141
+
41
142
  ### Cache Augmented Generation (CAG)
42
143
 
43
144
  Pre-cache documents in prompt instead of RAG retrieval
44
145
 
45
- ## Anti-Patterns
146
+ **When to use**: Document corpus is stable and fits in context
147
+
148
+ // CAG: Pre-compute document context, cache in prompt
149
+ // Better than RAG when:
150
+ // - Documents are stable
151
+ // - Total fits in context window
152
+ // - Latency is critical
153
+
154
+ class CAGSystem {
155
+ private cachedContext: string | null = null;
156
+ private lastUpdate: number = 0;
157
+
158
+ async buildCachedContext(documents: Document[]): Promise<void> {
159
+ // Pre-process and format documents
160
+ const formatted = documents.map(d =>
161
+ `## ${d.title}\n${d.content}`
162
+ ).join('\n\n');
163
+
164
+ // Store with timestamp
165
+ this.cachedContext = formatted;
166
+ this.lastUpdate = Date.now();
167
+ }
168
+
169
+ async query(userQuery: string): Promise<string> {
170
+ // Use cached context directly in prompt
171
+ const response = await client.messages.create({
172
+ model: "claude-sonnet-4-20250514",
173
+ max_tokens: 1024,
174
+ system: [
175
+ {
176
+ type: "text",
177
+ text: "You are a helpful assistant with access to the following documentation.",
178
+ cache_control: { type: "ephemeral" }
179
+ },
180
+ {
181
+ type: "text",
182
+ text: this.cachedContext!, // Pre-cached docs
183
+ cache_control: { type: "ephemeral" }
184
+ }
185
+ ],
186
+ messages: [{ role: "user", content: userQuery }]
187
+ });
188
+
189
+ return response.content[0].text;
190
+ }
191
+
192
+ // Periodic refresh
193
+ async refreshIfNeeded(documents: Document[]): Promise<void> {
194
+ const stale = Date.now() - this.lastUpdate > 3600000; // 1 hour
195
+ if (stale) {
196
+ await this.buildCachedContext(documents);
197
+ }
198
+ }
199
+ }
200
+
201
+ // CAG vs RAG decision matrix:
202
+ // | Factor | CAG Better | RAG Better |
203
+ // |------------------|------------|------------|
204
+ // | Corpus size | < 100K tokens | > 100K tokens |
205
+ // | Update frequency | Low | High |
206
+ // | Latency needs | Critical | Flexible |
207
+ // | Query specificity| General | Specific |
208
+
209
+ ## Sharp Edges
210
+
211
+ ### Cache miss causes latency spike with additional overhead
212
+
213
+ Severity: HIGH
214
+
215
+ Situation: Slow response when cache miss, slower than no caching
216
+
217
+ Symptoms:
218
+ - Slow responses on cache miss
219
+ - Cache hit rate below 50%
220
+ - Higher latency than uncached
221
+
222
+ Why this breaks:
223
+ Cache check adds latency.
224
+ Cache write adds more latency.
225
+ Miss + overhead > no caching.
226
+
227
+ Recommended fix:
228
+
229
+ // Optimize for cache misses, not just hits
230
+
231
+ class OptimizedCache {
232
+ async queryWithCache(prompt: string): Promise<string> {
233
+ const cacheKey = this.hash(prompt);
234
+
235
+ // Non-blocking cache check
236
+ const cachedPromise = this.cache.get(cacheKey);
237
+ const llmPromise = this.queryLLM(prompt);
238
+
239
+ // Race: use cache if available before LLM returns
240
+ const cached = await Promise.race([
241
+ cachedPromise,
242
+ sleep(50).then(() => null) // 50ms cache timeout
243
+ ]);
244
+
245
+ if (cached) {
246
+ // Cancel LLM request if possible
247
+ return cached;
248
+ }
249
+
250
+ // Cache miss: continue with LLM
251
+ const response = await llmPromise;
252
+
253
+ // Async cache write (don't block response)
254
+ this.cache.set(cacheKey, response).catch(console.error);
255
+
256
+ return response;
257
+ }
258
+ }
46
259
 
47
- ### Caching with High Temperature
260
+ // Alternative: Probabilistic caching
261
+ // Only cache if query matches known high-frequency patterns
262
+ class SelectiveCache {
263
+ private patterns: Map<string, number> = new Map();
48
264
 
49
- ### No Cache Invalidation
265
+ shouldCache(prompt: string): boolean {
266
+ const pattern = this.extractPattern(prompt);
267
+ const frequency = this.patterns.get(pattern) || 0;
50
268
 
51
- ### Caching Everything
269
+ // Only cache high-frequency patterns
270
+ return frequency > 10;
271
+ }
52
272
 
53
- ## ⚠️ Sharp Edges
273
+ recordQuery(prompt: string): void {
274
+ const pattern = this.extractPattern(prompt);
275
+ this.patterns.set(pattern, (this.patterns.get(pattern) || 0) + 1);
276
+ }
277
+ }
54
278
 
55
- | Issue | Severity | Solution |
56
- |-------|----------|----------|
57
- | Cache miss causes latency spike with additional overhead | high | // Optimize for cache misses, not just hits |
58
- | Cached responses become incorrect over time | high | // Implement proper cache invalidation |
59
- | Prompt caching doesn't work due to prefix changes | medium | // Structure prompts for optimal caching |
279
+ ### Cached responses become incorrect over time
280
+
281
+ Severity: HIGH
282
+
283
+ Situation: Users get outdated or wrong information from cache
284
+
285
+ Symptoms:
286
+ - Users report wrong information
287
+ - Answers don't match current data
288
+ - Complaints about outdated responses
289
+
290
+ Why this breaks:
291
+ Source data changed.
292
+ No cache invalidation.
293
+ Long TTLs for dynamic data.
294
+
295
+ Recommended fix:
296
+
297
+ // Implement proper cache invalidation
298
+
299
+ class InvalidatingCache {
300
+ // Version-based invalidation
301
+ private cacheVersion = 1;
302
+
303
+ getCacheKey(prompt: string): string {
304
+ return `v${this.cacheVersion}:${this.hash(prompt)}`;
305
+ }
306
+
307
+ invalidateAll(): void {
308
+ this.cacheVersion++;
309
+ // Old keys automatically become orphaned
310
+ }
311
+
312
+ // Content-hash invalidation
313
+ async setWithContentHash(
314
+ key: string,
315
+ response: string,
316
+ sourceContent: string
317
+ ): Promise<void> {
318
+ const contentHash = this.hash(sourceContent);
319
+ await this.cache.set(key, {
320
+ response,
321
+ contentHash,
322
+ timestamp: Date.now()
323
+ });
324
+ }
325
+
326
+ async getIfValid(
327
+ key: string,
328
+ currentSourceContent: string
329
+ ): Promise<string | null> {
330
+ const cached = await this.cache.get(key);
331
+ if (!cached) return null;
332
+
333
+ // Check if source content changed
334
+ const currentHash = this.hash(currentSourceContent);
335
+ if (cached.contentHash !== currentHash) {
336
+ await this.cache.delete(key);
337
+ return null;
338
+ }
339
+
340
+ return cached.response;
341
+ }
342
+
343
+ // Event-based invalidation
344
+ onSourceUpdate(sourceId: string): void {
345
+ // Invalidate all caches that used this source
346
+ this.invalidateByTag(`source:${sourceId}`);
347
+ }
348
+ }
349
+
350
+ ### Prompt caching doesn't work due to prefix changes
351
+
352
+ Severity: MEDIUM
353
+
354
+ Situation: Cache misses despite similar prompts
355
+
356
+ Symptoms:
357
+ - Cache hit rate lower than expected
358
+ - Cache creation tokens high, read low
359
+ - Similar prompts not hitting cache
360
+
361
+ Why this breaks:
362
+ Anthropic caching requires exact prefix match.
363
+ Timestamps or dynamic content in prefix.
364
+ Different message order.
365
+
366
+ Recommended fix:
367
+
368
+ // Structure prompts for optimal caching
369
+
370
+ class CacheOptimizedPrompts {
371
+ // WRONG: Dynamic content in cached prefix
372
+ buildPromptBad(query: string): SystemMessage[] {
373
+ return [
374
+ {
375
+ type: "text",
376
+ text: `You are helpful. Current time: ${new Date()}`, // BREAKS CACHE!
377
+ cache_control: { type: "ephemeral" }
378
+ }
379
+ ];
380
+ }
381
+
382
+ // RIGHT: Static prefix, dynamic at end
383
+ buildPromptGood(query: string): SystemMessage[] {
384
+ return [
385
+ {
386
+ type: "text",
387
+ text: STATIC_SYSTEM_PROMPT, // Never changes
388
+ cache_control: { type: "ephemeral" }
389
+ },
390
+ {
391
+ type: "text",
392
+ text: STATIC_KNOWLEDGE_BASE, // Rarely changes
393
+ cache_control: { type: "ephemeral" }
394
+ }
395
+ // Dynamic content goes in messages, NOT system
396
+ ];
397
+ }
398
+
399
+ // Prefix ordering matters
400
+ buildWithConsistentOrder(components: string[]): SystemMessage[] {
401
+ // Sort components for consistent ordering
402
+ const sorted = [...components].sort();
403
+ return sorted.map((c, i) => ({
404
+ type: "text",
405
+ text: c,
406
+ cache_control: i === sorted.length - 1
407
+ ? { type: "ephemeral" }
408
+ : undefined // Only cache the full prefix
409
+ }));
410
+ }
411
+ }
412
+
413
+ ## Validation Checks
414
+
415
+ ### Caching High Temperature Responses
416
+
417
+ Severity: WARNING
418
+
419
+ Message: Caching with high temperature. Responses are non-deterministic.
420
+
421
+ Fix action: Only cache responses with temperature <= 0.5
422
+
423
+ ### Cache Without TTL
424
+
425
+ Severity: WARNING
426
+
427
+ Message: Cache without TTL. May serve stale data indefinitely.
428
+
429
+ Fix action: Set appropriate TTL based on data freshness requirements
430
+
431
+ ### Dynamic Content in Cached Prefix
432
+
433
+ Severity: WARNING
434
+
435
+ Message: Dynamic content in cached prefix. Will cause cache misses.
436
+
437
+ Fix action: Move dynamic content outside of cache_control blocks
438
+
439
+ ### No Cache Metrics
440
+
441
+ Severity: INFO
442
+
443
+ Message: Cache without hit/miss tracking. Can't measure effectiveness.
444
+
445
+ Fix action: Add cache hit/miss metrics and logging
446
+
447
+ ## Collaboration
448
+
449
+ ### Delegation Triggers
450
+
451
+ - context window|token -> context-window-management (Need context optimization)
452
+ - rag|retrieval -> rag-implementation (Need retrieval system)
453
+ - memory -> conversation-memory (Need memory persistence)
454
+
455
+ ### High-Performance LLM System
456
+
457
+ Skills: prompt-caching, context-window-management, rag-implementation
458
+
459
+ Workflow:
460
+
461
+ ```
462
+ 1. Analyze query patterns
463
+ 2. Implement prompt caching for stable prefixes
464
+ 3. Add response caching for frequent queries
465
+ 4. Consider CAG for stable document sets
466
+ 5. Monitor and optimize hit rates
467
+ ```
60
468
 
61
469
  ## Related Skills
62
470
 
63
471
  Works well with: `context-window-management`, `rag-implementation`, `conversation-memory`
64
472
 
65
473
  ## When to Use
66
- This skill is applicable to execute the workflow or actions described in the overview.
474
+
475
+ - User mentions or implies: prompt caching
476
+ - User mentions or implies: cache prompt
477
+ - User mentions or implies: response cache
478
+ - User mentions or implies: cag
479
+ - User mentions or implies: cache augmented