Works with the AI tools you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIGitHub CopilotGitHub CopilotGemini CLIGemini CLI+20 more

    Repair Half-Closed Socket Bugs

    1

    Repair TCP half-close bugs that truncate responses, destroy both directions on EOF, omit FIN propagation, or leave writers hanging.

    $5

    Secure checkout via Stripe

    30-day refund guarantee

    Converts to your local currency at checkout

    0 installsSecurity scanned
    Repair Half-Closed Socket Bugs

    Repair Half-Closed Socket Bugs

    Example session with this skill installed

    Our Go TCP tunnel runs io.Copy in both directions. When the client finishes uploading it sends FIN, the client-to-upstream copy returns EOF, and our goroutine closes both connections immediately. The upstream may still send a final response, which is intermittently truncated. Repair locally using disposable loopback listeners and deterministic barriers. Preserve current deadlines and protocol framing; do not connect to production or add retries.

    • Read your context and instructions
    • Compiled the repair half-closed socket

    Directional close bug found. The upstream read loop treats orderly EOF as authority to destroy both sockets, so downstream response bytes can be truncated. The repair separates read completion from final teardown, propagates supported CloseWrite deliberately, drains approved buffers, and validates both FIN orderings on disposable loopback sockets.

    Connects securely to your tools. The creator never sees your data.

    What you get

    Prevent response truncation when a client finishes sending its request body.Implement graceful CloseWrite propagation in TCP-to-TLS protocol bridges.Decouple read-loop completion from connection destruction in stream adapters.Add deterministic tests for edge-case socket shutdown sequences.

    About this skill

    The problem

    TCP proxies, tunnels, and stream adapters often treat a read EOF as a signal to kill the entire connection. This leads to truncated responses, hung writers, and race conditions when one peer finishes sending but still needs to receive data.

    What it does

    • Identifies incorrect socket shutdown logic in proxies, relays, and protocol bridges.
    • Implements directional CloseWrite/FIN propagation to ensure data drains before cleanup.
    • Refactors read loops to decouple stream completion from socket destruction.
    • Builds deterministic loopback tests to verify specific FIN/EOF ordering and buffer boundaries.
    • Adds observability for peer EOF, local FIN, and truncation events.

    Frameworks & tools

    Works with low-level networking code in Node.js (allowHalfOpen), Go (TCPConn), C/C++, and Rust. Compatible with TCP, TLS wrappers, and custom protocol tunnels.

    Why this beats prompting it yourself

    General LLMs often assume EOF means "the connection is over," which is fatal for many protocols. This skill enforces a strict directional socket register and synchronization contract to prevent data loss in half-closed states.

    Use cases

    • Fixing tunnels where the client connection drops before the server finishes responding.
    • Repairing proxy relays that truncate buffered data after a peer sends a FIN.
    • Resolving deadlocks in request-response flows over raw TCP sockets.
    • Migrating raw TCP close semantics to TLS close_notify without breaking stream logic.

    Known limitations

    Cannot verify middlebox or ISP-level packet interference. Requires repository access to local socket fixtures for validation.

    How to install

    Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.

    ~30 seconds
    1. 1

      Download the ZIP

      Free skills download straight away. Paid skills unlock right after purchase.

    2. 2

      Unzip into your skills folder

      Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.

    3. 3

      Ask your agent to use it

      Restart the agent if it was already running. It picks the skill up automatically - no config needed.

    Skills folder by agent

    Click the path to copy it. Create the folder if it does not exist yet.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean 1 month ago

    • Passed all security checks, Safe to install

    Listed1 month ago
    Updatedtoday

    What's inside

    Frequently Asked Questions