Container benchmark

From SkillfulAgents/SuperAgent · View interactive version

Container benchmark is an AI agent skill from the GitHub repository SkillfulAgents/SuperAgent. Run the container startup benchmark to measure and validate the full agent-wake → dashboard-visible flow. Use before and after optimization work to catch regressions and compare timings.

How to use this skill

Skill file

Container Startup Benchmark

Runs a real end-to-end benchmark of the container startup + dashboard loading flow through the running dev server. Creates a test agent, seeds a dashboard, starts/stops the container across multiple cycles, and validates every step of the pipeline.

When to use

Prerequisites

  1. Dev server running (npm run dev or npm run dev:electron)
  2. Container runtime (Docker/Lima/Podman) available and running
  3. Agent container image built (superagent-container:latest)

Inputs

$ARGUMENTS — parse for:

If $ARGUMENTS is empty, use defaults: 3 runs, include session test, localhost:47891.

Procedure

1. Verify the dev server is reachable

curl -s -o /dev/null -w "%{http_code}" http://localhost:47891/api/agents

If not running, tell the user to start it and stop.

2. Run the benchmark

The benchmark script lives at .claude/skills/container-benchmark/benchmark-container-startup.ts. Run it with:

npx tsx .claude/skills/container-benchmark/benchmark-container-startup.ts $ARGUMENTS

For piping output (recommended — preserves results if terminal scrolls):

npx tsx .claude/skills/container-benchmark/benchmark-container-startup.ts $ARGUMENTS 2>&1 | tee /tmp/bench-results.txt

3. Interpret results

The script outputs:

Validations performed (regression checks)

| # | Check | What it proves |

|---|-------|----------------|

| 1 | POST /start returns 200, status='running' | Container starts |

| 2 | Artifacts poll finds dashboard status='running' | Dashboard boots inside container |

| 3 | Dashboard proxy returns 200 with HTML | Proxy routing works |

| 4 | HTML contains id="bench-marker" | Dashboard content is correct |

| 5 | HTML contains SpeechRecognition + window.Anthropic polyfills | Polyfill injection works |

| 6 | SSE received agent_status_changed with status='running' | Real-time events work |

| 7 | POST /stop returns status='stopped' | Container stops cleanly |

| 8 | SSE received agent_status_changed with status='stopped' | Stop event fires |

| 9 | POST /sessions returns session ID (if not --skip-session) | Session creation works |

| 10 | Messages poll finds assistant response (if not --skip-session) | Agent processes messages end-to-end |

4. Report to the user

Show the summary table and highlight:

If comparing before/after, note that cross-session timing comparisons are unreliable due to environmental factors (Docker state, machine load). The validations are the reliable regression signal. For timing, look for large (>200ms) consistent shifts, not small fluctuations.

Script architecture

The script (.claude/skills/container-benchmark/benchmark-container-startup.ts) is self-contained with no project source imports. It:

  1. Discovers the server's data directory via GET /api/settings
  2. Creates a test agent via POST /api/agents
  3. Seeds a minimal Bun dashboard directly on the filesystem
  4. Connects an SSE listener to /api/notifications/stream
  5. For each cycle: verifies agent is stopped → starts → polls dashboard → fetches HTML → optionally creates session → stops
  6. Cleans up (stop + delete agent)
  7. Exits 0 if all validations pass, 1 if any fail

Key files

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.