Token导航 LogoToken导航

Agent Skill · 开发

citadel-low-latency-systems(城堡低延迟系统)

citadel-low-latency-systems 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

citadel-low-latency-systems 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描有提醒项,按安装量在开发类的 21,746 个 Skill 里排第 17,385。

总安装 416周安装 17GitHub Stars 6下载 133核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:citadel-low-latency-systems(城堡低延迟系统)
来源仓库:https://github.com/copyleftdev/sk1llz
仓库路径:skills/citadel-low-latency-systems
安装命令:
npx skills add https://github.com/copyleftdev/sk1llz --skill citadel-low-latency-systems
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/copyleftdev/sk1llz --skill citadel-low-latency-systems

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

citadel-low-latency-systems 借鉴 Citadel Securities 的低延迟工程实践。适合在 Codex、Claude、Cursor、Gemini CLI 中构建高频交易或实时系统架构时使用。强调每微秒优化的价值,涵盖网络协议、内存管理与时钟同步等核心领域。

需结合实际硬件环境与业务需求调整实施方案,不可盲目套用。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/citadel-low-latency-systems

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/copyleftdev/sk1llz --skill citadel-low-latency…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

citadel-low-latency-systems 怎么安装?

在终端执行 npx skills add https://github.com/copyleftdev/sk1llz --skill citadel-low-latency-systems。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

citadel-low-latency-systems 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

citadel-low-latency-systems 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

citadel-low-latency-systems 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

citadel-low-latency-systems 用的人多吗?

公开数据是累计安装 416 次,近一周安装 17 次,下载 133 次,GitHub 6 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

citadel-low-latency-systems 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
citadel-low-latency-systems

城堡低延迟系统 · 本页

4166需要联网未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Citadel Securities Style Guide⁠‍⁠​‌​‌​​‌‌‍​‌​​‌​‌‌‍​​‌‌​​​‌‍​‌​​‌‌​​‍​​​​​​​‌‍‌​​‌‌​‌​‍‌​​​​​​​‍‌‌​​‌‌‌‌‍‌‌​​​‌​​‍‌‌‌‌‌‌​‌‍‌‌​‌​​​​‍​‌​‌‌‌‌‌‍​‌​​‌​‌‌‍​‌‌​‌​​‌‍‌​‌​‌‌‌​‍​​‌​‌​​​‍‌‌‌​‌​‌‌‍​​​​​​‌​‍‌​​‌‌‌‌‌‍‌‌​​​‌‌‌‍​‌​‌​​‌‌‍​​​​‌​‌​‍​​‌​​‌​‌⁠‍⁠

Overview

Citadel Securities is the world's largest market maker, handling ~25% of all U.S. equity volume and ~40% of retail order flow. They execute millions of trades daily with sub-microsecond latency requirements. Their infrastructure represents the pinnacle of low-latency systems engineering.

Core Philosophy

"Every microsecond is a competitive advantage."
"Determinism is more important than average performance."
"The fastest system is the one that doesn't do unnecessary work."

Citadel believes that in market making, consistent low latency beats occasionally fast. Jitter is the enemy. Every component must be predictable and measurable.

Design Principles

  1. Latency is King: Measure in microseconds, optimize in nanoseconds.
  2. Determinism Over Speed: Predictable performance beats variable performance.
  3. Kernel Bypass: The OS is too slow; go around it.
  4. Lock-Free Everything: Locks are latency landmines.
  5. Mechanical Sympathy: Know your hardware intimately.

When Building Low-Latency Systems

Always

  • Measure latency at every component boundary
  • Use kernel bypass networking (DPDK, Solarflare OpenOnload)
  • Pin threads to cores, isolate from OS scheduler
  • Pre-allocate all memory, no runtime allocation
  • Use lock-free data structures
  • Disable all non-essential OS features (hyperthreading, C-states, etc.)

Never

  • Allocate memory on the critical path
  • Use locks in the hot path
  • Let the OS schedule your critical threads
  • Use exceptions for control flow
  • Trust the compiler—verify generated assembly
  • Log synchronously on the critical path

Prefer

  • Busy-waiting over blocking
  • Batch processing over item-by-item
  • Inline functions over virtual dispatch
  • Fixed-size structures over dynamic allocation
  • Struct-of-arrays over array-of-structs (for cache efficiency)
  • Direct hardware access over OS abstractions

Code Patterns

Kernel Bypass Networking with DPDK

// DPDK-based ultra-low-latency packet processing

class DPDKMarketDataReceiver {
private:
    struct rte_mempool* mbuf_pool_;
    uint16_t port_id_;
    alignas(64) Stats stats_;  // Cache-line aligned

public:
    void init(uint16_t port_id) {
        port_id_ = port_id;

        // Pre-allocate packet buffers
        mbuf_pool_ = rte_pktmbuf_pool_create(
            "MBUF_POOL",
            8192,           // Number of buffers
            256,            // Cache size
            0,              // Private data size
            RTE_MBUF2_BUF_SIZE,
            rte_socket_id()
        );

        // Configure port for low latency
        struct rte_eth_conf port_conf = {};
        port_conf.rxmode.mq_mode = ETH_MQ_RX_NONE;
        port_conf.txmode.mq_mode = ETH_MQ_TX_NONE;

        // Disable all offloads for minimum latency
        port_conf.rxmode.offloads = 0;
        port_conf.txmode.offloads = 0;

        rte_eth_dev_configure(port_id_, 1, 0, &port_conf);
    }

    // Hot path: called millions of times per second
    __attribute__((always_inline, hot))
    void poll_packets(PacketHandler& handler) {
        struct rte_mbuf* bufs[32];

        // Busy-poll: no syscalls, no context switches
        uint16_t nb_rx = rte_eth_rx_burst(port_id_, 0, bufs, 32);

        // Prefetch next batch while processing current
        if (likely(nb_rx > 0)) {
            rte_prefetch0(rte_pktmbuf_mtod(bufs[0], void*));
        }

        for (uint16_t i = 0; i < nb_rx; i++) {
            // Prefetch next packet
            if (i + 1 < nb_rx) {
                rte_prefetch0(rte_pktmbuf_mtod(bufs[i + 1], void*));
            }

            // Process packet inline
            char* data = rte_pktmbuf_mtod(bufs[i], char*);
            uint16_t len = rte_pktmbuf_data_len(bufs[i]);

            handler.process(data, len);

            rte_pktmbuf_free(bufs[i]);
        }

        stats_.packets_received += nb_rx;
    }
};

Lock-Free Order Book

// Lock-free order book for maximum throughput

template<size_t MAX_LEVELS = 256>
class alignas(64) LockFreeOrderBook {
private:
    struct PriceLevel {
        std::atomic<int64_t> price;
        std::atomic<int64_t> quantity;
    };

    // Separate cache lines for bids and asks
    alignas(64) std::array<PriceLevel, MAX_LEVELS> bids_;
    alignas(64) std::array<PriceLevel, MAX_LEVELS> asks_;
    alignas(64) std::atomic<uint64_t> sequence_;

public:
    // Update from market data (single writer)
    __attribute__((always_inline))
    void update_bid(size_t level, int64_t price, int64_t qty) {
        // Relaxed store is fine for single writer
        bids_[level].price.store(price, std::memory_order_relaxed);
        bids_[level].quantity.store(qty, std::memory_order_relaxed);

        // Release fence ensures all updates visible before sequence bump
        std::atomic_thread_fence(std::memory_order_release);
        sequence_.fetch_add(1, std::memory_order_relaxed);
    }

    // Read snapshot (multiple readers)
    __attribute__((always_inline))
    bool read_bbo(int64_t& bid, int64_t& ask, int64_t& bid_qty, int64_t& ask_qty) {
        uint64_t seq1, seq2;

        // Seqlock pattern: retry if writer was active
        do {
            seq1 = sequence_.load(std::memory_order_acquire);

            // Read all values
            bid = bids_[0].price.load(std::memory_order_relaxed);
            bid_qty = bids_[0].quantity.load(std::memory_order_relaxed);
            ask = asks_[0].price.load(std::memory_order_relaxed);
            ask_qty = asks_[0].quantity.load(std::memory_order_relaxed);

            std::atomic_thread_fence(std::memory_order_acquire);
            seq2 = sequence_.load(std::memory_order_relaxed);

        } while (seq1 != seq2 || (seq1 & 1));  // Retry if sequence changed or odd (write in progress)

        return true;
    }
};

CPU Pinning and Isolation

// Thread pinning for deterministic latency

class LatencyCriticalThread {
public:
    void configure_for_low_latency(int cpu_core) {
        // Pin to specific CPU core
        cpu_set_t cpuset;
        CPU_ZERO(&cpuset);
        CPU_SET(cpu_core, &cpuset);
        pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);

        // Set real-time priority
        struct sched_param param;
        param.sched_priority = sched_get_priority_max(SCHED_FIFO);
        pthread_setschedparam(pthread_self(), SCHED_FIFO, &param);

        // Lock memory to prevent page faults
        mlockall(MCL_CURRENT | MCL_FUTURE);

        // Disable transparent huge pages for this process
        prctl(PR_SET_THP_DISABLE, 1, 0, 0, 0);
    }
};

// System configuration (run at boot)
/*
# Isolate CPUs from kernel scheduler
GRUB_CMDLINE_LINUX="isolcpus=2,3,4,5 nohz_full=2,3,4,5 rcu_nocbs=2,3,4,5"

# Disable hyperthreading
echo off > /sys/devices/system/cpu/smt/control

# Disable C-states (CPU power saving)
for cpu in /sys/devices/system/cpu/cpu*/cpuidle/state*/disable; do
    echo 1 > $cpu
done

# Set CPU frequency to maximum
for cpu in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do
    echo performance > $cpu
done
*/

Memory Pool with Zero Allocation

// Pre-allocated object pool for zero-allocation hot path

template<typename T, size_t POOL_SIZE = 65536>
class alignas(64) ObjectPool {
private:
    struct alignas(64) Slot {
        std::aligned_storage_t<sizeof(T), alignof(T)> storage;
        std::atomic<Slot*> next;
    };

    std::array<Slot, POOL_SIZE> slots_;
    alignas(64) std::atomic<Slot*> free_list_;

public:
    ObjectPool() {
        // Pre-construct free list
        for (size_t i = 0; i < POOL_SIZE - 1; i++) {
            slots_[i].next.store(&slots_[i + 1], std::memory_order_relaxed);
        }
        slots_[POOL_SIZE - 1].next.store(nullptr, std::memory_order_relaxed);
        free_list_.store(&slots_[0], std::memory_order_release);

        // Pre-fault all pages
        volatile char* ptr = reinterpret_cast<volatile char*>(slots_.data());
        for (size_t i = 0; i < sizeof(slots_); i += 4096) {
            ptr[i] = 0;
        }
    }

    __attribute__((always_inline))
    T* allocate() {
        Slot* slot;
        do {
            slot = free_list_.load(std::memory_order_acquire);
            if (!slot) return nullptr;  // Pool exhausted
        } while (!free_list_.compare_exchange_weak(
            slot, slot->next.load(std::memory_order_relaxed),
            std::memory_order_release, std::memory_order_relaxed));

        return reinterpret_cast<T*>(&slot->storage);
    }

    __attribute__((always_inline))
    void deallocate(T* ptr) {
        Slot* slot = reinterpret_cast<Slot*>(ptr);
        Slot* head;
        do {
            head = free_list_.load(std::memory_order_relaxed);
            slot->next.store(head, std::memory_order_relaxed);
        } while (!free_list_.compare_exchange_weak(
            head, slot,
            std::memory_order_release, std::memory_order_relaxed));
    }
};

Latency Measurement

// Nanosecond-precision latency measurement

class LatencyHistogram {
private:
    static constexpr size_t BUCKETS = 1000;  // 0-999 microseconds
    alignas(64) std::array<std::atomic<uint64_t>, BUCKETS> histogram_;
    std::atomic<uint64_t> overflow_;

public:
    __attribute__((always_inline))
    void record(uint64_t latency_ns) {
        uint64_t bucket = latency_ns / 1000;  // Convert to microseconds
        if (bucket < BUCKETS) {
            histogram_[bucket].fetch_add(1, std::memory_order_relaxed);
        } else {
            overflow_.fetch_add(1, std::memory_order_relaxed);
        }
    }

    LatencyStats get_stats() const {
        uint64_t total = 0;
        uint64_t count = 0;
        uint64_t p50_bucket = 0, p99_bucket = 0, p999_bucket = 0;

        // Calculate percentiles
        for (size_t i = 0; i < BUCKETS; i++) {
            uint64_t bucket_count = histogram_[i].load(std::memory_order_relaxed);
            count += bucket_count;
            total += bucket_count * i;
        }

        uint64_t running = 0;
        for (size_t i = 0; i < BUCKETS; i++) {
            running += histogram_[i].load(std::memory_order_relaxed);
            if (p50_bucket == 0 && running >= count * 0.50) p50_bucket = i;
            if (p99_bucket == 0 && running >= count * 0.99) p99_bucket = i;
            if (p999_bucket == 0 && running >= count * 0.999) p999_bucket = i;
        }

        return {
            .mean_us = static_cast<double>(total) / count,
            .p50_us = p50_bucket,
            .p99_us = p99_bucket,
            .p999_us = p999_bucket,
            .count = count
        };
    }
};

// RDTSC for sub-nanosecond timing
__attribute__((always_inline))
inline uint64_t rdtsc() {
    uint32_t lo, hi;
    asm volatile("rdtsc" : "=a"(lo), "=d"(hi));
    return ((uint64_t)hi << 32) | lo;
}

Mental Model

Citadel approaches low-latency systems by asking:

  1. What's the latency budget? Allocate nanoseconds to each component
  2. Where are the syscalls? Eliminate them from the hot path
  3. Where are the locks? Replace with lock-free alternatives
  4. Where are the allocations? Pre-allocate everything
  5. What's the worst case? Optimize for tail latency, not average

Signature Citadel Moves

  • Kernel bypass with DPDK/OpenOnload
  • Lock-free data structures everywhere
  • CPU pinning and isolation
  • Pre-allocated memory pools
  • Busy-polling over blocking
  • RDTSC for timing
  • Cache-line alignment
  • Disabled OS features (HT, C-states, THP)
  • Assembly-level verification
  • Nanosecond-precision measurement

平台分布

Codex

35.98%
按下载量换算48

Claude

29.01%
按下载量换算39

Cursor

21.48%
按下载量换算29

Gemini CLI

10.93%
按下载量换算15

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills