AI-powered code review for Q/kdb+ — catch bugs in the most terse language in finance
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install q-kdb-code-review或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install q-kdb-code-review⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/q-kdb-code-review/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: q-kdb-code-review description: AI-powered code review for Q/kdb+ — catch bugs in the most terse language in finance version: 1.0.0 homepage: https://github.com/beee003/astrai-openclaw metadata: clawdbot: emoji: "⚡" requires: env: ["ASTRAI_API_KEY"] primaryEnv: "ASTRAI_API_KEY" files: ["plugin.py", "config.example.toml"] tags: [q, kdb, kdb-plus, quant, finance, code-review, hft, trading, timeseries] ---
AI-powered code review for Q/kdb+ — catch bugs, performance issues, and security vulnerabilities in the most terse language in quantitative finance.
Reviews Q/kdb+ code with deep understanding of Q idioms, performance patterns, and common pitfalls. Built for quant developers, kdb+ DBAs, and trading infrastructure teams.
Catches:
peach parallelism opportunities for embarrassingly parallel operationseval/value usage on user-supplied strings (Q injection) g# `` grouped attributes on high-cardinality join columnsaj (asof joins) or wj (window joins)Strictness modes:
| Mode | What it checks | |------|---------------| | standard | Bugs, correctness, type errors, join semantics, null handling | | strict | Everything in standard + performance (attributes, peach, vector ops) + style | | security | Everything in standard + injection via string eval, unprotected IPC handlers, exposed .z.pw, port exposure |
Intelligent routing via Astrai: Complex algorithmic Q (custom signal generation, real-time CEP) routes to powerful models. Simple table operations (selects, inserts, schema definitions) route to cheaper, faster models. You get the best result at the lowest cost.
BYOK (Bring Your Own Keys): Your provider API keys, your billing. Astrai routes to the best model among your configured providers.
```bash export ASTRAI_API_KEY="your_key_here" ```
```bash export ANTHROPIC_API_KEY="sk-ant-..." export OPENAI_API_KEY="sk-..." ```
/review-q on any .q file/review-q Review current Q file
/review-q --strict Strict mode: bugs + performance + style
/review-q --focus security Security mode: eval injection, IPC, .z.pw
/review-q --file tick.q Review a specific file
Reviewing tick.q (strict mode)...
Model: claude-opus-4-6 via Astrai
Found 3 issues:
[CRITICAL] Line 12: Missing `s# attribute on time column
`trade` table uses `aj` but `time` column lacks sorted attribute.
Without `s#`, asof join scans linearly — O(n) instead of O(log n).
Fix: trade: `trade upsert update `s#time from trade
[WARNING] Line 34: Using `each` where vector operation suffices
{x*y} each' (price;qty) can be replaced with price*qty
Vector multiply is ~100x faster than each-both.
[INFO] Line 45: Consider `peach` for independent symbol processing
Processing each symbol sequentially. Since operations are independent,
`peach` would utilize all cores.
Fix: results: func peach syms
Summary: 1 critical, 1 warning, 1 info. Focus on the missing sorted
attribute — it will cause aj performance to degrade from microseconds
to milliseconds at scale.
| Variable | Required | Description | |----------|----------|-------------| | ASTRAI_API_KEY | Yes | API key from as-trai.com | | ANTHROPIC_API_KEY | No | BYOK: Anthropic provider key | | OPENAI_API_KEY | No | BYOK: OpenAI provider key | | GOOGLE_API_KEY | No | BYOK: Google AI provider key | | DEEPSEEK_API_KEY | No | BYOK: DeepSeek provider key | | MISTRAL_API_KEY | No | BYOK: Mistral provider key | | GROQ_API_KEY | No | BYOK: Groq provider key | | TOGETHER_API_KEY | No | BYOK: Together AI provider key | | FIREWORKS_API_KEY | No | BYOK: Fireworks AI provider key | | COHERE_API_KEY | No | BYOK: Cohere provider key | | PERPLEXITY_API_KEY | No | BYOK: Perplexity provider key | | REVIEW_STRICTNESS | No | Default strictness: standard, strict, or security |
| Endpoint | Purpose | |----------|---------| | as-trai.com/v1/chat/completions | Astrai inference router — routes Q review requests to the optimal model |
Q is unlike any mainstream programming language:
each instead of vector operations adds interpreter overhead per element./, \, ', /:, \:, ':) modify function behavior in powerful but subtle ways. +/ is reduce-add, +\ is scan-add, +' is each-both-add. Confusing these causes wrong results, not errors.Uses Astrai's inference routing. Your costs depend on the models selected:
| Plan | Rate | Includes | |------|------|----------| | Free | $0 | 1,000 requests/day | | Pro | $49/mo | 50,000 requests/day, priority routing | | Business | $199/mo | Unlimited requests, dedicated support |
With BYOK, you pay your provider directly at their rates. Astrai's routing is included in the plan price.
安装 Q Kdb Code Review 后,可以对 AI 说这些话来触发它
Help me get started with Q Kdb Code Review
Explains what Q Kdb Code Review does, walks through the setup, and runs a quick demo based on your current project
Use Q Kdb Code Review to aI-powered code review for Q/kdb+ — catch bugs in the most terse la...
Invokes Q Kdb Code Review with the right parameters and returns the result directly in the conversation
What can I do with Q Kdb Code Review in my developer & devops workflow?
Lists the top use cases for Q Kdb Code Review, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/q-kdb-code-review/ 目录(个人级,所有项目可用),或 .claude/skills/q-kdb-code-review/(项目级)。重启 AI 客户端后,用 /q-kdb-code-review 主动调用,或让 AI 根据上下文自动发现并使用。
Q Kdb Code Review 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Q Kdb Code Review 可免费安装使用。请查阅仓库了解许可证信息。
AI-powered code review for Q/kdb+ — catch bugs in the most terse language in finance
Q Kdb Code Review 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using Q Kdb Code Review
Identifies repetitive steps in your workflow and sets up Q Kdb Code Review to handle them automatically