Agent skill

Optimize Protocol

by 0x0funky in 0x0funky/vibehq-hub

Autonomous framework engineer — reads VibeHQ post-run analysis, understands root causes of multi-agent coordination failures, then designs and implements real code changes (new features, refactors…

MITAuto-check passedDevelopment

Install Optimize Protocol

skills CLI
$ npx skills add 0x0funky/vibehq-hub --skill optimize-protocol -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install 0x0funky/vibehq-hub optimize-protocol --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/0x0funky/vibehq-hub.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/optimize-protocol .claude/skills/optimize-protocol && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
optimize-protocol
GitHub stars
195
Token cost
~3.2k tokens
SKILL.md length
1,186 words
Files
1
Skills in repo
3
Repo updated
First seen
Licence
MIT

At a glance

Autonomous framework engineer — reads VibeHQ post-run analysis, understands root causes of multi-agent coordination failures, then designs and implements real code changes (new features, refactors…

  • Works in 8 steps: Load analysis data (current + historical) → Deep analysis — understand root causes… → Plan the changes → …
  • Tasks that involve Root cause analysis
  • SKILL.md covers Step 1: Load analysis data…, Step 2: Deep analysis —…, Step 3: Plan the changes and Step 4: Implement, plus 5 more sections
  • Calls npx

What it does

Optimize Protocol is an agent skill from 0x0funky/vibehq-hub. Autonomous framework engineer — reads VibeHQ post-run analysis, understands root causes of multi-agent coordination failures, then designs and implements real code changes (new features, refactors, architectural improvements) to fix them. Not parameter tuning — actual engineering.

Its SKILL.md is about 3.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Root cause analysis and Refactoring. The repository describes itself as: Orchestrate Claude, Codex & Gemini agents working as a real engineering team. The licence is MIT.

When your agent uses it

  • Tasks that involve Root cause analysis
  • Tasks that involve Refactoring

Example prompts

  • “/optimize-protocol”

Requirements

  • Node.js

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. Load analysis data (current + historical)
  2. Deep analysis — understand root causes (with historical context)
  3. Plan the changes
  4. Implement
  5. Build and verify
  6. Update analyzer context
  7. Save optimization changelog
  8. Summary

What it can do on your machine

Read from SKILL.md and the folder at commit 5f2964b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npx, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Optimize Protocol loads about 3.2k tokens when it runs. Until then it costs about 75 tokens; SKILL.md has 1,186 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~75
When it runs · the whole SKILL.md, loaded when a task matches
~3.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from 0x0funky/vibehq-hub at commit 5f2964b, republished under its MIT licence (© 0x0funky). 1,186 words, ~3,153 tokens.

Download SKILL.mdSave it as .claude/skills/optimize-protocol/SKILL.md (or your agent's skills folder).
name
optimize-protocol
description
Autonomous framework engineer — reads VibeHQ post-run analysis, understands root causes of multi-agent coordination failures, then designs and implements real code changes (new features, refactors, architectural improvements) to fix them. Not parameter tuning — actual engineering.
argument-hint
[run-id (optional, defaults to latest)]

/optimize-protocol

You are a senior framework engineer working on VibeHQ, an open-source multi-agent coordination protocol for CLI coding agents (Claude Code, Codex CLI, Gemini CLI).

Your job: read post-run analysis data, deeply understand what went wrong in the multi-agent session, then design and implement real code changes to prevent those failures in future sessions.

You are NOT a parameter tuner. You are an engineer. Changing a threshold from 200 to 500 is a band-aid. Adding a content-hash validation middleware that rejects duplicate stubs before they reach the orchestrator — that's engineering.

Step 1: Load analysis data (current + historical)

Run ID: $ARGUMENTS

1a. Load current run data

Load from ~/.vibehq/analytics/runs/<run-id>/. If no run ID given, find the latest from ~/.vibehq/analytics/run_history.jsonl.

Read ALL of these files from the run directory:

  • report_card.json — LLM analysis with fix_actions and improvement_suggestions
  • run_metrics.json — full metrics (agents, tasks, artifacts, phases, token usage)
  • detected_flags.json — all 13 detection rules with evidence

If these don't exist, tell the user to run: vibehq-analyze <path> --with-llm --save

1b. Load optimization history (CRITICAL)

Read ~/.vibehq/analytics/optimizations/history.jsonl to get the full list of previous optimization runs.

Then read all previous optimization reports from ~/.vibehq/analytics/optimizations/optimization-*.md. These contain:

  • What problems were identified and fixed in each iteration
  • What files were modified and what was built
  • What grade/flags each run had

Also load the report_card.json and detected_flags.json from all previous benchmark runs listed in ~/.vibehq/analytics/runs/ (e.g., benchmark-v1, benchmark-v2, etc.) to build a complete picture.

1c. Build cross-run trend analysis

Before proceeding to Step 2, construct a mental trend table:

Flag/Metric         v1    v2    v3    Trend
─────────────────────────────────────────────
ROLE_DRIFT          1     1     0     ✓ fixed in v3
INCOMPLETE_TASK     4     3     0     ✓ fixed in v3
ARTIFACT_REGRESSION 0     0     2     ✗ NEW in v3
Parallel Efficiency 0.18  0.64  0.88  ✓ improving
Duration (min)      47    13    10    ✓ improving
Emma shell_command  4     42    0     ✓ fixed (but Glob=48 replaced it)
...

This trend analysis is essential for:

  • Detecting regressions: a problem that was fixed in v2 but reappeared in v3 needs different treatment than a new problem
  • Detecting fix side-effects: if fixing Problem A in iteration N introduced Problem B in iteration N+1, the fix needs refinement, not a separate patch
  • Avoiding duplicate fixes: don't re-implement something that already exists in the codebase from a previous optimization
  • Identifying persistent problems: if a problem survives 2+ iterations, it needs a more aggressive architectural solution, not another incremental tweak

Step 2: Deep analysis — understand root causes (with historical context)

Don't just read the fix_actions. Read the full metrics, flags, report card, and the trend analysis from Step 1c to understand the systemic problems. Ask yourself:

  • Why did this failure happen? What's the root cause in the framework's architecture?
  • Is this a missing feature, a design flaw, or an insufficient mechanism?
  • What would a senior engineer build to make this class of problem impossible (not just less likely)?
  • Is this a NEW problem, a RECURRING problem, or a SIDE-EFFECT of a previous fix?
  • Was this problem already addressed in a previous optimization? If so, why did the fix fail or regress?

Cross-iteration analysis rules:

PatternWhat it meansHow to handle
Problem fixed in iteration N, stays fixed in N+1Fix workedDon't touch it
Problem fixed in iteration N, reappears in N+1Fix was incomplete or bypassedStrengthen the fix, don't re-implement from scratch
New problem in N+1 that didn't exist in NLikely side-effect of a fix from iteration NTrace back to which fix caused it; refine that fix rather than adding a separate patch
Problem persists across 2+ iterationsIncremental fixes aren't workingEscalate to a more aggressive architectural solution
Metric improving steadily (e.g., parallel efficiency)System is learningProtect this improvement — don't break it with new changes

Common root cause patterns and what to build:

SymptomBand-aidReal fix
Stub files (agent publishes pointer instead of content)Raise byte thresholdAdd content validation in hub — hash check, reject if content matches known stub patterns, require minimum content entropy
Orchestrator role drift (PM writes code)Add prompt warningImplement tool whitelist per role in spawner — orchestrator physically cannot call Write/Edit/Bash
Context bloat (agent context grows 10x)Lower alert thresholdAdd context summarization — after N turns, auto-inject a summary and truncate old messages
Premature task execution (agent ignores QUEUED)Change prompt wordingRedesign task delivery — QUEUED tasks send NO description, only a notification. Full spec arrives on status change to READY
Silent agent deathShorter heartbeatAdd graceful shutdown protocol — agent sends agent:shutting_down before exit. Hub immediately reassigns.
Schema conflicts between agentsPost-hoc detectionAdd contract system enforcement — hub validates artifact JSON against declared schema before accepting
Excessive pollingLower thresholdImplement push-based notifications — agent subscribes to status changes instead of polling
Agent generates data instead of reading shared filesPrompt engineeringAdd artifact dependency injection — hub sends file content directly in task payload, not a "please read this file" instruction
Show full SKILL.md (437 more words)Show less

Step 3: Plan the changes

Before writing any code, present your plan to the user. Include the cross-run trend table and mark each problem's history:

Optimization iteration: N (based on <run-id>)
Previous iterations: v1 (D) → v2 (C) → v3 (C)

Cross-run trend:
  Flag/Metric              v1    v2    v3    Status
  ──────────────────────────────────────────────────
  ORCHESTRATOR_ROLE_DRIFT  1     1     0     ✓ Fixed in v3
  ARTIFACT_REGRESSION      0     0     2     ✗ NEW — side-effect of v2 fix?
  Parallel Efficiency      0.18  0.64  0.88  ✓ Improving
  ...

Problem 1: [root cause description]
  History: [NEW | RECURRING since vN | SIDE-EFFECT of fix X from vN]
  Evidence: [specific data from metrics/flags]
  Proposed fix: [what you'll build]
  Files to modify: [list]

Problem 2: ...

Estimated scope: [small/medium/large]

Wait for user confirmation before proceeding.

Step 4: Implement

Now write the code. You have full access to the VibeHQ codebase.

Key directories:

  • src/hub/ — Hub WebSocket server, agent registry, relay engine, task/artifact stores
  • src/spawner/ — Agent process manager, PTY handling, idle detection, JSONL watchers
  • src/mcp/ — MCP server (tools exposed to agents), hub client
  • src/analyzer/ — Post-run analytics pipeline (normalizer, metrics, detection, LLM analyst)
  • src/shared/ — Shared types and message schemas
  • src/tui/ — Terminal UI, role presets, dashboard
  • bin/ — Entry points (hub.ts, start.ts, spawn.ts, analyze.ts, web.ts)

Code quality standards:

  • TypeScript, ESM modules
  • Follow existing patterns in the codebase
  • Add to existing files when possible — don't create new files unless architecturally necessary
  • No over-engineering — solve the specific problems found in the analysis
  • Update types in src/shared/types.ts if adding new message types
  • If adding new MCP tools, add them in src/mcp/server.ts
  • If adding new detection rules, add them in src/analyzer/pattern-detector.ts

Step 5: Build and verify

After implementing:

  1. Run npx tsup — must compile cleanly
  2. If you added new detection rules, verify they would catch the original problem by mentally running them against the run_metrics.json data
  3. If you modified hub protocol, check that existing message handlers still work

Step 6: Update analyzer context

If you changed framework defaults or added new mechanisms, update:

  • src/analyzer/llm-analyst.ts — the ANALYST_SYSTEM_PROMPT and collectFrameworkContext() so future analysis runs know about the new capabilities
  • src/analyzer/pattern-detector.ts — add new detection rules if you added new mechanisms that could fail

This keeps the analyze → optimize loop self-aware.

Step 7: Save optimization changelog

MANDATORY: After every optimization run, save a detailed changelog to persistent storage for future reference (blog writing, auditing, iteration tracking).

Save path: ~/.vibehq/analytics/optimizations/optimization-<run-id>-<timestamp>.md

Create the directory if it doesn't exist. Use the Write tool to create a Markdown file with this structure:

markdown
# Optimization Report: <run-id>
Date: <YYYY-MM-DD HH:MM>
Base analysis: ~/.vibehq/analytics/runs/<run-id>/

## Grade & Score
- Grade: <letter grade from report_card>
- Score: <numeric score>
- Flags triggered: <count>

## Problems Identified

### Problem 1: <title>
**Root cause**: <description>
**Evidence**: <specific metrics/flags that revealed this>
**Severity**: <critical/high/medium/low>

### Problem 2: ...

## Fixes Implemented

### Fix 1: <title>
**What was built**: <description of the engineering solution>
**Files modified**:
- `path/to/file.ts` — <what changed>
- ...
**Before → After**: <what behavior changes>

### Fix 2: ...

## Cross-Run Context
- Optimization iteration: <N>
- Run history: v1 (<grade>) → v2 (<grade>) → ... → current (<grade>)
- Problems carried over from previous iterations: <list or "none">
- Problems caused by previous fixes (side-effects): <list or "none">
- Problems fully resolved in this iteration: <list or "none">
- Metrics trend: parallel_efficiency [values], duration [values], flags [values]

## Summary of Changes
- Total files modified: <N>
- New features added: <list>
- Thresholds/config changed: <list>
- Detection rules added/modified: <list>

## Build Status
<OK or error details>

## Next Steps
- Run benchmark with: `vibehq start --team <team-name>`
- Analyze with: `vibehq-analyze --team <team-name> --with-llm --save --run-id <next-id>`
- Compare with: `vibehq-analyze compare <run-id> <next-id>`

Also append a one-line entry to ~/.vibehq/analytics/optimizations/history.jsonl:

json
{"run_id":"<id>","timestamp":"<ISO>","grade":"<letter>","flags_before":<N>,"problems_fixed":<N>,"files_modified":<N>}

Step 8: Summary

Output what was done to the user:

optimize-protocol complete (run: <id>)

Root causes addressed:
  1. [problem] → [what was built]
  2. [problem] → [what was built]

Files modified:
  - src/hub/server.ts — added artifact validation middleware
  - src/spawner/spawner.ts — added tool whitelist enforcement
  - src/shared/types.ts — new ArtifactValidation message type
  - src/analyzer/pattern-detector.ts — new ARTIFACT_HASH_DUPLICATE rule

Build: OK
Changelog saved: ~/.vibehq/analytics/optimizations/optimization-<id>-<timestamp>.md

To verify, run a new session and compare:
  vibehq-analyze <logs> --with-llm --save --run-id v3
  vibehq-analyze compare <old-id> v3

Important principles

  1. Fix the system, not the symptom. If agents keep publishing stubs, the answer isn't "detect stubs better" — it's "make stubs impossible to publish."

  2. Each fix should make the framework smarter. After your changes, the framework should handle this class of problem automatically, not just flag it for humans.

  3. The analyze → optimize loop is self-improving. Your code changes will be tested in the next session, analyzed again, and the next /optimize-protocol run will find new (hopefully smaller) problems. Design for this iteration cycle.

  4. Be bold but reversible. Make real architectural changes, but make sure npx tsup passes and existing functionality isn't broken.

© 0x0funky, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/optimize-protocol of 0x0funky/vibehq-hub.

Open the folder on GitHubat commit 5f2964b

Compare with similar skills

Optimize Protocol next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Optimize Protocol compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Optimize Protocol this skill0x0funky/vibehq-hub195—~3.2kAutomated safety check: PassMIT
Simplifyelliothux/open-compute1.6k—~984Automated safety check: PassApache-2.0
iOS FixMacMagazine/app-iOS171—~957Automated safety check: PassNone
Omk CodingKaimingWan/oh-my-kiro107—~2.4kAutomated safety check: PassMIT
Workflow Practiceseser/stack128—~743Automated safety check: PassCustom licence
Debughashgraph-online/awesome-codex-plugins1.2k—~1.8kAutomated safety check: NotesApache-2.0

Similar skills

  • Simplify

    elliothux/open-compute

    Simplify recently modified Lynx business code while preserving behavior.

    1.6k GitHub stars~984 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • iOS Fix

    MacMagazine/app-iOS

    Bug-fix and refactoring workflow for MacMagazine — root cause analysis, pattern-matching fix, regression verification.

    171 GitHub stars~957 tokensUpdated today
    DevelopmentAuto-check passed
  • Omk Coding

    KaimingWan/oh-my-kiro

    Enforces coding best practices: deep-read before modify, LSP-first navigation, TDD red-green-refactor, minimal changes, self-review, verification.

    107 GitHub stars~2.4k tokensUpdated 6 mo ago
    DevelopmentAuto-check passed
  • How agents work in eserstack: clarifying requests, roles, approvals, forbidden git and publish actions, cross-package changes, root-cause fixes, quality gates.

    128 GitHub stars~743 tokensUpdated 3 days ago
    DevelopmentAuto-check passed
  • Debug

    hashgraph-online/awesome-codex-plugins

    Diagnosis before prescription: reproduce, hypothesize, isolate, fix root cause, add a regression test; refactor mode maps deps, coupling and blast radius.

    1.2k GitHub stars~1.8k tokensUpdated yesterday
    DevelopmentAuto-check: notes
  • A skill your agent uses to teach Claude exactly which Kotlin and Compose changes hot-reload under Compose HotSwan and which trigger a full incremental rebuild fallback.

    1.9k GitHub starsUsed in 1 repo~2.6k tokens
    MobileAuto-check passed

More from 0x0funky/vibehq-hub

  • Run Teamwork

    0x0funky/vibehq-hub

    Run a single team session to build a project from a prompt. An agent skill from 0x0funky/vibehq-hub.

    195 GitHub stars~2.3k tokensUpdated 6 mo ago
    Auto-check passed
  • Benchmark Loop

    0x0funky/vibehq-hub

    Fully automated self-improving loop — takes a project prompt, designs a team, runs the benchmark, analyzes results, optimizes framework code, rebuilds, and repeats until target grade is reached.

    195 GitHub stars~5.3k tokensUpdated 6 mo ago
    Auto-check: warnings

Questions about Optimize Protocol

What does Optimize Protocol do?

Autonomous framework engineer — reads VibeHQ post-run analysis, understands root causes of multi-agent coordination failures, then designs and implements real code changes (new features, refactors…. Optimize Protocol is an agent skill from 0x0funky/vibehq-hub. Autonomous framework engineer — reads VibeHQ post-run analysis, understands root causes of multi-agent coordination failures, then designs and implements real code changes (new features, refactors, architectural improvements) to fix them.

When should I use Optimize Protocol?

Optimize Protocol fits situations like: tasks that involve Root cause analysis; tasks that involve Refactoring.

How do I install Optimize Protocol in Claude Code?

Run `npx skills add 0x0funky/vibehq-hub --skill optimize-protocol -a claude-code`. Or copy the skill folder (.claude/skills/optimize-protocol in 0x0funky/vibehq-hub) into .claude/skills/optimize-protocol in your project. Claude Code loads it when a task matches its description.

How do I install Optimize Protocol in Codex?

Run `npx skills add 0x0funky/vibehq-hub --skill optimize-protocol -a codex`. Or copy the skill folder (.claude/skills/optimize-protocol in 0x0funky/vibehq-hub) into .agents/skills/optimize-protocol in your project. Codex loads it when a task matches its description.

Can I use Optimize Protocol in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add 0x0funky/vibehq-hub --skill optimize-protocol -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/optimize-protocol, .gemini/skills/optimize-protocol, .github/skills/optimize-protocol and .opencode/skills/optimize-protocol in your project.

What does Optimize Protocol need to run?

Going by SKILL.md and its folder, Optimize Protocol needs the command-line tools its instructions call (npx). Our summary lists: Node.js.

Does Optimize Protocol access the network?

SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Optimize Protocol safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Optimize Protocol use?

Optimize Protocol is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Optimize Protocol use?

About 3.2k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Optimize Protocol?

Skills that share tags, products or a category with Optimize Protocol: Simplify (elliothux/open-compute, 1.6k stars), iOS Fix (MacMagazine/app-iOS, 171 stars), Omk Coding (KaimingWan/oh-my-kiro, 107 stars) and Workflow Practices (eser/stack, 128 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Optimize Protocol?

0x0funky (a GitHub user) maintains it in 0x0funky/vibehq-hub, which has 195 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on March 26, 2026.

Source: 0x0funky/vibehq-hub on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.