event-loop

Expert skill for high-performance event-driven I/O programming and optimization

509 stars

Best use case

event-loop is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Expert skill for high-performance event-driven I/O programming and optimization

Teams using event-loop should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/event-loop/SKILL.md --create-dirs "https://raw.githubusercontent.com/a5c-ai/babysitter/main/library/specializations/network-programming/skills/event-loop/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/event-loop/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How event-loop Compares

Feature / Agentevent-loopStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Expert skill for high-performance event-driven I/O programming and optimization

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Event Loop Skill

Expert skill for high-performance event-driven I/O programming across platforms and runtime environments.

## Capabilities

- **Platform Multiplexers**: Configure epoll (Linux), kqueue (BSD/macOS), IOCP (Windows)
- **Performance Analysis**: Analyze event loop performance and identify bottlenecks
- **Event Debugging**: Debug event handling issues and callback delays
- **Framework Code Generation**: Generate code for libuv, Boost.Asio, Tokio, and mio
- **C10K+ Optimization**: Optimize for massive concurrent connection handling
- **Profiling**: Profile event loop performance with system tools
- **io_uring Integration**: Implement Linux io_uring for high-performance I/O
- **Timer Management**: Efficient timer wheel and hierarchical timing implementations

## Tools and Dependencies

- `strace/dtrace` - System call tracing
- `perf` - Linux performance analysis
- `libuv` - Cross-platform async I/O
- `io_uring` - Linux async I/O interface
- `Tokio` - Rust async runtime
- `Boost.Asio` - C++ async I/O

## Target Processes

- event-driven-socket-handler.js
- tcp-socket-server.js
- websocket-server.js
- layer4-load-balancer.js

## Usage Examples

### epoll Event Loop (C)
```c
int epfd = epoll_create1(0);
struct epoll_event ev, events[MAX_EVENTS];
ev.events = EPOLLIN | EPOLLET;  // Edge-triggered
ev.data.fd = listen_fd;
epoll_ctl(epfd, EPOLL_CTL_ADD, listen_fd, &ev);

while (1) {
    int n = epoll_wait(epfd, events, MAX_EVENTS, -1);
    for (int i = 0; i < n; i++) {
        handle_event(&events[i]);
    }
}
```

### io_uring Setup
```c
struct io_uring ring;
io_uring_queue_init(256, &ring, 0);
// Submit and complete I/O operations
```

### Performance Profiling
```bash
perf record -g ./server
perf report --stdio
strace -c -f ./server
```

## Quality Gates

- Event handling latency within threshold
- No callback starvation
- Memory usage stable under load
- CPU utilization optimized
- C10K+ connection handling verified

Related Skills

patient-safety-event-analysis

509
from a5c-ai/babysitter

Investigate patient safety events using RCA, FMEA, and other systematic analysis methods to identify contributing factors and develop corrective actions

pythia-event-generator

509
from a5c-ai/babysitter

Pythia event generation skill for proton-proton and lepton collisions at high energies

discrete-event-simulator

509
from a5c-ai/babysitter

Discrete event simulation skill for modeling and analyzing complex systems with stochastic processes.

loop-invariant-generator

509
from a5c-ai/babysitter

Automatically generate and verify loop invariants for algorithm correctness proofs

adverse-event-reporter

509
from a5c-ai/babysitter

Adverse event monitoring and reporting skill for MDR/MEDWATCH compliance

speaking-events

509
from a5c-ai/babysitter

Speaking opportunity discovery and conference management

kaizen-event-facilitator

509
from a5c-ai/babysitter

Rapid improvement workshop planning and execution skill with team coordination, metrics tracking, and follow-up management

event-sourcing-migrator

509
from a5c-ai/babysitter

Migrate to event-sourcing architecture with event extraction, store setup, and CQRS implementation

process-builder

509
from a5c-ai/babysitter

Scaffold new babysitter process definitions following SDK patterns, proper structure, and best practices. Guides the 3-phase workflow from research to implementation.

Workflow & Productivity

babysitter

509
from a5c-ai/babysitter

Orchestrate via @babysitter. Use this skill when asked to babysit a run, orchestrate a process or whenever it is called explicitly. (babysit, babysitter, orchestrate, orchestrate a run, workflow, etc.)

yolo

509
from a5c-ai/babysitter

Run Babysitter autonomously with minimal manual interruption.

user-install

509
from a5c-ai/babysitter

Install the user-level Babysitter Codex setup.