[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6NXYGXV9DA0TTZNTCTRE707":3,"skill-same:01M6NXYGXV9DA0TTZNTCTRE707":107},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":27,"publishedAt":48,"linkOnly":49,"markdownContent":50,"markdownBody":51,"frontMatter":52,"refName":37,"commitSha":66,"skillDirectory":67,"forksCount":13,"repositoryHtmlUrl":68,"repositoryHomepageUrl":6,"ownerHtmlUrl":69,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":70,"install":71,"resources":84},"01M6NXYGXV9DA0TTZNTCTRE707","boost-asio-pro",null,"Use when writing asynchronous C++ networking code with Boost.Asio or standalone Asio — TCP\u002FUDP servers and clients, SSL\u002FTLS, timers, strands, composed async ops. Covers io_context, co_spawn, awaitable, async_read\u002Fasync_write, asio::spawn, yield_context, and pre-C++20 callback styles.","duc-duy-1612\u002FOnline-Delivery-Systems-Web","duc-duy-1612","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F192231384?v=4","01M6NSDKQQDKVTHZ8DZMZ1VYY6","01M6NSDKW8DDVTQHBT1HBDDJPT",0,"MIT","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fboost-asio-pro\u002FSKILL.md",[17,22],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000018","写作与文案","SCENARIO","使用场景",{"categoryNo":23,"categoryName":24,"taxonomyType":25,"taxonomyTypeDesc":26},"01JBSEEDCAT000000000000036","内容创作者","PROFESSION","适用职业",[28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],"asio","boost","pro","boost asio pro","spawn","standalone","strands","co","io","main","community","writing","write","read","tls","asynchronous","tcp","code","cpp","safe","2026-11-10 10:12:30",false,"---\nname: boost-asio-pro\ndescription: \"Use when writing asynchronous C++ networking code with Boost.Asio or standalone Asio — TCP\u002FUDP servers and clients, SSL\u002FTLS, timers, strands, composed async ops. Covers io_context, co_spawn, awaitable, async_read\u002Fasync_write, asio::spawn, yield_context, and pre-C++20 callback styles.\"\ncategory: development\nrisk: safe\nsource: community\nsource_repo: alexprivalov\u002Fboost-asio-skill\nsource_type: community\ndate_added: \"2026-08-18\"\nauthor: alexprivalov\ntags: [cpp, boost, asio, async, networking, coroutines]\ntools: [claude, cursor, gemini]\nlicense: \"MIT\"\nlicense_source: \"https:\u002F\u002Fgithub.com\u002Falexprivalov\u002Fboost-asio-skill\u002Fblob\u002Fmain\u002FLICENSE\"\n---\n\n# Boost.Asio \u002F standalone Asio\n\n## Overview\n\nWrite async C++ networking code that compiles on the *user's* Boost, not the newest one. Asio's API changed shape three times (classic `io_service` → `io_context` → C++20 coroutines) and most Asio code on the internet is from the first era, so **pick the style from the toolchain first**, then follow that style's reference file.\n\n**References:** [Boost.Asio](https:\u002F\u002Fwww.boost.org\u002Fdoc\u002Flibs\u002Flatest\u002Fdoc\u002Fhtml\u002Fboost_asio.html) · [standalone Asio](https:\u002F\u002Fthink-async.com\u002FAsio\u002F)\n\nAsio's API changed shape three times, so the same task has three correct answers depending on the Boost version in front of you. This skill makes the agent establish that version first, then apply the rules that are genuinely easy to get wrong — strand versus write serialization, buffer and connection lifetime, composed reads for framing — and finally check its own output against a list before calling it done.\n\n## When to Use This Skill\n\n- Use when writing or reviewing async C++ networking code with Boost.Asio or standalone Asio: TCP\u002FUDP servers and clients, SSL\u002FTLS streams, timers, resolvers.\n- Use when the code involves `io_context`, `io_service`, `co_spawn`, `awaitable`, `async_read`, `async_write`, `strand`, `asio::spawn`, `yield_context`, or completion-handler callbacks.\n- Use when the target toolchain is old: an older Boost or a pre-C++20 standard, where coroutine examples will not compile.\n- Use when async code compiles but misbehaves: interleaved writes, dangling buffers, sockets closing early, `operation_aborted` treated as an error.\n\n## Step 1: pick the style (do this before writing code)\n\nDetermine the Boost (or Asio) version and the C++ standard actually in use — `find_package(Boost)` output, `dpkg -l libboost-dev`, `brew info boost`, `CMAKE_CXX_STANDARD`, or ask. Do not assume the newest.\n\n| Boost | C++ std | Style | Read |\n|-------|---------|-------|------|\n| ≥ 1.77 | C++20 | Coroutines (`co_await` + `awaitable\u003CT>`) — preferred | [references\u002Fcoroutines.md](references\u002Fcoroutines.md) |\n| ≥ 1.74 | C++11–17 | Completion handlers (callbacks) — the portable baseline | [references\u002Fpre-cpp20.md](references\u002Fpre-cpp20.md) |\n| ≥ 1.80 | C++11–17 | Stackful `asio::spawn` + `yield_context` (links Boost.Coroutine — not header-only) | [references\u002Fpre-cpp20.md](references\u002Fpre-cpp20.md) |\n| 1.62–1.65 | C++11 | Classic `io_service` \u002F `strand.wrap` \u002F `expires_from_now` | [references\u002Fclassic-boost.md](references\u002Fclassic-boost.md) |\n\nSSL\u002FTLS in any style: [references\u002Fssl.md](references\u002Fssl.md). CMake for any style: [references\u002Fbuild.md](references\u002Fbuild.md).\n\n`io_context`, `make_strand`, `bind_executor`, `steady_timer`, `signal_set`, `async_read`\u002F`async_write`\u002F`async_read_until`, buffers and `resolver` are **library** features — identical in the coroutine and callback styles. Only the suspension mechanism differs.\n\n## Step 2: version floors (verified by compiling, not from docs)\n\nReach for one of these and the build breaks on older distros:\n\n| Feature | Floor |\n|---------|-------|\n| `experimental\u002Fawaitable_operators.hpp` (the `\\|\\|` \u002F `&&` operators) | **Boost ≥ 1.77** \u002F Asio ≥ 1.20 |\n| `as_tuple` completion token | **Boost ≥ 1.79** \u002F Asio ≥ 1.21 |\n| `co_composed` (custom composed ops) | **Boost ≥ 1.85** \u002F Asio ≥ 1.30 |\n| 3-arg `asio::spawn(ex, fn, token)` | **Boost ≥ 1.80** (older Boost has only `spawn(ex, fn)`) |\n| `any_io_executor` (`strand\u003Cany_io_executor>`, `tcp::socket`'s default executor) | **Boost ≥ 1.74** — the floor for the callback style; below it, use legacy `io_context::strand` |\n| `io_context`, `make_strand`, `expires_after` | **Boost ≥ 1.66** — below it, classic `io_service` |\n\nDistro floors that bite: **Debian bookworm ships Boost 1.74** (no `awaitable_operators.hpp` — `#include` fails outright), Ubuntu 20.04 ships 1.71 (no `any_io_executor`), Debian 9 ships 1.62.\n\nLanguage, not library: the chrono literals `250ms` \u002F `30s` are **C++14**. For a true C++11 build write `std::chrono::milliseconds(250)`.\n\n## Step 3: the rules that are actually easy to get wrong\n\n**A strand does not serialize writes.** A strand serializes handler *execution*, not whole composed operations. Two `async_write`s in flight on the same strand still **interleave bytes on the wire**. Full-duplex (a read loop plus concurrent pushes\u002Freplies) needs a per-connection strand **and** an outbound queue with an in-flight flag, so at most one `async_write` exists at a time. This is the single most common wrong answer about Asio.\n\n**Buffers do not own memory.** `asio::buffer()` is a view. Storage must outlive the operation: coroutine locals are fine across `co_await` in the same frame; in callback style the same data must become a **member**, not a local.\n\n**Connections must outlive their handlers.** `enable_shared_from_this`, and capture `self` in *every* `co_spawn` \u002F handler — read loop, write loop, and each timer.\n\n**Frame with composed reads.** `async_read` (fills the buffer exactly) for a length prefix and then the body; never `async_read_some`, which returns short.\n\n**Wrap `as_tuple`.** Always `as_tuple(use_awaitable)`. Bare `as_tuple` resolves against the operation's default token and compiles in some contexts, fails in others.\n\n**`async_accept(make_strand(...))` changes two things**: it forces an explicit completion token back on the call, and the accepted socket is `basic_stream_socket\u003Ctcp, strand\u003C...>>`, not `tcp::socket`. Take it **by value** or with `auto` — binding it to `tcp::socket&` will not compile.\n\n**Re-arming a timer resolves the pending wait with `operation_aborted`.** In an idle-timeout loop that is the signal to keep waiting, not an error.\n\n**GCC needs `-fcoroutines`** for the C++20 style, and header-only Boost needs `BOOST_ERROR_CODE_HEADER_ONLY` defined in exactly one place (CMake).\n\n## Common mistakes\n\n| Mistake | Fix |\n|---------|-----|\n| Buffer dangling (local goes out of scope during async op) | Ensure buffer lifetime ≥ operation lifetime; coroutine locals or members, not callback locals |\n| Forgetting `io.run()` | No handlers dispatch without `run()` \u002F `run_one()` |\n| Concurrent socket access without strand | Wrap in `strand\u003C>` or serialize via one coroutine chain |\n| Assuming a strand prevents interleaved writes | Add a write queue — see Step 3 |\n| Using `use_awaitable` where `deferred` suffices | Omit the token (default is `deferred`) unless using `\\|\\|` \u002F `&&` |\n| Ignoring short reads\u002Fwrites | Use composed `async_read` \u002F `async_write` \u002F `async_read_until`, not `async_read_some` |\n| Not setting `reuse_address` on the acceptor | Set before `bind`\u002F`listen` or restarts hit \"address in use\" |\n| SSL operations without a strand | *All* `ssl::stream` ops need strand synchronization |\n| Blocking inside a handler | Never block in a completion handler |\n| Accepting a socket with the wrong executor type | See `async_accept(make_strand(...))` in Step 3 |\n| Requiring the `Boost::system` component | Header-only since 1.74: `Boost::headers` + `BOOST_ERROR_CODE_HEADER_ONLY`. Only classic (pre-1.66) needs the link |\n| Missing `-fcoroutines` on GCC | Build fails — add `$\u003C$\u003CCXX_COMPILER_ID:GNU>:-fcoroutines>` |\n| Writing coroutine code for a Boost that predates it | Do Step 1 first |\n\n## Boost.Asio vs standalone Asio\n\nSame author, same API — namespace and includes differ.\n\n| Aspect | Boost.Asio | Standalone Asio |\n|--------|-----------|-----------------|\n| Namespace \u002F include | `boost::asio` \u002F `\u003Cboost\u002Fasio.hpp>` | `asio` \u002F `\u003Casio.hpp>` |\n| Error code | `boost::system::error_code` | `asio::error_code` (or `std::error_code`) |\n| Install (brew) | `brew install boost` | `brew install asio` |\n| CMake | `Boost::headers` | manual include path |\n| Version (2025) | 1.87–1.90 (with Boost) | 1.30–1.36 (independent) |\n| Macro prefix | `BOOST_ASIO_` | `ASIO_` |\n\nSupport both with a shim, then use `net::` throughout:\n```cpp\n#ifdef USE_STANDALONE_ASIO\n  #include \u003Casio.hpp>\n  namespace net = asio;\n  using error_code = asio::error_code;\n#else\n  #include \u003Cboost\u002Fasio.hpp>\n  namespace net = boost::asio;\n  using error_code = boost::system::error_code;\n#endif\nnamespace ssl = net::ssl;\nusing tcp = net::ip::tcp;\n```\n\n## Before you call it done\n\nCheck the code you just wrote against this list:\n\n- [ ] Style matches the target Boost version and C++ standard (Step 1), and every API used clears its floor (Step 2).\n- [ ] Every buffer passed to an async op outlives that op — no callback locals, no dangling `string_view`.\n- [ ] At most one `async_write` per socket in flight, enforced by a queue + flag, if anything writes concurrently with reading.\n- [ ] Every async chain on a shared object runs on the same strand; `self` captured in every handler and `co_spawn`.\n- [ ] Framing \u002F delimited reads use composed `async_read` \u002F `async_read_until`.\n- [ ] Errors are handled, not swallowed: `as_tuple(use_awaitable)` destructured, or the callback's `ec` checked, on every op.\n- [ ] `operation_aborted` distinguished from real errors wherever a timer is re-armed or an op is cancelled.\n- [ ] Acceptor sets `reuse_address`; shutdown path closes the acceptor and drains sessions.\n- [ ] CMake has the standard, `-fcoroutines` for GCC (C++20 only), `BOOST_ERROR_CODE_HEADER_ONLY` in one place, and `Boost::coroutine` only if using stackful `spawn`.\n- [ ] It compiles. Build it — most of the mistakes above are compile-time, and the version floors are only real once tested.\n\n## Worked examples\n\nThree CI-verified implementations of the same full-duplex framed-protocol server, one per style — copy from the one matching Step 1. Paths are relative to this skill directory; if only the skill was installed, they are at https:\u002F\u002Fgithub.com\u002Falexprivalov\u002Fboost-asio-skill\u002Ftree\u002Fmain\u002Fexamples.\n\n- `..\u002F..\u002Fexamples\u002Fmarket-data-feed\u002F` — C++20 coroutines (Boost 1.77+; verified 1.83–1.90)\n- `..\u002F..\u002Fexamples\u002Fmarket-data-feed-precpp20\u002F` — callbacks, C++11-clean (verified Boost 1.74+, incl. Windows\u002FMSVC)\n- `..\u002F..\u002Fexamples\u002Fmarket-data-feed-classic\u002F` — classic `io_service` (verified back to Boost 1.62 \u002F Debian 9)\n\n## Official documentation\n\n- Overview: https:\u002F\u002Fwww.boost.org\u002Fdoc\u002Flibs\u002Flatest\u002Fdoc\u002Fhtml\u002Fboost_asio\u002Foverview.html\n- Reference: https:\u002F\u002Fwww.boost.org\u002Fdoc\u002Flibs\u002Flatest\u002Fdoc\u002Fhtml\u002Fboost_asio\u002Freference.html\n- Examples: https:\u002F\u002Fwww.boost.org\u002Fdoc\u002Flibs\u002Flatest\u002Fdoc\u002Fhtml\u002Fboost_asio\u002Fexamples.html\n\n## Limitations\n\n- This skill does not replace compiling and testing against the target toolchain. The version floors it documents are only real once built — build the code.\n- It does not cover Boost.Beast (HTTP\u002FWebSocket), io_uring backends, or UDP multicast specifics.\n- Stop and ask when the Boost version and C++ standard cannot be determined; the style choice depends on them.\n\n## Security & Safety Notes\n\n- Read-only guidance: this skill contains no shell commands, network fetches, credentials, or mutation instructions. The commands it names (`dpkg -l libboost-dev`, `brew info boost`) are local version queries.\n- Networking code it produces accepts untrusted input. Validate length prefixes before allocating (`std::string body(n, 0)` with an attacker-controlled `n` is a memory-exhaustion vector — cap it), and verify peer certificates when using TLS rather than disabling verification to make a handshake pass.\n\n## Related Skills\n\n- `@cpp-pro` — general modern C++ idioms; this skill assumes them and adds the Asio-specific rules.\n","# Boost.Asio \u002F standalone Asio\n\n## Overview\n\nWrite async C++ networking code that compiles on the *user's* Boost, not the newest one. Asio's API changed shape three times (classic `io_service` → `io_context` → C++20 coroutines) and most Asio code on the internet is from the first era, so **pick the style from the toolchain first**, then follow that style's reference file.\n\n**References:** [Boost.Asio](https:\u002F\u002Fwww.boost.org\u002Fdoc\u002Flibs\u002Flatest\u002Fdoc\u002Fhtml\u002Fboost_asio.html) · [standalone Asio](https:\u002F\u002Fthink-async.com\u002FAsio\u002F)\n\nAsio's API changed shape three times, so the same task has three correct answers depending on the Boost version in front of you. This skill makes the agent establish that version first, then apply the rules that are genuinely easy to get wrong — strand versus write serialization, buffer and connection lifetime, composed reads for framing — and finally check its own output against a list before calling it done.\n\n## When to Use This Skill\n\n- Use when writing or reviewing async C++ networking code with Boost.Asio or standalone Asio: TCP\u002FUDP servers and clients, SSL\u002FTLS streams, timers, resolvers.\n- Use when the code involves `io_context`, `io_service`, `co_spawn`, `awaitable`, `async_read`, `async_write`, `strand`, `asio::spawn`, `yield_context`, or completion-handler callbacks.\n- Use when the target toolchain is old: an older Boost or a pre-C++20 standard, where coroutine examples will not compile.\n- Use when async code compiles but misbehaves: interleaved writes, dangling buffers, sockets closing early, `operation_aborted` treated as an error.\n\n## Step 1: pick the style (do this before writing code)\n\nDetermine the Boost (or Asio) version and the C++ standard actually in use — `find_package(Boost)` output, `dpkg -l libboost-dev`, `brew info boost`, `CMAKE_CXX_STANDARD`, or ask. Do not assume the newest.\n\n| Boost | C++ std | Style | Read |\n|-------|---------|-------|------|\n| ≥ 1.77 | C++20 | Coroutines (`co_await` + `awaitable\u003CT>`) — preferred | [references\u002Fcoroutines.md](references\u002Fcoroutines.md) |\n| ≥ 1.74 | C++11–17 | Completion handlers (callbacks) — the portable baseline | [references\u002Fpre-cpp20.md](references\u002Fpre-cpp20.md) |\n| ≥ 1.80 | C++11–17 | Stackful `asio::spawn` + `yield_context` (links Boost.Coroutine — not header-only) | [references\u002Fpre-cpp20.md](references\u002Fpre-cpp20.md) |\n| 1.62–1.65 | C++11 | Classic `io_service` \u002F `strand.wrap` \u002F `expires_from_now` | [references\u002Fclassic-boost.md](references\u002Fclassic-boost.md) |\n\nSSL\u002FTLS in any style: [references\u002Fssl.md](references\u002Fssl.md). CMake for any style: [references\u002Fbuild.md](references\u002Fbuild.md).\n\n`io_context`, `make_strand`, `bind_executor`, `steady_timer`, `signal_set`, `async_read`\u002F`async_write`\u002F`async_read_until`, buffers and `resolver` are **library** features — identical in the coroutine and callback styles. Only the suspension mechanism differs.\n\n## Step 2: version floors (verified by compiling, not from docs)\n\nReach for one of these and the build breaks on older distros:\n\n| Feature | Floor |\n|---------|-------|\n| `experimental\u002Fawaitable_operators.hpp` (the `\\|\\|` \u002F `&&` operators) | **Boost ≥ 1.77** \u002F Asio ≥ 1.20 |\n| `as_tuple` completion token | **Boost ≥ 1.79** \u002F Asio ≥ 1.21 |\n| `co_composed` (custom composed ops) | **Boost ≥ 1.85** \u002F Asio ≥ 1.30 |\n| 3-arg `asio::spawn(ex, fn, token)` | **Boost ≥ 1.80** (older Boost has only `spawn(ex, fn)`) |\n| `any_io_executor` (`strand\u003Cany_io_executor>`, `tcp::socket`'s default executor) | **Boost ≥ 1.74** — the floor for the callback style; below it, use legacy `io_context::strand` |\n| `io_context`, `make_strand`, `expires_after` | **Boost ≥ 1.66** — below it, classic `io_service` |\n\nDistro floors that bite: **Debian bookworm ships Boost 1.74** (no `awaitable_operators.hpp` — `#include` fails outright), Ubuntu 20.04 ships 1.71 (no `any_io_executor`), Debian 9 ships 1.62.\n\nLanguage, not library: the chrono literals `250ms` \u002F `30s` are **C++14**. For a true C++11 build write `std::chrono::milliseconds(250)`.\n\n## Step 3: the rules that are actually easy to get wrong\n\n**A strand does not serialize writes.** A strand serializes handler *execution*, not whole composed operations. Two `async_write`s in flight on the same strand still **interleave bytes on the wire**. Full-duplex (a read loop plus concurrent pushes\u002Freplies) needs a per-connection strand **and** an outbound queue with an in-flight flag, so at most one `async_write` exists at a time. This is the single most common wrong answer about Asio.\n\n**Buffers do not own memory.** `asio::buffer()` is a view. Storage must outlive the operation: coroutine locals are fine across `co_await` in the same frame; in callback style the same data must become a **member**, not a local.\n\n**Connections must outlive their handlers.** `enable_shared_from_this`, and capture `self` in *every* `co_spawn` \u002F handler — read loop, write loop, and each timer.\n\n**Frame with composed reads.** `async_read` (fills the buffer exactly) for a length prefix and then the body; never `async_read_some`, which returns short.\n\n**Wrap `as_tuple`.** Always `as_tuple(use_awaitable)`. Bare `as_tuple` resolves against the operation's default token and compiles in some contexts, fails in others.\n\n**`async_accept(make_strand(...))` changes two things**: it forces an explicit completion token back on the call, and the accepted socket is `basic_stream_socket\u003Ctcp, strand\u003C...>>`, not `tcp::socket`. Take it **by value** or with `auto` — binding it to `tcp::socket&` will not compile.\n\n**Re-arming a timer resolves the pending wait with `operation_aborted`.** In an idle-timeout loop that is the signal to keep waiting, not an error.\n\n**GCC needs `-fcoroutines`** for the C++20 style, and header-only Boost needs `BOOST_ERROR_CODE_HEADER_ONLY` defined in exactly one place (CMake).\n\n## Common mistakes\n\n| Mistake | Fix |\n|---------|-----|\n| Buffer dangling (local goes out of scope during async op) | Ensure buffer lifetime ≥ operation lifetime; coroutine locals or members, not callback locals |\n| Forgetting `io.run()` | No handlers dispatch without `run()` \u002F `run_one()` |\n| Concurrent socket access without strand | Wrap in `strand\u003C>` or serialize via one coroutine chain |\n| Assuming a strand prevents interleaved writes | Add a write queue — see Step 3 |\n| Using `use_awaitable` where `deferred` suffices | Omit the token (default is `deferred`) unless using `\\|\\|` \u002F `&&` |\n| Ignoring short reads\u002Fwrites | Use composed `async_read` \u002F `async_write` \u002F `async_read_until`, not `async_read_some` |\n| Not setting `reuse_address` on the acceptor | Set before `bind`\u002F`listen` or restarts hit \"address in use\" |\n| SSL operations without a strand | *All* `ssl::stream` ops need strand synchronization |\n| Blocking inside a handler | Never block in a completion handler |\n| Accepting a socket with the wrong executor type | See `async_accept(make_strand(...))` in Step 3 |\n| Requiring the `Boost::system` component | Header-only since 1.74: `Boost::headers` + `BOOST_ERROR_CODE_HEADER_ONLY`. Only classic (pre-1.66) needs the link |\n| Missing `-fcoroutines` on GCC | Build fails — add `$\u003C$\u003CCXX_COMPILER_ID:GNU>:-fcoroutines>` |\n| Writing coroutine code for a Boost that predates it | Do Step 1 first |\n\n## Boost.Asio vs standalone Asio\n\nSame author, same API — namespace and includes differ.\n\n| Aspect | Boost.Asio | Standalone Asio |\n|--------|-----------|-----------------|\n| Namespace \u002F include | `boost::asio` \u002F `\u003Cboost\u002Fasio.hpp>` | `asio` \u002F `\u003Casio.hpp>` |\n| Error code | `boost::system::error_code` | `asio::error_code` (or `std::error_code`) |\n| Install (brew) | `brew install boost` | `brew install asio` |\n| CMake | `Boost::headers` | manual include path |\n| Version (2025) | 1.87–1.90 (with Boost) | 1.30–1.36 (independent) |\n| Macro prefix | `BOOST_ASIO_` | `ASIO_` |\n\nSupport both with a shim, then use `net::` throughout:\n```cpp\n#ifdef USE_STANDALONE_ASIO\n  #include \u003Casio.hpp>\n  namespace net = asio;\n  using error_code = asio::error_code;\n#else\n  #include \u003Cboost\u002Fasio.hpp>\n  namespace net = boost::asio;\n  using error_code = boost::system::error_code;\n#endif\nnamespace ssl = net::ssl;\nusing tcp = net::ip::tcp;\n```\n\n## Before you call it done\n\nCheck the code you just wrote against this list:\n\n- [ ] Style matches the target Boost version and C++ standard (Step 1), and every API used clears its floor (Step 2).\n- [ ] Every buffer passed to an async op outlives that op — no callback locals, no dangling `string_view`.\n- [ ] At most one `async_write` per socket in flight, enforced by a queue + flag, if anything writes concurrently with reading.\n- [ ] Every async chain on a shared object runs on the same strand; `self` captured in every handler and `co_spawn`.\n- [ ] Framing \u002F delimited reads use composed `async_read` \u002F `async_read_until`.\n- [ ] Errors are handled, not swallowed: `as_tuple(use_awaitable)` destructured, or the callback's `ec` checked, on every op.\n- [ ] `operation_aborted` distinguished from real errors wherever a timer is re-armed or an op is cancelled.\n- [ ] Acceptor sets `reuse_address`; shutdown path closes the acceptor and drains sessions.\n- [ ] CMake has the standard, `-fcoroutines` for GCC (C++20 only), `BOOST_ERROR_CODE_HEADER_ONLY` in one place, and `Boost::coroutine` only if using stackful `spawn`.\n- [ ] It compiles. Build it — most of the mistakes above are compile-time, and the version floors are only real once tested.\n\n## Worked examples\n\nThree CI-verified implementations of the same full-duplex framed-protocol server, one per style — copy from the one matching Step 1. Paths are relative to this skill directory; if only the skill was installed, they are at https:\u002F\u002Fgithub.com\u002Falexprivalov\u002Fboost-asio-skill\u002Ftree\u002Fmain\u002Fexamples.\n\n- `..\u002F..\u002Fexamples\u002Fmarket-data-feed\u002F` — C++20 coroutines (Boost 1.77+; verified 1.83–1.90)\n- `..\u002F..\u002Fexamples\u002Fmarket-data-feed-precpp20\u002F` — callbacks, C++11-clean (verified Boost 1.74+, incl. Windows\u002FMSVC)\n- `..\u002F..\u002Fexamples\u002Fmarket-data-feed-classic\u002F` — classic `io_service` (verified back to Boost 1.62 \u002F Debian 9)\n\n## Official documentation\n\n- Overview: https:\u002F\u002Fwww.boost.org\u002Fdoc\u002Flibs\u002Flatest\u002Fdoc\u002Fhtml\u002Fboost_asio\u002Foverview.html\n- Reference: https:\u002F\u002Fwww.boost.org\u002Fdoc\u002Flibs\u002Flatest\u002Fdoc\u002Fhtml\u002Fboost_asio\u002Freference.html\n- Examples: https:\u002F\u002Fwww.boost.org\u002Fdoc\u002Flibs\u002Flatest\u002Fdoc\u002Fhtml\u002Fboost_asio\u002Fexamples.html\n\n## Limitations\n\n- This skill does not replace compiling and testing against the target toolchain. The version floors it documents are only real once built — build the code.\n- It does not cover Boost.Beast (HTTP\u002FWebSocket), io_uring backends, or UDP multicast specifics.\n- Stop and ask when the Boost version and C++ standard cannot be determined; the style choice depends on them.\n\n## Security & Safety Notes\n\n- Read-only guidance: this skill contains no shell commands, network fetches, credentials, or mutation instructions. The commands it names (`dpkg -l libboost-dev`, `brew info boost`) are local version queries.\n- Networking code it produces accepts untrusted input. Validate length prefixes before allocating (`std::string body(n, 0)` with an attacker-controlled `n` is a memory-exhaustion vector — cap it), and verify peer certificates when using TLS rather than disabling verification to make a handshake pass.\n\n## Related Skills\n\n- `@cpp-pro` — general modern C++ idioms; this skill assumes them and adds the Asio-specific rules.\n",{"name":5,"risk":47,"tags":53,"tools":57,"author":61,"source":38,"license":14,"category":62,"date_added":63,"description":7,"source_repo":64,"source_type":38,"license_source":65},[46,29,28,54,55,56],"async","networking","coroutines",[58,59,60],"claude","cursor","gemini","alexprivalov","development","2026-08-18","alexprivalov\u002Fboost-asio-skill","https:\u002F\u002Fgithub.com\u002Falexprivalov\u002Fboost-asio-skill\u002Fblob\u002Fmain\u002FLICENSE","f3312ba749561b6159f477dbfc9313c875d40a56",".agents\u002Fskills_archive\u002Fboost-asio-pro","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612","2026-10-25 23:50:58",{"source":8,"skillName":5,"commands":72,"prompt":82,"zipAvailable":83},[73,76,79],{"tool":74,"command":75},"npx","npx skills add duc-duy-1612\u002FOnline-Delivery-Systems-Web --skill boost-asio-pro",{"tool":77,"command":78},"bunx","bunx skills add duc-duy-1612\u002FOnline-Delivery-Systems-Web --skill boost-asio-pro",{"tool":80,"command":81},"pnpm","pnpm dlx skills add duc-duy-1612\u002FOnline-Delivery-Systems-Web --skill boost-asio-pro","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fboost-asio-pro\u002FSKILL.md",true,[85,91,95,99,103],{"path":86,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":89,"sourceHtmlUrl":90},"references\u002Fbuild.md","REFERENCE","参考文档",3101,"https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fboost-asio-pro\u002Freferences\u002Fbuild.md",{"path":92,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":93,"sourceHtmlUrl":94},"references\u002Fclassic-boost.md",1737,"https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fboost-asio-pro\u002Freferences\u002Fclassic-boost.md",{"path":96,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":97,"sourceHtmlUrl":98},"references\u002Fcoroutines.md",16652,"https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fboost-asio-pro\u002Freferences\u002Fcoroutines.md",{"path":100,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":101,"sourceHtmlUrl":102},"references\u002Fpre-cpp20.md",8753,"https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fboost-asio-pro\u002Freferences\u002Fpre-cpp20.md",{"path":104,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":105,"sourceHtmlUrl":106},"references\u002Fssl.md",1186,"https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fboost-asio-pro\u002Freferences\u002Fssl.md",[108,135,158,182,207,230],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":117,"publishedAt":48},"01M6Q0FA5FZ410Z33Z3TFQ4DBA","zero-trust","Implement zero-trust network architecture. Configure identity-based access, micro-segmentation, and continuous verification. Use when implementing modern security architectures.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fzero-trust\u002FSKILL.md",[114],{"categoryNo":115,"categoryName":116,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000011","运维与部署",[118,119,120,121,122,123,110,124,125,126,127,128,38,37,129,130,131,132,133,134],"ZeRO","trust","zero trust","architecture","assessment","verification","segmentation","devops-security","access","configure","only","active","critical","scope","scripts","relevant","implementing",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":48},"01M6Q0F1YZJW3KX5FBKEVZ8CV4","zcode-delegate","Delegate coding tasks to the Z.AI ZCode CLI only when the user explicitly requests it, while the orchestrator retains review and landing responsibility.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fzcode-delegate\u002FSKILL.md",[],[142,143,144,145,146,147,148,149,150,151,152,41,153,128,154,38,155,156,130,157],"delegate","zcode","zcode delegate","review","cli","orchestration","tasks","run","Bash","model","node","orchestrator","files","desktop app","app","agent-orchestration",{"skillNo":159,"name":160,"nameZh":6,"description":161,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":162,"categories":163,"keywords":164,"publishedAt":48},"01M6Q0ETK41VGNMYEXW0T00AJN","youtube-transcript","Fetch YouTube transcripts through DeepAPI or local fallback tooling and save clean text output.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-transcript\u002FSKILL.md",[],[165,166,167,47,168,169,170,171,172,173,174,175,176,38,37,177,178,179,180,181],"transcript","youtube transcript","youtube","github","codex","research","license","https","text","fetch","tooling","clean","local","output","deepapi","youtube transcripts","blob",{"skillNo":183,"name":184,"nameZh":6,"description":185,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":186,"categories":187,"keywords":197,"publishedAt":48},"01M6Q0EPPH2PVMDW40017F8WX0","youtube-transcript-skills","Fetch YouTube video transcripts, search videos\u002Fchannels, browse channels, and extract playlists via the getyoutubetranscript.com API - free tier, no card required.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-transcript-skills\u002FSKILL.md",[188,191,194],{"categoryNo":189,"categoryName":190,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":192,"categoryName":193,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000016","图像与多媒体",{"categoryNo":195,"categoryName":196,"taxonomyType":25,"taxonomyTypeDesc":26},"01JBSEEDCAT000000000000030","开发工程师",[165,166,167,198,47,60,168,169,171,199,200,201,202,174,203,38,37,204,205,206],"youtube transcript skills","search","api","Video","browse","api-integration","free","card","channels",{"skillNo":208,"name":209,"nameZh":6,"description":210,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":211,"categories":212,"keywords":217,"publishedAt":48},"01M6Q0EAB96PX83W5PTE8A0R8D","youtube-notetaker","Turn YouTube talks into local study notes with slides, transcripts, editable annotations, and a markdown-backed viewer.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-notetaker\u002FSKILL.md",[213,216],{"categoryNo":214,"categoryName":215,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000003","演示文稿",{"categoryNo":192,"categoryName":193,"taxonomyType":20,"taxonomyTypeDesc":21},[167,218,219,146,47,220,221,222,45,171,201,223,224,225,226,37,227,177,228,229],"youtube notetaker","notetaker","workflow","official","notes","markdown","slides","annotations","README","study","dair-academy","viewer",{"skillNo":231,"name":232,"nameZh":6,"description":233,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":234,"categories":235,"keywords":237,"publishedAt":48},"01M6Q0E55F0GW5MX48V8HXS8B5","youtube-full","Fetch YouTube transcripts, search videos, browse channels, and extract playlists via TranscriptAPI — no yt-dlp, no Google API key, works from any cloud server.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-full\u002FSKILL.md",[236],{"categoryNo":189,"categoryName":190,"taxonomyType":20,"taxonomyTypeDesc":21},[238,167,239,240,47,60,199,241,242,200,201,202,174,243,203,38,37,204,244,180],"youtube full","full","google","server","dlp","credits","automatic"]