用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/diegosouzapw/awesome-omni-skill --skill koan-performance命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Token-efficient tracking for AI orchestration. CLI-first for status updates (~50 tokens), agent fallback for complex ops (~1KB). Use when: updating task status, querying blockers, creating progress files, validating phases.
AshAi extension guidelines for integrating AI capabilities with Ash Framework. Use when implementing vectorization/embeddings, exposing Ash actions as LLM tools, creating prompt-backed actions, or setting up MCP servers. Covers semantic search, LangChain integration, and structured outputs.
This skill should be used when solving hard questions, complex architectural problems, or debugging issues that benefit from GPT-5 Pro or GPT-5.1 thinking models with large file context. Use when standard Claude analysis needs deeper reasoning or extended context windows.
基于 SOC 职业分类
正在显示 SKILL.md
| name | koan-performance |
| description | Streaming, pagination, count strategies, bulk operations |
Optimize for scale from day one. Use streaming for large datasets, batch operations for bulk changes, fast counts for UI, and pagination for web APIs.
// ❌ WRONG: Load everything into memory
var allTodos = await Todo.All(); // 1 million records!
// ✅ CORRECT: Stream in batches
await foreach (var todo in Todo.AllStream(batchSize: 1000))
{
await ProcessTodo(todo);
}
// Fast count (metadata estimate - 1000x+ faster)
var fast = await Todo.Count.Fast(ct); // ~5ms for 10M rows
// Exact count (guaranteed accuracy)
var exact = await Todo.Count.Exact(ct); // ~25s for 10M rows
// Optimized (framework chooses)
var optimized = await Todo.Count; // Uses Fast if available
Use Fast for: Pagination UI, dashboards, estimates Use Exact for: Critical business logic, reports, inventory
// Bulk create
var todos = Enumerable.Range(1, 1000)
.Select(i => new Todo { Title = $"Task {i}" })
.ToList();
await todos.Save(); // Single operation
// Bulk removal
await Todo.RemoveAll(RemoveStrategy.Fast); // TRUNCATE/DROP (225x faster)
// ❌ WRONG: N queries
foreach (var id in ids)
{
var todo = await Todo.Get(id);
}
// ✅ CORRECT: 1 query
var todos = await Todo.Get(ids);
public async Task<IActionResult> GetTodos(
int page = 1,
int pageSize = 20,
CancellationToken ct = default)
{
var result = await Todo.QueryWithCount(
t => !t.Completed,
new DataQueryOptions { OrderBy = nameof(Todo.Created), Descending = true },
ct);
Response.Headers["X-Total-Count"] = result.TotalCount.ToString();
return Ok(result.Items);
}
| Operation | Inefficient | Efficient | Speedup |
|---|---|---|---|
| Bulk Remove (1M) | DELETE loop ~45s | TRUNCATE ~200ms | 225x |
| Count (10M) | Full scan ~25s | Metadata ~5ms | 5000x |
| Batch Get (100) | 100 queries | 1 query | 100x |
| Stream (1M) | Load all (OOM) | Stream batches | Memory safe |
.claude/skills/entity-first/examples/batch-operations.csdocs/guides/performance.mdsamples/S14.AdapterBench/ (Performance benchmarks)