Communitygithub.com

延遲關鍵系統

適用於延遲敏感的系統,例如即時儀表板、市場數據、串流代理、執行閘道、佇列、快取,或類似 HFT 的基礎設施。當 p95 延遲或數據新鮮度至關重要時使用。

延遲關鍵系統 是什麼?

此技能專為需要即時行為、熱路徑最佳化、串流新鮮度或執行速度的工程師設計。它專注於工程層面的延遲關鍵系統,涵蓋從 HFT 類似基礎設施到一般即時應用的場景。通過將延遲指標拆分為 p50、p95、p99、吞吐量、新鮮期限等,並明確映射從源事件到最終用戶狀態的熱路徑,幫助團隊精確定位瓶頸。支援的優化策略包括減少往返次數、快取穩定讀取、批量操作、將計算靠近數據或用戶端、分離熱冷路徑,以及應用背壓機制。驗證方面強調使用實際 HTTP 時序、供應商新鮮度時間戳、快取狀態、瀏覽器渲染檢查與日誌分析。安全護欄嚴格禁止以犧牲驗證或隱藏過期數據來換取速度,也禁止未經審批執行實際交易或破壞性部署。本技能適用於 Claude Code、Cursor 等 AI 代理工具,協助工程師在設計與除錯即時系統時做出合理權衡。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/latency-critical-systems

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

延遲關鍵系統 是做什麼的?

當使用者關心即時行為、熱路徑、串流新鮮度或執行速度時,請使用此技能。這包括類似 HFT 的基礎設施,但此技能專注於工程層面。它不會授權進行即時交易或提供財務建議。

拆分指標

不要把所有東西都歸結為「快」。應追蹤:

  • p50、p95 和 p99 延遲;
  • 吞吐量;
  • 新鮮期限;
  • 佇列深度;
  • 快取命中率;
  • 供應商/API 回應時間;
  • 瀏覽器渲染時間;
  • 負載下的正確性;
  • 失敗與重試行為。

繪製熱路徑

寫下從使用者/事件到最終可見狀態的路徑:

源事件 -> 供應商 API -> 攝取工作者 -> 佇列 -> 快取 -> 邊緣路由
-> 客戶端串流 -> 瀏覽器渲染 -> 使用者可見狀態

然後分別測量每個區段。

優化順序

  1. 移除不必要的往返。
  2. 使用新鮮度元數據快取穩定讀取。
  3. 批量處理小量呼叫與寫入。
  4. 將計算移至更靠近數據或使用者的位置。
  5. 分離熱路徑與冷路徑。
  6. 在佇列無限制增長之前應用背壓。
  7. 僅在能夠改善新鮮度或使用者體驗時使用串流。
  8. 為過期數據、降級供應商與錯誤快取狀態添加金絲雀檢查。

驗證

當存在已部署的表面時,使用即時回讀:

  • HTTP 時序與回應標頭;
  • 供應商新鮮度時間戳;
  • 佇列或任務狀態;
  • 邊緣/快取狀態;
  • 瀏覽器驗證以確保實際 UI 新鮮度;
  • 圍繞重試與降級模式的日誌。

對於市場數據或與執行相鄰的路徑,在宣告路徑就緒之前,還需驗證訂單簿期限、VWAP 假設、供應商狀態以及終止開關行為。

安全護欄

  • 不要為了最佳化延遲而省略必要的驗證。
  • 不要將過期數據隱藏在快速快取命中之後。
  • 在沒有測量的情況下,不要僅憑客戶端標籤就聲稱達到毫秒級行為。
  • 未經明確的審批關卡,不要執行即時訂單、破壞性遷移或影響客戶的部署。
  • 將機密和私有負載排除在日誌和基準測試工件之外。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

相關技能