{"skill":{"slug":"astrai-code-review","displayName":"Astrai Code Review","summary":"AI-powered code review with intelligent model routing — saves 40%+ vs always using the most expensive model","description":"---\nname: astrai-code-review\ndescription: AI-powered code review with intelligent model routing — saves 40%+ vs always using the most expensive model\nversion: 1.0.0\nhomepage: https://github.com/beee003/astrai-openclaw\nmetadata:\n  clawdbot:\n    emoji: \"🔍\"\n    requires:\n      env: [\"ASTRAI_API_KEY\"]\n    primaryEnv: \"ASTRAI_API_KEY\"\n    files: [\"plugin.py\", \"config.example.toml\"]\ntags: [code-review, inference, routing, cost-optimization, pr-review, diff, quality]\n---\n\n# Astrai Code Review\n\nAI-powered code review with intelligent model routing.\nComplex logic goes to powerful models. Formatting and style goes to fast, cheap ones. You save 40%+ without sacrificing quality.\n\n## What it does\n\n- **Smart routing for reviews**: Astrai analyzes the diff complexity and routes to the optimal model. A gnarly concurrency bug gets Opus. A missing semicolon gets Haiku. You only pay for the intelligence you need.\n- **Structured output**: Every review returns typed issues with file, line number, severity (critical/warning/info), message, and a concrete suggestion.\n- **Strictness modes**: Standard catches bugs and logic errors. Strict adds style and best-practice checks. Security mode focuses on vulnerabilities, injection, auth, and data exposure.\n- **BYOK (Bring Your Own Keys)**: Your provider API keys stay with you. Astrai decides which model to use, then calls the provider using YOUR key. You pay providers directly.\n- **Cost tracking**: Every review response includes the cost and how much you saved vs always using the most expensive model.\n- **Local-only mode**: If you only set `ASTRAI_API_KEY` without provider keys, Astrai uses its own hosted models. Still routed intelligently, still cheap.\n\n## Setup\n\n1. Get a free API key at [as-trai.com](https://as-trai.com)\n2. Set `ASTRAI_API_KEY` in your environment or skill config\n3. Optionally add provider API keys for BYOK routing (e.g. `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`)\n4. Run `/review` on any diff or PR\n\n## Usage\n\n```\n/review                     Review the current diff (staged changes)\n/review --strict            Strict mode: bugs + style + best practices\n/review --focus security    Security-focused review (vulns, injection, auth)\n/review --file src/auth.py  Review a specific file\n```\n\n### Examples\n\n**Basic review of staged changes:**\n```\n/review\n```\nReturns issues found in the current diff with severity levels and suggestions.\n\n**Strict review for a PR:**\n```\n/review --strict\n```\nCatches not just bugs but also style violations, naming issues, and missed best practices.\n\n**Security audit:**\n```\n/review --focus security\n```\nFocuses on SQL injection, XSS, auth bypass, hardcoded secrets, insecure deserialization, and other vulnerability classes.\n\n## Environment Variables\n\n| Variable | Required | Description | Default |\n|---|---|---|---|\n| `ASTRAI_API_KEY` | Yes | Your API key from as-trai.com | -- |\n| `ANTHROPIC_API_KEY` | No | Anthropic key for BYOK routing | -- |\n| `OPENAI_API_KEY` | No | OpenAI key for BYOK routing | -- |\n| `GOOGLE_API_KEY` | No | Google key for BYOK routing | -- |\n| `DEEPSEEK_API_KEY` | No | DeepSeek key for BYOK routing | -- |\n| `MISTRAL_API_KEY` | No | Mistral key for BYOK routing | -- |\n| `GROQ_API_KEY` | No | Groq key for BYOK routing | -- |\n| `TOGETHER_API_KEY` | No | Together key for BYOK routing | -- |\n| `FIREWORKS_API_KEY` | No | Fireworks key for BYOK routing | -- |\n| `COHERE_API_KEY` | No | Cohere key for BYOK routing | -- |\n| `PERPLEXITY_API_KEY` | No | Perplexity key for BYOK routing | -- |\n| `REVIEW_STRICTNESS` | No | standard, strict, or security | standard |\n\n## External Endpoints\n\n| Endpoint | Purpose | Data Sent |\n|---|---|---|\n| `https://as-trai.com/v1/chat/completions` | Code review inference via intelligent routing | Diff content, file context, review instructions |\n\n## Security & Privacy\n\n- All requests authenticated via API key in the Authorization header\n- Diffs are sent to the Astrai routing API, which forwards to the selected provider\n- In BYOK mode, provider keys are sent via encrypted header (`X-Astrai-Provider-Keys`) and never stored\n- No diffs, code, or review results are retained by Astrai after the request completes\n- Source code is fully open: [github.com/beee003/astrai-openclaw](https://github.com/beee003/astrai-openclaw)\n\n## Model Invocation\n\nThis skill sends code diffs to the Astrai routing API. The router classifies the review complexity and selects the best model:\n\n- **High complexity** (concurrency, security, architecture): Routes to Claude Opus, GPT-4o, or Gemini Pro\n- **Medium complexity** (logic errors, missing edge cases): Routes to Claude Sonnet, GPT-4o-mini, or Gemini Flash\n- **Low complexity** (formatting, typos, naming): Routes to Claude Haiku, GPT-4o-mini, or Gemini Flash\n\nYour prompts are processed by third-party LLM providers according to the routing decision. In BYOK mode, calls are made using your own provider API keys.\n\n## Pricing\n\nSame as Astrai platform pricing:\n\n- **Free**: 1,000 requests/day, smart routing, all strictness modes\n- **Pro** ($49/mo): Unlimited requests, priority routing, analytics dashboard\n- **Business** ($199/mo): Team dashboards, compliance exports, SLA guarantee\n","tags":{"latest":"1.0.0"},"stats":{"comments":0,"downloads":1290,"installsAllTime":1,"installsCurrent":1,"stars":0,"versions":1},"createdAt":1771217949540,"updatedAt":1779077019621},"latestVersion":{"version":"1.0.0","createdAt":1771217949540,"changelog":"Initial release: AI-powered code review with intelligent model routing","license":null},"metadata":{"setup":[{"key":"ASTRAI_API_KEY","required":true}],"os":null,"systems":null},"owner":{"handle":"beee003","userId":"s179m5j58p1k2n21t3qh7vk085885k65","displayName":"beee003","image":"https://avatars.githubusercontent.com/u/135258985?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1779969018011}}