一键导入
mesh-optimize
Optimize the server meshing system — benchmark, identify bottlenecks, implement fixes, verify, and deploy against the live AKS cluster.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Optimize the server meshing system — benchmark, identify bottlenecks, implement fixes, verify, and deploy against the live AKS cluster.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Full development pipeline — architect a feature, get user approval, then implement, test, and audit it using the mesh agent team.
Develop features for the server meshing system — implement, test against AKS, verify with Playwright, and deploy.
Ship the current branch — commit, rename, push, create PR, merge to main, and create a new branch for the next piece of work.
Hunt down test coverage gaps in the server meshing system, write tests to fill them, and verify against AKS.
| name | mesh-optimize |
| description | Optimize the server meshing system — benchmark, identify bottlenecks, implement fixes, verify, and deploy against the live AKS cluster. |
| user-invocable | true |
You are optimizing a server meshing prototype running on AKS. Always test against the live cluster — local testing is not representative of real-world performance.
ws://20.29.160.152 (get fresh IP with kubectl get svc gateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}')http://<gateway-ip>:8200/metricskubectl port-forward sim-server-N 810N:810Ncd tools && npx tsx test-suite/runner.ts ws://<gateway-ip> 8101 3 --no-color --jsoncd tools && npx tsx browser-test.ts ws://<gateway-ip>./deploy/update.sh (builds, pushes, restarts all pods)At the START of every run, read .claude/skills/mesh-optimize/PASS_LOG.md. This file tracks the last 5 optimization runs with metrics. Use it to understand what was tried before and what the current performance baseline is.
At the END of every run, append your results to .claude/skills/mesh-optimize/PASS_LOG.md and trim to keep only the last 5 entries. Each entry format:
## Run [N] — [date] — [one-line summary]
- **Change**: what was optimized
- **Gateway aggregate_us**: before → after
- **Frame rate (Hz)**: before → after
- **Tick budget %**: before → after
- **Entity count**: total / deduped
- **Browser test**: PASS/FAIL (jumps: N, flicker: N)
- **Status**: PASS / FAIL / PARTIAL
- **Notes**: any observations
If .claude/skills/mesh-optimize/PASS_LOG.md doesn't exist, create it with a header.
Before changing anything, capture current performance:
# Gateway metrics
curl -sf http://<gateway-ip>:8200/metrics | jq .
# Frame rate measurement
cd tools && node -e "
const ws = require('ws');
const w = new ws.WebSocket('ws://<gateway-ip>');
let times = [], count = 0;
w.on('message', (d, b) => { if (!b) return; times.push(Date.now()); count++;
if (count >= 50) { let ivs = []; for (let i=1;i<times.length;i++) ivs.push(times[i]-times[i-1]);
console.log('Hz: ' + (1000/(ivs.reduce((a,b)=>a+b,0)/ivs.length)).toFixed(1));
w.close(); process.exit(0); }});
setTimeout(() => process.exit(1), 15000);
"
# Sim-server tick budget
kubectl port-forward sim-server-0 8101:8101 &
curl -sf http://localhost:8101/metrics | jq '.tick_budget_pct, .phases'
kill %1
Check these in order:
Make code changes in the relevant crate/file. Key optimization targets:
crates/gateway/src/aggregator.rs — snapshot merging, binary serialization, delta compressioncrates/sim-server/src/simulation.rs — game loop phases, entity iterationcrates/sim-server/src/replication.rs — UDP packet sizes, serializationcrates/coordinator/src/registry.rs — rebalance algorithm, thresholdsclient/src/world-view.ts — interpolation, entity managementcargo build
cd client && npx tsc --noEmit
cd tools && npx tsc --noEmit --strict --target ES2022 --module nodenext --moduleResolution nodenext --skipLibCheck test-suite/runner.ts
./deploy/update.sh
# Wait for pods to stabilize
sleep 60
kubectl get pods
Run these checks BEFORE telling the user anything works:
# A) Automated browser test — MUST pass with 0 position jumps
cd tools && npx tsx browser-test.ts ws://<gateway-ip>
# B) Frame rate check — should match tick rate
# (same node -e command from step 1)
# C) Gateway metrics — compare against baseline
curl -sf http://<gateway-ip>:8200/metrics | jq .
CRITICAL: Do NOT tell the user a fix works until the browser test passes. If it fails, fix the issue and re-test. Never ask the user to manually verify rendering.
Compare before/after:
docker stats or kubectl top pods)browser-test.ts and automated toolsbrowser-test.ts) is the source of truth — if it says FAIL, you have a bugkubectl get svc gateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}'