External Skills
Use Cadence's skills.json to invoke detection from Claude, ChatGPT, and custom agents
Cadence ships a skills.json manifest in the repository root that exposes two skills compatible with Claude tool-use, ChatGPT function calling, and the skills.sh specification.
Skills manifest: skills.json in the Cadence repository
{
"name": "cadence-ai-detection",
"version": "0.1.0",
"description": "AI-generated code detection skill for analyzing Git repositories"
}
Skills
analyze-repository
Analyze a full Git repository for suspicious AI-generated commits.
Input:
| Field | Type | Required | Description |
|---|---|---|---|
repository | string | Yes | Local path or GitHub URL of the repository |
branch | string | No | Branch to analyze (default: "main") |
output_format | "json" | "text" | No | Output format (default: "json") |
Output:
| Field | Type | Description |
|---|---|---|
suspicious_commits | array | List of flagged suspicious commits |
statistics | object | Repository analysis statistics |
total_suspicious | integer | Count of suspicious commits found |
Example (JSON):
{
"repository": "https://github.com/TryCadence/Cadence",
"branch": "main",
"output_format": "json"
}
detect-suspicious-commit
Analyze a single commit for AI-generated code patterns. Accepts the commit hash and diff additions, with optional AI-powered analysis.
Input:
| Field | Type | Required | Description |
|---|---|---|---|
commit_hash | string | Yes | Git commit hash |
additions | string | Yes | Code additions from the commit diff |
use_ai | boolean | No | Enable AI-powered analysis (default: false) |
Output:
| Field | Type | Description |
|---|---|---|
suspicious | boolean | Whether the commit is flagged |
confidence | float (0–1) | Detection confidence score |
reasons | string[] | Specific reasons the commit was flagged |
ai_analysis | string | Optional AI narrative (present when use_ai: true) |
Example:
{
"commit_hash": "a1b2c3d4",
"additions": "+ function generateReport() {\n+ // Auto-generated by AI\n+ }",
"use_ai": true
}
Using Skills with Claude
Add the Cadence skills manifest to a Claude project or MCP server configuration:
{
"mcpServers": {
"cadence": {
"command": "cadence",
"args": ["skills", "--serve"],
"env": {
"CADENCE_AI_ENABLED": "true",
"CADENCE_AI_KEY": "${OPENAI_API_KEY}"
}
}
}
}
Claude can then invoke analyze-repository or detect-suspicious-commit directly in conversation:
"Analyze the repository at https://github.com/owner/repo for AI-generated commits"
Using Skills with ChatGPT
Register Cadence skills as OpenAI function definitions. The input schema from skills.json maps directly to the OpenAI function calling format:
{
"name": "analyze_repository",
"description": "Analyze a Git repository for suspicious AI-generated commits",
"parameters": {
"type": "object",
"properties": {
"repository": {
"type": "string",
"description": "Local path or GitHub URL of the repository"
},
"branch": {
"type": "string",
"description": "Branch to analyze"
}
},
"required": ["repository"]
}
}
Configuration Thresholds
The skills.json includes default analysis thresholds used by heuristic detection:
| Threshold | Default | Description |
|---|---|---|
suspicious_additions | 500 | Lines added per commit before flagging |
suspicious_deletions | 1000 | Lines deleted per commit before flagging |
max_additions_per_min | 100 | Rate of additions that suggests automation |
max_deletions_per_min | 500 | Rate of deletions that suggests automation |
min_time_delta_seconds | 60 | Minimum time between commits to avoid rate-flagging |
These can be overridden via the Cadence configuration file. See Configuration for details.