v1.0.0 to v1.0.0

77 added, 280 removed. Audit A to A.

What this update changes in the checks

No check changed: every fixed check gives the same answer before and after this update.

A tripped check is a label, not a verdict: read the matched text and the lines below. This week's updates that newly trip a check.

---
name: ai-content-detection
description: >-
- Detect AI-generated text using a built-in ruleset, LLM analysis, and optional
- external detection APIs. Use when: auditing content for AI authorship, academic
- integrity checks, editorial review, SEO content audits, HR screening.
+ Detect AI-generated text using rule-based analysis, LLM-as-judge scoring, and
+ optional external APIs. Use when: auditing content for AI authorship, academic
+ integrity checks, editorial review, SEO content audits.
license: Apache-2.0
compatibility: "Requires Node.js 18+ and @anthropic-ai/sdk"
metadata:
author: terminal-skills
version: "1.0.0"
- category: ai-tools
+ category: data-ai
tags: ["ai-detection", "content-moderation", "llm", "text-analysis", "academic-integrity"]
- use-cases:
- - "Check if a submitted essay or article was written by AI"
- - "Audit freelance content for AI authorship before publishing"
- - "Screen job application cover letters for AI generation"
- - "Build an automated editorial review pipeline"
- agents: [claude-code, openai-codex, gemini-cli, cursor]
---
# AI Content Detection
## Overview
Detect whether text was written by a human or generated by AI using a multi-layer approach:
- 1. **Rule-based analysis** — linguistic patterns and statistical indicators any LLM can apply
- 2. **LLM-as-judge** — use Claude/GPT to score content against the ruleset
- 3. **External APIs** — optional GPTZero, Originality.ai, Winston AI for corroboration
+ 1. **Rule-based analysis** — linguistic patterns and statistical indicators
+ 2. **LLM-as-judge** — use Claude to score content against a detection ruleset
+ 3. **External APIs** — optional GPTZero or Originality.ai for corroboration
- ## The Detection Ruleset
+ ## Instructions
- When analyzing text for AI authorship, evaluate these signals:
+ ### Detection Ruleset
- ### 🔴 Strong AI Indicators (weight: high)
- - **Uniform sentence rhythm** — sentences are consistently similar in length and structure
- - **Hedging overuse** — excessive "it's important to note", "it's worth mentioning", "additionally", "furthermore", "in conclusion"
- - **Perfect paragraph structure** — every paragraph follows introduction → body → conclusion exactly
- - **Generic examples** — examples feel abstract or hypothetical, not drawn from real experience
- - **No typos or informal language** — unnaturally clean, zero colloquialisms
- - **Bullet point obsession** — converts everything into lists regardless of content type
- - **Lack of personal anecdotes** — no "I remember when...", "in my experience...", specific memories
- - **Symmetric structure** — article has perfect 3-point structure, 5-step lists, etc.
- - **Overuse of em-dashes** — AI models (especially Claude) heavily overuse em-dashes
+ When analyzing text, evaluate these signals:
- ### 🟡 Moderate AI Indicators (weight: medium)
- - **Safe, diplomatic stance** — never takes a controversial position, always "on the other hand"
- - **Abstract nouns over verbs** — "the utilization of" vs "using"
- - **No sensory details** — descriptions lack taste, smell, texture, sound
- - **Temporal vagueness** — "in recent years", "nowadays" instead of specific dates
- - **Citation without specificity** — "studies show" without naming studies
- - **Overly formal register** — uses formal language even for casual topics
- - **Repetitive key phrases** — repeats the topic keyword multiple times per paragraph
+ **Strong AI Indicators (weight: high)**
+ - Uniform sentence rhythm — sentences consistently similar in length and structure
+ - Hedging overuse — "it's important to note", "furthermore", "additionally"
+ - Perfect paragraph structure — every paragraph follows intro-body-conclusion
+ - Generic examples — abstract or hypothetical, not from real experience
+ - No typos or informal language — unnaturally clean writing
+ - Overuse of em-dashes — especially common in Claude output
- ### 🟢 Human Indicators (reduce AI suspicion)
- - Typos or self-corrections mid-sentence
+ **Moderate AI Indicators (weight: medium)**
+ - Safe, diplomatic stance — never takes a controversial position
+ - Abstract nouns over verbs — "the utilization of" vs "using"
+ - No sensory details — descriptions lack taste, smell, texture
+ - Temporal vagueness — "in recent years" instead of specific dates
+
+ **Human Indicators (reduce AI suspicion)**
+ - Typos or self-corrections
- Specific dates, names, places from personal experience
- - Unusual word choices or invented terms
- - Contradictions or inconsistencies (humans make mistakes)
- - References to very recent events (past 2-3 months)
+ - Unusual word choices or slang
- Strong opinions stated without hedging
- - Informal contractions, slang, dialect
### Statistical Signals
- - **Perplexity** — AI text has lower perplexity (more predictable word choices)
- - **Burstiness** — human text has high burstiness (mix of long and short sentences)
- - AI burstiness score < 0.3 = likely AI
- - Human burstiness > 0.5 = likely human
- - **Vocabulary richness** — type-token ratio lower in AI text
- ## Using LLM as Judge
-
- ### Prompt Template
-
- ```typescript
- const DETECTION_PROMPT = `You are an AI content detection expert. Analyze the following text and determine if it was written by a human or generated by AI.
-
- Apply the following detection ruleset:
-
- STRONG AI INDICATORS (each worth 2 points):
- - Uniform sentence rhythm and length
- - Excessive transitional phrases (furthermore, additionally, in conclusion, it's worth noting)
- - Perfect paragraph structure every time
- - Generic/hypothetical examples, no real specifics
- - Absolutely no typos or informal language
- - Overuse of bullet points and numbered lists
- - Zero personal anecdotes or first-person experiences
- - Overuse of em-dashes (—)
-
- MODERATE AI INDICATORS (each worth 1 point):
- - Always diplomatically neutral, never controversial
- - Heavy abstract nouns ("utilization" vs "using")
- - No sensory details in descriptions
- - Vague temporal references ("in recent years")
- - Unattributed statistics ("research shows")
-
- HUMAN INDICATORS (subtract 1 point each):
- - Typos or mid-sentence corrections
- - Specific personal memories or dates
- - Unusual word choices or neologisms
- - Strong controversial opinions stated plainly
- - References to very recent events
-
- TEXT TO ANALYZE:
- """
- {{TEXT}}
- """
-
- Respond with JSON:
- {
- "score": <0-10, where 0=definitely human, 10=definitely AI>,
- "verdict": "human" | "likely_human" | "uncertain" | "likely_ai" | "ai",
- "confidence": "low" | "medium" | "high",
- "signals_found": ["list of specific indicators detected"],
- "reasoning": "2-3 sentence explanation",
- "suspicious_phrases": ["exact phrases that are most AI-typical"]
- }`;
- ```
-
- ### Implementation
-
- ```typescript
- import Anthropic from "@anthropic-ai/sdk";
-
- const client = new Anthropic();
-
- interface DetectionResult {
- score: number;
- verdict: "human" | "likely_human" | "uncertain" | "likely_ai" | "ai";
- confidence: "low" | "medium" | "high";
- signals_found: string[];
- reasoning: string;
- suspicious_phrases: string[];
- }
-
- async function detectAIContent(text: string): Promise<DetectionResult> {
- const prompt = DETECTION_PROMPT.replace("{{TEXT}}", text);
-
- const response = await client.messages.create({
- model: "claude-opus-4-5",
- max_tokens: 1024,
- messages: [{ role: "user", content: prompt }],
- });
+ - **Burstiness** — human text mixes long and short sentences (score > 0.5 = likely human, < 0.3 = likely AI)
+ - **Vocabulary richness** — type-token ratio is lower in AI text
+ - **Perplexity** — AI text has more predictable word choices
- const content = response.content[0];
- if (content.type !== "text") throw new Error("Unexpected response type");
+ ### LLM-as-Judge Prompt
- const jsonMatch = content.text.match(/\{[\s\S]*\}/);
- if (!jsonMatch) throw new Error("Could not parse JSON response");
+ Use a structured prompt that lists the ruleset above and asks the LLM to return a JSON object with `score` (0-10), `verdict`, `confidence`, `signals_found`, `reasoning`, and `suspicious_phrases`.
- return JSON.parse(jsonMatch[0]);
- }
+ ### Pipeline
- // Batch analysis with chunking for long documents
- async function analyzeDocument(
- text: string,
- chunkSize = 1500
- ): Promise<{
- overall_score: number;
- verdict: string;
- chunk_results: DetectionResult[];
- summary: string;
- }> {
- const words = text.split(" ");
- const chunks: string[] = [];
+ 1. Run local analysis (burstiness, AI phrase detection) — free, instant
+ 2. Run LLM analysis with the detection prompt — costs API tokens
+ 3. Optionally call GPTZero or Originality.ai for corroboration
+ 4. Average scores from all sources for a combined verdict
- for (let i = 0; i < words.length; i += chunkSize) {
- chunks.push(words.slice(i, i + chunkSize).join(" "));
- }
+ ## Examples
- const results = await Promise.all(chunks.map(detectAIContent));
- const avgScore =
- results.reduce((sum, r) => sum + r.score, 0) / results.length;
+ ### Example 1: Detecting AI-generated blog post
- const verdict =
- avgScore >= 7
- ? "ai"
- : avgScore >= 5.5
- ? "likely_ai"
- : avgScore >= 4
- ? "uncertain"
- : avgScore >= 2.5
- ? "likely_human"
- : "human";
+ A content manager receives a freelance blog post titled "10 Ways to Boost Your Morning Routine". They paste the text into the detection pipeline:
- return {
- overall_score: Math.round(avgScore * 10) / 10,
- verdict,
- chunk_results: results,
- summary: `Analyzed ${chunks.length} section(s). Average AI score: ${avgScore.toFixed(1)}/10.`,
- };
- }
```
-
- ## Burstiness Calculator
-
- ```typescript
- function calculateBurstiness(text: string): number {
- const sentences = text.match(/[^.!?]+[.!?]+/g) || [];
- if (sentences.length < 3) return 0.5;
-
- const lengths = sentences.map((s) => s.trim().split(" ").length);
- const mean = lengths.reduce((a, b) => a + b, 0) / lengths.length;
- const variance =
- lengths.reduce((sum, l) => sum + Math.pow(l - mean, 2), 0) /
- lengths.length;
- const stdDev = Math.sqrt(variance);
-
- // Normalize: burstiness = coefficient of variation
- return stdDev / mean;
- }
-
- function analyzeLocally(text: string) {
- const burstiness = calculateBurstiness(text);
- const wordCount = text.split(/\s+/).length;
- const uniqueWords = new Set(text.toLowerCase().match(/\b\w+\b/g)).size;
- const typeTokenRatio = uniqueWords / wordCount;
+ Input text (excerpt):
+ "In today's fast-paced world, it's important to note that establishing a morning
+ routine can significantly enhance your productivity. Furthermore, research shows
+ that individuals who wake up early tend to be more successful. Additionally,
+ incorporating mindfulness practices into your morning can yield substantial benefits."
- const aiPhrases = [
- "it's worth noting",
- "it is worth mentioning",
- "furthermore",
- "additionally",
- "in conclusion",
- "in today's",
- "in recent years",
- "it's important to",
- "delve into",
- "it goes without saying",
- "needless to say",
- "as previously mentioned",
- ];
+ Local analysis:
+ Burstiness: 0.18 (low — sentences are uniform length)
+ AI phrases found: ["it's important to note", "furthermore", "additionally", "research shows"]
+ Local score: 5.0
- const foundPhrases = aiPhrases.filter((p) =>
- text.toLowerCase().includes(p)
- );
+ LLM analysis:
+ Score: 8/10
+ Verdict: "likely_ai"
+ Signals: ["uniform sentence rhythm", "excessive hedging phrases", "temporal vagueness", "no personal anecdotes"]
+ Suspicious phrases: ["In today's fast-paced world", "it's important to note", "can significantly enhance"]
- return {
- burstiness,
- typeTokenRatio,
- foundAIPhrases: foundPhrases,
- localScore: foundPhrases.length * 0.5 + (burstiness < 0.3 ? 3 : 0),
- };
- }
+ Combined score: 6.5/10 — Likely AI. Flagged for human review.
```
- ## External API Integration
+ ### Example 2: Confirming human-written article
- ```typescript
- // GPTZero API
- async function checkGPTZero(text: string, apiKey: string) {
- const response = await fetch("https://api.gptzero.me/v2/predict/text", {
- method: "POST",
- headers: {
- "x-api-key": apiKey,
- "Content-Type": "application/json",
- },
- body: JSON.stringify({ document: text }),
- });
- return response.json();
- // Returns: { documents: [{ completely_generated_prob, average_generated_prob, ... }] }
- }
+ An editor checks a personal essay from a regular contributor:
- // Originality.ai API
- async function checkOriginalityAI(text: string, apiKey: string) {
- const response = await fetch("https://api.originality.ai/api/v1/scan/ai", {
- method: "POST",
- headers: {
- "X-OAI-API-KEY": apiKey,
- "Content-Type": "application/json",
- },
- body: JSON.stringify({ content: text, aiModelVersion: "1" }),
- });
- return response.json();
- // Returns: { score: { ai: 0-1, original: 0-1 } }
- }
```
-
- ## Full Pipeline
-
- ```typescript
- async function fullDetectionPipeline(
- text: string,
- options: {
- useExternalAPIs?: boolean;
- gptzeroApiKey?: string;
- originalityApiKey?: string;
- }
- ) {
- // Step 1: Local analysis (free, instant)
- const local = analyzeLocally(text);
-
- // Step 2: LLM analysis
- const llmResult = await detectAIContent(text.slice(0, 4000));
-
- // Step 3: Optional external APIs
- const external: Record<string, any> = {};
- if (options.useExternalAPIs && options.gptzeroApiKey) {
- external.gptzero = await checkGPTZero(text, options.gptzeroApiKey);
- }
+ Input text (excerpt):
+ "I burned my toast again this morning — third time this week. My neighbor Dave,
+ who's been a barista at Groundwork Coffee on Rose Ave since 2019, once told me
+ the secret is to never trust the 'light' setting. He's wrong, obviously, but I
+ still think about it every time I smell that acrid char."
- // Combine scores
- const scores = [llmResult.score];
- if (external.gptzero?.documents?.[0]) {
- scores.push(
- external.gptzero.documents[0].completely_generated_prob * 10
- );
- }
+ Local analysis:
+ Burstiness: 0.62 (high — varied sentence lengths)
+ AI phrases found: []
+ Local score: 0.0
- const finalScore = scores.reduce((a, b) => a + b, 0) / scores.length;
+ LLM analysis:
+ Score: 1/10
+ Verdict: "human"
+ Signals: ["specific personal anecdote", "named person and place", "informal language", "humor and opinion"]
- return {
- final_score: finalScore,
- verdict: llmResult.verdict,
- confidence: scores.length > 1 ? "high" : llmResult.confidence,
- llm_analysis: llmResult,
- local_analysis: local,
- external_apis: external,
- };
- }
+ Combined score: 0.5/10 — Human-written. No flag.
```
- ## Limitations
+ ## Guidelines
- - No detection method is 100% accurate
- - Paraphrasing tools can fool detectors
- - Non-native English writers may score higher
- - Short texts (<200 words) are unreliable
- - Watermarking (C2PA) is more reliable when available
+ - No detection method is 100% accurate — always route flagged content to a human reviewer
+ - Short texts (<200 words) produce unreliable results; skip automated scoring
+ - Non-native English writers may trigger false positives; consider raising thresholds
+ - Paraphrasing tools can fool detectors — use multiple detection layers
+ - AI watermarking (C2PA) is more reliable when available
+ - For batch processing, chunk long documents into ~1500-word sections and average scores