MockServer is a testing server and proxy that imitates APIs, records and changes network traffic, and deliberately introduces failures. It is for developers testing applications against unavailable dependencies, debugging requests, and checking how systems handle degraded services across several network protocols. The catalogue add-ons help operate, configure, and test MockServer.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/mock-server/mockserver-monorepo/worktree-mergegit clone --depth 1 https://github.com/mock-server/mockserver-monorepoWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/mock-server/mockserver-monorepo/worktree-merge)<a href="https://agentmods.dev/commands/mock-server/mockserver-monorepo/worktree-merge"><img src="https://agentmods.dev/badge/commands/mock-server/mockserver-monorepo/worktree-merge.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00022 | $0.01055 |
| Opus 5 | $0.00011 | $0.00528 |
| Sonnet 5 | $0.00004 | $0.00211 |
| Haiku 4.5 | $0.00002 | $0.00105 |
Grade A, and why
worktree-merge scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
Follow the worktree merge workflow in .opencode/rules/worktree-workflow.md (steps 3–8). Do not skip any gate unless the user explicitly says "skip gate X".
Run all four gates in order. Any failure stops the merge and leaves the worktree intact for inspection — never delete a worktree on a failed merge.
-
Sanity check — confirm CWD is inside a worktree (
git rev-parse --git-common-dirdiffers from.git). If not, refuse and tell the user to/worktreefirst. -
Gate 1 — Tests. Detect changed modules from
git diff --name-only origin/master...and run targeted Maven tests plus mockserver-core always:./mvnw verify -pl :mockserver-core $(...) -DforkCount=1 -DreuseForks=false -fae -Djacoco.skip=trueFor long runs, launch the build in the background (
Bash run_in_background, or./cmd > log 2>&1 &) and poll the log. -
Gate 2 — Lint / checkstyle / type checks. Maven's
validatephase runs checkstyle. For frontend changes also runnpm run lint && npm run build. -
Gate 3 — Adversarial review. Spawn
review-finalsubagent ongit diff origin/master...HEAD. Block on BLOCK verdict. Quote any concerns back to the user. -
Gate 4 — Summary & proceed. Under the DVRR operating model (
.opencode/rules/operating-model.md), gates 1–3 are the authority — they replace human pre-approval. Show:git diff --stat origin/master...HEAD- List of changed files
- Gate 1/2/3 results in one line each Then proceed automatically to the locked rebase. Do NOT wait for approval. Fail-closed: if any of gates 1–3 did not return a clean PASS, stop and leave the worktree intact. A user can interject at any time to halt.
-
Locked rebase (linear history — never a merge commit). Time the wait to acquire
flock --timeout 300 "$(git rev-parse --git-common-dir)/agent-rebase.lock"(the common dir so all worktrees share one lock — a relative.git/…path resolves per-worktree and would not serialise; e.g. capture an epoch before and after theflock), then inside the lock:git fetch origin master --quiet git rebase origin/master # rebase, never merge git push origin HEAD:master # always a fast-forward after the rebaseAlways rebase, never merge —
masteris kept a strictly linear history with no merge commits. Do NOTgit mergethe worktree branch into master, do NOT usegit pullwithout--rebase, and when several worktrees are ready, rebase them one at a time under the lock (never via an intermediate "integration branch"). See.opencode/rules/worktree-workflow.md→ Linear History — No Merge Commits. Ifflockis missing (older macOS), fall back to themkdir-based mutex documented in the rule.Serialisation telemetry (§18.7 /
[[decision-log]]). If the lock wait was non-trivial, recordserialisation.merge_lock_s(seconds waited onflock) into this unit's.tmp/decisions/<id>.mdtelemetry block. If the rebase hit conflicts, also recordserialisation.contention_s(seconds spent resolving them). -
Re-verify the integrated result (spec §8.4). If the rebase in step 6 pulled in other units' commits (i.e.
origin/masteradvanced since the worktree branched), re-run the Gate 1 test command against the integrated tip before cleanup — passing in isolation does not prove the merged result passes. If the rebase was a clean fast-forward with no new upstream commits, this is a no-op. -
Cleanup. On successful push only:
cd "$(git rev-parse --show-toplevel)/.." git worktree remove "${WORKTREE_DIR}" --force git branch -D "${BRANCH}" rm -f .tmp/active-worktree -
Report. Summarise to the user: gate results, commit hash on master, worktree cleaned up.
If the user provided additional instructions (e.g. "skip user approval", "skip tests because we already ran them"): $ARGUMENTS — only honour explicit skip flags, never silently drop a gate.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago First seen · 49 lines · 22 tokens per session scan A 59ca979ebdba
worktree-merge is a command published in the GitHub repository mock-server/mockserver-monorepo (4,965 stars, last pushed today), licensed Apache-2.0. It adds 22 tokens to every session and 1,055 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
write-fixtures
../../skills/write-fixtures/SKILL.md.
bench
Refresh model grades (capability + price, from benchlm.ai and OpenRouter) or measure route latency through the proxy. Nothing runs automatically — this is the manual refresh.
models
List every model reachable through cc-proxy with the provider each routes to.
bmad-architecture
Produce the architecture: a lean spine of invariants that keeps everything built from it consistent, projected into whatever format the work needs. Use when the user says "create the architecture", "create technical architecture", "architecture spine", or "create a solution design".
bmad-code-review
Review code changes adversarially using parallel review layers (Blind Hunter, Edge Case Hunter, Acceptance Auditor) with structured triage into actionable categories. Use when the user says "run code review" or "review this code".
bmad-party-mode
Orchestrates lively group discussions between installed BMAD agents or custom personas, and helps author custom parties. Use when the user requests party mode, a roundtable, or multiple agent perspectives — or wants to create/configure a party, define personas, or build an AI focus-group panel.