askill
detecting-ai-code

detecting-ai-codeSafety 90Repository

Use when auditing code for AI authorship, reviewing acquisitions/contractors, verifying academic integrity, or during code review - provides systematic tiered framework for detecting fully AI-generated AND AI-assisted code patterns with confidence scoring

4 stars
1.2k downloads
Updated 1/12/2026

Package Files

Loading files...
SKILL.md

Detecting AI-Generated Code

Overview

Systematic framework for detecting AI-generated and AI-assisted code. Uses tiered signal detection with confidence scoring.

Core principle: Check metadata FIRST (highest confidence), then comments, then code patterns. Multiple signals compound confidence.

Detection Framework (Check in Order)

Tier 1: Metadata Signals (Highest Confidence)

ALWAYS CHECK THESE FIRST - they're definitive.

SignalWhat to Look ForConfidence
Git headersCo-Authored-By: Claude, Co-Authored-By: GitHub CopilotDefinitive
Commit patternsUniform "Add X functionality" pattern across all commitsHigh
Generated footers"Generated with [Claude Code]", "Created by Copilot"Definitive
Config files.cursorrules, CLAUDE.md in repoHigh
README templateExact Claude/GPT README structure (see below)High

AI README Template Pattern:

# Project Name
## Overview
[Formal description]
## Features
- Feature 1
- Feature 2
## Installation
[Perfect instructions]
## API Endpoints (table)
## Environment Variables (table)
## Contributing
## License

If README follows this EXACT structure with perfect tables and no personality → High AI probability.

AI Commit Message Patterns:

Add user authentication with JWT tokens
Add password recovery functionality
Add comprehensive documentation      ← "comprehensive" is strong AI tell
Implement feature X
Update component Y
Fix bug in Z

Mechanical uniformity + "Add/Implement/Update/Fix" pattern → AI signal.

Human commit patterns (for contrast):

wip: payments
fix typo in readme
initial payment setup
refactor auth - cleanup
oops forgot the tests

Tier 2: Comment Patterns (High Confidence)

SignalExampleConfidence
Narrating comments"First, we...", "Here we...", "Now we..."High
Restating code// Initialize array above const arr = []High
Tutorial style"This function will...", "Let me explain..."High
Perfect grammarNo typos, formal English in all commentsMedium
Over-documentation20-line JSDoc for 5-line functionHigh

Verbatim AI Phrases:

  • "This file contains..."
  • "This function handles..."
  • "Here we define..."
  • "Now we check..."
  • "Finally, we return..."

Tier 3: Code Structure (Medium Confidence)

SignalExampleConfidence
Over-engineeringComprehensive error handling for impossible casesMedium
Template repetitionSame pattern copied across files exactlyMedium
Perfect consistencyIdentical formatting across entire codebaseLow-Medium
Defensive codingNull checks on values that can't be nullMedium

Important: Clean code alone is NOT evidence of AI. Experienced developers also write clean code.

Tier 4: Anti-Signals (What Humans Do, AI Doesn't)

These DECREASE AI probability:

Human SignalWhy
TODO/FIXME commentsAI rarely leaves work incomplete
Debug code left inconsole.log, commented code
Shortcuts/abbreviationsamt, curr, intl instead of full words
Domain jargonIndustry-specific terms, internal naming
Stack Overflow attribution"grabbed from SO", "copied from [link]"
Inconsistent formattingMixed styles within file
Pragmatic compromises"prod will have proper checks"

Confidence Scoring

Signals FoundConfidence LevelRecommendation
1 Tier-1 signalHighFlag for review
2+ Tier-2 signalsHighLikely AI-generated
Tier-2 + Tier-3 combinedMedium-HighProbably AI-assisted
Only Tier-3 signalsLow-MediumInvestigate more
Anti-signals presentReduces confidenceHuman likely involved

Compound scoring: Multiple signals from different tiers = higher confidence than multiple signals from same tier.

AI-Assisted Detection (Partial AI Use)

Look for:

  • Style jumps - Casual code with formal JSDoc blocks
  • Git history jumps - "Add comprehensive documentation" as separate commit
  • Quality inconsistency - Some files over-documented, others bare
  • Misplaced docs - JSDoc on library calls, not wrapper functions
  • Parameter mismatches - Docs describe different params than code has

This pattern: Human wrote code → Asked AI to add documentation.

Common Mistakes

MistakeReality
"Clean code = AI"Experienced developers write clean code too
Only checking codeMetadata is highest-confidence signal
Missing git history"Add comprehensive documentation" commits reveal AI use
Binary thinkingAI-assisted is different from fully AI-generated
Single signal certaintyCompound multiple signals before concluding

Quick Reference Workflow

  1. Check git log - Look for Co-Authored-By, uniform commit patterns
  2. Check README - Template structure? Perfect tables? No personality?
  3. Check file headers - Generated footers? "This file contains..." comments?
  4. Check code comments - Narrating style? Over-documentation?
  5. Check for anti-signals - TODOs? Shortcuts? Debug code?
  6. Score confidence - Compound signals from multiple tiers
  7. Report with evidence - List specific signals found

When NOT to Flag

  • Clean, well-written code (without other signals)
  • Standard patterns for solved problems (EventEmitter, validators)
  • Good documentation (if style matches rest of codebase)
  • Experienced developer output

Clean code without Tier-1 or Tier-2 signals = insufficient evidence.

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

96/100Analyzed 2/11/2026

An exceptionally well-structured and comprehensive guide for auditing codebases for AI authorship. It provides a clear tiered framework, specific patterns to look for, and a scoring system to avoid false positives.

90
100
100
100
95

Metadata

Licenseunknown
Version-
Updated1/12/2026
Publishergalihcitta

Tags

apigithubgithub-actionsllmsecurity