一键导入
check-hotpath
Scan hot-path code for allocation violations, lock misuse, and performance anti-patterns. Zero-tolerance audit.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Scan hot-path code for allocation violations, lock misuse, and performance anti-patterns. Zero-tolerance audit.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
ADD (AI-Driven Development) — a minimal, state-tracked workflow for building software where the AI writes the code and the human owns direction and verification. Drives every feature through one lean TASK.md: Specify → Scenarios → Contract → Tests → Build → Verify → Observe, with red/green TDD built in. Use this skill whenever working in a repo that has a `.add/` directory, when the user says "add", "start a task", "next phase", "specify this feature", "ADD method", or "AI-driven development", or when scaffolding a new feature and you want spec/tests-first discipline instead of vague-prompt coding. Also use it to resume work across sessions (it reads `.add/state.json` so you never re-read the whole repo).
Scaffold a new Redis command implementation with dispatch entry, handler, ACL, tests, and consistency test entry. Args: COMMAND_NAME [category].
Scaffold a new CUDA kernel with Rust integration via cudarc. Args: kernel_name [f32|f16]. Creates .cu kernel, Rust wrapper, CPU fallback, and benchmark.
Verify code compiles and tests pass under both runtime-tokio and runtime-monoio feature sets. Run before committing runtime-adjacent changes.
Benchmark GPU-accelerated operations (vector distance, batch computation) against CPU baselines. Requires CUDA toolkit. Args: vector|distance|batch|all.
Verify moon command behavior matches Redis exactly. Args: command name(s) or --category <name>. Uses redis-cli against both servers.
| name | check-hotpath |
| description | Scan hot-path code for allocation violations, lock misuse, and performance anti-patterns. Zero-tolerance audit. |
Hot path invariant checker for moon.
src/command/*.rs — command dispatchsrc/protocol/*.rs — RESP parsingsrc/shard/event_loop.rs — shard event loopsrc/shard/spsc_handler.rs — cross-shard message handlingsrc/io/*.rs — I/O driverssrc/storage/dashtable/*.rs — hash table lookupsGrep for forbidden patterns in hot-path files:
grep -rn 'Box::new\|Vec::new()\|String::new()\|Arc::new\|\.clone()\|format!\|\.to_string()\|\.to_owned()' src/command/ src/protocol/ src/shard/event_loop.rs src/io/
Exceptions: Vec::with_capacity() at end of command path is acceptable.
grep -rn 'Mutex::new\|RwLock::new\|\.lock()\|\.read()\.\|\.write()\.' src/command/ src/shard/event_loop.rs src/io/
Flag: any lock held across .await, any std::sync lock (should be parking_lot).
grep -rn 'Instant::now()\|SystemTime::now()\|std::time' src/command/ src/shard/event_loop.rs
Should use shard-cached timestamp instead.
grep -rn '\.to_vec()\|\.to_owned()\|copy_from_slice' src/protocol/ src/io/
Should use Bytes::slice() for zero-copy where possible.
Find match arms with excessive cases:
grep -c '^\s*"' src/command/registry.rs 2>/dev/null || echo "Check PHF table"
For each violation:
[ALLOC|LOCK|SYSCALL|COPY|BRANCH] file.rs:line
Pattern: <what was found>
Severity: HIGH|MEDIUM|LOW
Fix: <suggested change>
Summary: total violations by category.