# XavvyNess AI Code Reviewer (`xavvyness/xavvyness-code-reviewer`) Actor

Point at any public GitHub repo or paste code — get a structured review in seconds. Scores 1–10 with Critical Issues, Improvements, and Positives. Security, Performance, Style, and Full focus modes. Auto-detects main/master branch.

- **URL**: https://apify.com/xavvyness/xavvyness-code-reviewer.md
- **Developed by:** [XavvyNess](https://apify.com/xavvyness) (community)
- **Categories:** AI, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $50.00 / 1,000 code review reports

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## XavvyNess Code Reviewer

**AI code review agent.** Point it at any public GitHub repo or paste code directly — get a structured review with critical issues, improvement suggestions, and a score out of 10. Powered by Claude 3.5 Haiku for security/full reviews, Llama 3.3 70B for style/performance.

### Demo

<!-- VIDEO_PLACEHOLDER: code-reviewer -->
> 🎬 **Video demo coming soon.** Upload `code-reviewer.mp4` to YouTube, then run `python3 scripts/actor-video-gen.py --embed-readmes` to embed it here automatically.

---

### What it does

1. **Fetches real source files** via GitHub API — not just metadata, actual code content
2. **Smart file prioritization** — scores and selects the most important files (skips `node_modules`, `dist`, lock files, binaries)
3. **Auto-detects default branch** — works on repos using `main`, `master`, or any other default
4. **Structured review output** — Summary, Critical Issues, Improvements, Positives, Score/10
5. **Two input modes** — GitHub repo URL or raw code paste

---

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `repoUrl` | string | — | GitHub repo URL (e.g. `https://github.com/owner/repo`) |
| `code` | string | — | Paste raw code instead of a repo URL |
| `language` | string | — | Language hint for inline code (e.g. `typescript`) |
| `focus` | enum | `full` | `full` · `security` · `performance` · `style` |
| `branch` | string | `main` | Branch to review (auto-detected if repo uses different default) |
| `maxFiles` | integer | `10` | Max files to review (1–50) |

One of `repoUrl` or `code` is required.

#### Example — GitHub repo

```json
{
  "repoUrl": "https://github.com/expressjs/express",
  "focus": "security",
  "maxFiles": 20
}
````

#### Example — paste code

```json
{
  "code": "const query = `SELECT * FROM users WHERE id = ${req.params.id}`",
  "language": "javascript",
  "focus": "security"
}
```

***

### Example output

Real output from a live run on `apify/apify-sdk-js`:

```json
{
  "repo": "https://github.com/apify/apify-sdk-js",
  "source": "github",
  "branch": "master",
  "focus": "full",
  "filesReviewed": 5,
  "files": ["src/actor.ts", "src/charging.ts", "src/configuration.ts", "src/index.ts", "src/input-schemas.ts"],
  "score": 8,
  "summary": "The codebase is well-structured and follows good practices, with clear documentation. Organized into modules with specific responsibilities — actor management, charging, configuration, and input schema handling. Overall the code is well-written and architecture is sound.",
  "review": "### Summary\nWell-structured with clear documentation...\n\n### Critical Issues 🔴\nNone found. Free of security vulnerabilities, syntax errors, or major logical flaws.\n\n### Improvements 🟡\n1. **Error Handling** — More comprehensive error logging would help debug edge cases.\n2. **Type Definitions** — `Dictionary` and `Record` types could be more specific.\n3. **Code Duplication** — `readJSONIfExists` appears in multiple modules.\n\n### Positives ✅\n- Clear module separation with single responsibilities\n- Comprehensive TypeScript types throughout\n- Well-documented public API surface\n\n### Score\n8/10 — Production-ready with only minor improvements needed.",
  "criticalIssues": 0,
  "model": "groq/llama-3.3-70b-versatile",
  "agent": "XavvyNess Code Reviewer",
  "runAt": "2026-04-08T22:22:10.000Z"
}
```

***

### Review structure

Every review follows this exact format:

```
### Summary
2-3 sentence overall assessment

### Critical Issues 🔴
Must-fix bugs, security holes, or broken logic
(or "None found" if the code is clean)

### Improvements 🟡
Recommended changes with brief reasoning

### Positives ✅
What's done well

### Score
X/10 — one sentence justification
```

***

### Focus modes and model routing

| Focus | Model | Best for |
|---|---|---|
| `security` | Llama 3.3 70B (Groq) | SQL injection, XSS, auth issues, OWASP Top 10 |
| `full` | Llama 3.3 70B (Groq) | Comprehensive review across all areas |
| `performance` | Llama 3.3 70B (Groq) | N+1 queries, memory leaks, unnecessary re-renders |
| `style` | Llama 3.3 70B (Groq) | Readability, naming, complexity, best practices |

All reviews use Llama 3.3 70B via Groq — fast, structured output, and free-tier eligible.

***

### File prioritization

The actor scores files by importance before fetching:

1. `src/`, `app/`, `lib/`, `server/`, `api/` — source directories (highest priority)
2. Entry points: `index.ts`, `main.js`, `app.py`, `server.go`
3. Dependency manifests: `package.json`, `Cargo.toml`, `go.mod`, `requirements.txt`
4. Any `.ts`, `.js`, `.py`, `.go`, `.rs`, `.java` file (lowest priority)

Skipped automatically: `node_modules`, `dist`, `build`, `.next`, `*.lock`, `*.min.js`, `*.map`, images, fonts.

***

### Use cases

- **Pre-merge security check** — "Does this PR introduce any vulnerabilities?"
- **Open-source due diligence** — "Is this library safe to add as a dependency?"
- **Code quality gate** — "Score this before we ship to production"
- **Learning tool** — "What would a senior engineer say about my code?"
- **Compliance prep** — "Flag anything that might fail a SOC2 audit"
- **PR review assist** — Paste the changed code, get a structured second opinion

***

### Integration

#### Via Apify JavaScript client

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });

const run = await client.actor('AqpYDXAFzXWOCe10G').call({
  repoUrl: 'https://github.com/expressjs/express',
  focus: 'security',
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(`Score: ${items[0].score}/10`);
console.log(items[0].review);
```

#### Via HTTP API

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/AqpYDXAFzXWOCe10G/runs?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "repoUrl": "https://github.com/expressjs/express",
    "focus": "full"
  }'
```

#### Via Make.com / Zapier

Use the **Apify** module → **Run Actor** action. Actor ID: `AqpYDXAFzXWOCe10G`. Map `{{score}}`, `{{summary}}`, and `{{review}}` from the output to your next step (Slack notification, database write, email, etc.).

***

### Private repositories

To review a private GitHub repository, add your GitHub personal access token to the actor's environment variables:

- Key: `GITHUB_TOKEN`
- Value: A GitHub PAT with `repo` scope

The token is used only to authenticate GitHub API requests during the run and is never stored or logged.

***

### Pricing

**$0.05 per review** ($50.00 per 1,000 reviews) — PAY\_PER\_RESULT. **Failed runs are not charged** — you only pay for completed reviews.

***

### Limitations

- Analyzes up to `maxFiles` files (default 10, configurable up to 50). For very large repos, the most important files are prioritized automatically.
- File content is truncated at 3,000 characters per file to fit within model context limits. Full files are fetched but only the first 3,000 chars are reviewed.
- Works best on repos with clear source structure. Monorepos with unusual layouts may require specifying a subdirectory (planned feature).
- Only public repos are supported without a `GITHUB_TOKEN`.

***

### About XavvyNess

XavvyNess is an AI agent platform focused on practical, production-ready automation. This actor is part of a suite of research and development tools built for developers and operators who need real answers fast.

Questions or feature requests → open an issue or contact us via the Apify Store.

# Actor input Schema

## `repoUrl` (type: `string`):

URL of the GitHub repo to review (e.g. https://github.com/owner/repo)

## `code` (type: `string`):

Paste raw code here instead of a repo URL

## `language` (type: `string`):

Programming language (optional, helps the reviewer)

## `focus` (type: `string`):

Which aspect of the code to focus the review on

## `branch` (type: `string`):

Branch to review (only used with repoUrl). Auto-detected if the repo uses a different default branch.

## `maxFiles` (type: `integer`):

Maximum number of source files to fetch and review (1–50). The most important files are prioritized automatically.

## `githubToken` (type: `string`):

Optional GitHub personal access token for reviewing private repositories. Needs 'repo' scope.

## Actor input object example

```json
{
  "repoUrl": "https://github.com/expressjs/express",
  "language": "typescript",
  "focus": "full",
  "branch": "main",
  "maxFiles": 10
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "repoUrl": "https://github.com/expressjs/express"
};

// Run the Actor and wait for it to finish
const run = await client.actor("xavvyness/xavvyness-code-reviewer").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "repoUrl": "https://github.com/expressjs/express" }

# Run the Actor and wait for it to finish
run = client.actor("xavvyness/xavvyness-code-reviewer").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "repoUrl": "https://github.com/expressjs/express"
}' |
apify call xavvyness/xavvyness-code-reviewer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=xavvyness/xavvyness-code-reviewer",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "XavvyNess AI Code Reviewer",
        "description": "Point at any public GitHub repo or paste code — get a structured review in seconds. Scores 1–10 with Critical Issues, Improvements, and Positives. Security, Performance, Style, and Full focus modes. Auto-detects main/master branch.",
        "version": "1.0",
        "x-build-id": "9Cb5OuaV2pYBh0qhk"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/xavvyness~xavvyness-code-reviewer/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-xavvyness-xavvyness-code-reviewer",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/xavvyness~xavvyness-code-reviewer/runs": {
            "post": {
                "operationId": "runs-sync-xavvyness-xavvyness-code-reviewer",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/xavvyness~xavvyness-code-reviewer/run-sync": {
            "post": {
                "operationId": "run-sync-xavvyness-xavvyness-code-reviewer",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "repoUrl": {
                        "title": "GitHub Repository URL",
                        "type": "string",
                        "description": "URL of the GitHub repo to review (e.g. https://github.com/owner/repo)",
                        "default": "https://github.com/expressjs/express"
                    },
                    "code": {
                        "title": "Code Snippet",
                        "type": "string",
                        "description": "Paste raw code here instead of a repo URL"
                    },
                    "language": {
                        "title": "Language",
                        "type": "string",
                        "description": "Programming language (optional, helps the reviewer)"
                    },
                    "focus": {
                        "title": "Review Focus",
                        "enum": [
                            "full",
                            "security",
                            "performance",
                            "style"
                        ],
                        "type": "string",
                        "description": "Which aspect of the code to focus the review on",
                        "default": "full"
                    },
                    "branch": {
                        "title": "Branch",
                        "type": "string",
                        "description": "Branch to review (only used with repoUrl). Auto-detected if the repo uses a different default branch.",
                        "default": "main"
                    },
                    "maxFiles": {
                        "title": "Max Files to Review",
                        "minimum": 1,
                        "maximum": 50,
                        "type": "integer",
                        "description": "Maximum number of source files to fetch and review (1–50). The most important files are prioritized automatically.",
                        "default": 10
                    },
                    "githubToken": {
                        "title": "GitHub Token (private repos)",
                        "type": "string",
                        "description": "Optional GitHub personal access token for reviewing private repositories. Needs 'repo' scope."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
