一键导入
add-command
Scaffold a new Redis command implementation with dispatch entry, handler, ACL, tests, and consistency test entry. Args: COMMAND_NAME [category].
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Scaffold a new Redis command implementation with dispatch entry, handler, ACL, tests, and consistency test entry. Args: COMMAND_NAME [category].
用 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).
Scan hot-path code for allocation violations, lock misuse, and performance anti-patterns. Zero-tolerance audit.
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 | add-command |
| description | Scaffold a new Redis command implementation with dispatch entry, handler, ACL, tests, and consistency test entry. Args: COMMAND_NAME [category]. |
Scaffold a complete new command implementation for moon.
/add-command LPOS list — add LPOS command in list category/add-command OBJECT HELP server — add OBJECT HELP subcommandRead the registry: Find the PHF dispatch table in src/command/registry.rs (or equivalent).
Add handler in src/command/{category}.rs:
/// COMMAND_NAME key [args...]
/// Time complexity: O(?)
/// ACL categories: @{category} @read|@write @fast|@slow
pub fn cmd_command_name(args: &[Bytes], db: &mut Database) -> Frame {
if args.len() < MIN_ARGS {
return Frame::Error(Bytes::from_static(
b"ERR wrong number of arguments for 'command_name' command",
));
}
// Implementation
Frame::Null
}
Add dispatch entry in the PHF table or command registry.
Add ACL category annotation matching Redis categories.
Add unit test in the handler file's #[cfg(test)] module.
Add consistency test entry in scripts/test-consistency.sh.
Add command test entry in scripts/test-commands.sh.
Verify: Run cargo test and ./scripts/test-consistency.sh --shards 1.
Bytes::from_static() for error strings, not format!().Frame::Error for all error cases, never panic.