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

JSON
{
  "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:

FieldTypeRequiredDescription
repositorystringYesLocal path or GitHub URL of the repository
branchstringNoBranch to analyze (default: "main")
output_format"json" | "text"NoOutput format (default: "json")

Output:

FieldTypeDescription
suspicious_commitsarrayList of flagged suspicious commits
statisticsobjectRepository analysis statistics
total_suspiciousintegerCount of suspicious commits found

Example (JSON):

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:

FieldTypeRequiredDescription
commit_hashstringYesGit commit hash
additionsstringYesCode additions from the commit diff
use_aibooleanNoEnable AI-powered analysis (default: false)

Output:

FieldTypeDescription
suspiciousbooleanWhether the commit is flagged
confidencefloat (0–1)Detection confidence score
reasonsstring[]Specific reasons the commit was flagged
ai_analysisstringOptional AI narrative (present when use_ai: true)

Example:

JSON
{
  "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:

JSON
{
  "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:

JSON
{
  "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:

ThresholdDefaultDescription
suspicious_additions500Lines added per commit before flagging
suspicious_deletions1000Lines deleted per commit before flagging
max_additions_per_min100Rate of additions that suggests automation
max_deletions_per_min500Rate of deletions that suggests automation
min_time_delta_seconds60Minimum time between commits to avoid rate-flagging

These can be overridden via the Cadence configuration file. See Configuration for details.