Flag AI Slop and Fabricated Changes

Catches AI slop: placeholder data, fake implementations, docs claiming unbuilt behavior, references to missing files or env vars, and narrating comments.

What it flags

Flaggedsrc/billing/exchange-rates.ts
/**
 * Fetches live exchange rates from the rates provider, with caching
 * and automatic retries on failure.
 */
export async function getExchangeRate(from: string, to: string): Promise<number> {
  // Get the rates
  const rates: Record<string, number> = {
    'USD:EUR': 0.92,
    'USD:GBP': 0.79,
    'EUR:USD': 1.09,
  };

  // Return the rate
  return rates[`${from}:${to}`] ?? 1;
}
Passessrc/billing/exchange-rates.ts
import { env } from '@/lib/env';

/** Fetches the current rate from the rates provider. Throws if the pair is unknown. */
export async function getExchangeRate(from: string, to: string): Promise<number> {
  const url = new URL('/v1/rates', env.RATES_API_URL);
  url.searchParams.set('base', from);
  url.searchParams.set('symbols', to);

  const res = await fetch(url, { signal: AbortSignal.timeout(5_000) });
  if (!res.ok) {
    throw new Error(`Rates provider returned ${res.status} for ${from}:${to}`);
  }

  const body: { rates: Record<string, number> } = await res.json();
  const rate = body.rates[to];
  if (rate === undefined) {
    throw new Error(`No rate for ${from}:${to}`);
  }
  return rate;
}

Why it matters

Coding agents can produce code that compiles and reads confidently while doing little: a hard-coded return where the integration should be, a retry option that is documented but never wired up, or a config key that nothing reads. These changes pass type checks and often pass tests written by the same agent, so they get merged because they look finished. Catching them means checking the diff against what its comments, docs, and PR description say it does.

Agent instructions

cubic checks every pull request against these instructions. Paste them into AGENTS.md or Cursor rules and your AI coding tool follows them while it writes code.

AGENTS.md

Add this section to AGENTS.md at the repository root. Codex, Cursor, and other AI coding tools read it.

## Flag AI Slop and Fabricated Changes

Catch AI-generated changes that look finished but aren't, such as placeholder or fabricated behavior, claims the code doesn't back up, and references that don't resolve.
Be conservative. Flag only obvious, evidence-backed low-quality AI output in the diff.

Flag changes that:
- Ship placeholder, mock, demo, fake-data, temporary debug, or filler text to production paths without a clear reason.
- Make claims in docs, comments, config, or PR text that contradict the implementation. Distinguish claims about current behavior or verification from documented plans or explicit statements that a capability is not supported.
- Reference files, commands, routes, functions, env vars, or config keys that do not resolve in their intended environment. Check the documented setup, including aliases, generated definitions, and externally supplied inputs.
- Add duplicated, patchwork, or overengineered code where a smaller cohesive solution would clearly work.
- Add narrating comments that restate obvious code instead of explaining intent or constraints.
- Change consequential behavior without meaningful verification, add tests that bypass the behavior they claim to cover, or weaken assertions to permit a regression. For coverage concerns, identify a realistic failure the verification would miss; consider existing shared tests and relevant type or static checks.

Do not flag:
- Generated files, fixtures, snapshots, migrations, vendored code, or mechanical renames unless one of the rules above clearly applies.
- Explicitly labeled scaffolding with concrete follow-up guidance, provided unfinished behavior is isolated from active production use. A TODO does not excuse fabricated results in a live path.
- Well-scoped AI-assisted code that is cohesive and tested.

Checks every changed file.

Related agents

Included in the React, TypeScript, and Python code review standards.

Run this agent on every pull request

cubic reviews every pull request against the agents you turn on and comments on the lines that break them.

Catch this in your code