agentleFS
AboudjemAboudjem/sniff/AGENTS.md

sniff

AGENTS.md4 starsChanged 6 months agoApache-2.0View on GitHub

Instructions for AI agents and coding assistants working in, or invoking, this repository. Plain Markdown, no required fields (per the AGENTS.md convention: the agent simply parses the text below). Human-facing docs live in README.md; this file holds the extra context an agent needs. sniff catches broken pages in a running web app before users do. It walks the app in a real browser with no window (headless) and reports each page bug with the route, the steps that reproduce it…

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 35,266 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository5 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Prefer the MCP sniff tool over the CLI when running inside an agent host (Claude Code, Cursor, VS Code/Copilot, Codex, Gemini CLI, …

    line 11
  2. Very specific:

    mode: "run" / "discover" are legacy: prefer walk. run does a source+browser audit.

    line 16
  3. Very specific:

    Every finding is a QaFinding (see src/crawl/types.ts).

    line 36
  4. Distinctive:

    Keep authoring and verification as separate passes.

    line 89

≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md: sniff

Instructions for AI agents and coding assistants working in, or invoking, this repository. Plain Markdown, no required fields (per the AGENTS.md convention: the agent simply parses the text below). Human-facing docs live in README.md; this file holds the extra context an agent needs.

What this repo is

sniff catches broken pages in a running web app before users do. It walks the app in a real browser with no window (headless) and reports each page bug with the route, the steps that reproduce it and a fix. A walk clicks buttons and submits real forms, so point it at a dev or staging app. It is not a static linter. npm package sniff-qa (binaries sniff and sniff-qa); ships as both a CLI and an MCP server (Claude Code plugin); Apache-2.0; Node >= 22; no API key required.

How an agent should USE sniff

Prefer the MCP sniff tool over the CLI when running inside an agent host (Claude Code, Cursor, VS Code/Copilot, Codex, Gemini CLI, Windsurf, Continue.dev). There is one unified sniff tool; pass { mode, rootDir, baseUrl? }.

  • mode: "walk" (RECOMMENDED, for a running app): drives a real browser, walks the app's user flows, and returns real bugs with reproduction proof. Pass rootDir (absolute project path) and, optionally, baseUrl (the running app's URL). If baseUrl is omitted, sniff auto-detects the local dev server. If no app is running, it degrades to a source scan and tells you so via a note field (start the dev server or pass baseUrl to get runtime bugs). Useful options: maxPages (default 25), mobile (default true, the 375px responsive pass), all (default false, include uncertain findings).
  • mode: "scan" (source-only, no browser): pass rootDir only. Finds placeholder/TODO/console.log/dead links/etc. by reading source. Works offline; no browser needed.
  • mode: "report": load the last results for rootDir (format: "json" | "summary").
  • mode: "run" / "discover" are legacy: prefer walk. run does a source+browser audit; discover does scenario-based E2E.

Handling the Playwright setup gate

The first browser run needs two one-time downloads: the browser engine (Playwright, axe-core, Lighthouse: about 180 MB to download, about 195 MB on disk) and Chromium (about 260 MB to download, about 535 MB on disk). Sizes are measured on macOS arm64 and vary by platform. They are not npm dependencies, so the MCP server itself starts in seconds. The MCP browser modes do not silently shell out to download them (the download takes about a minute). Instead they return:

{ "needsSetup": "playwright-browsers", "projects": ["chromium"],
  "installCommand": "npx -y sniff-qa@<version> install chromium",
  "installSizeMb": 440, "downloadSizeMb": 440, "diskSizeMb": 730,
  "sizeNote": "about 440 MB to download, about 730 MB on disk (measured on macOS arm64, varies by platform)",
  "hint": "Run the sniff_install MCP tool with the same projects, or run the install command manually, then retry." }

When you see needsSetup: "playwright-browsers": call the sniff_install MCP tool with the same projects, then retry the original sniff call. Do not report this as a failure; it is expected on first use. Disclose the one-time download (sizeNote) to the user honestly. sniff_install sends MCP progress notifications when your client passes a progress token. A walk that finds a half-downloaded browser returns the same needsSetup result. mode: "scan" needs neither download.

The narrow tools (sniff_scan, sniff_run, sniff_discover, sniff_report, sniff_install) remain registered for back-compat and scoped capabilities, but new work should go through the unified sniff tool.

Finding output schema

Every finding is a QaFinding (see src/crawl/types.ts). A finding without reproduction proof is not a finding; the engine never emits one without at least a route and ordered steps.

interface QaFinding {
  ruleId: string;               // e.g. "route/broken-page"
  issueClass: number;           // 1–12, see the table below
  title: string;
  severity: Severity;           // critical | high | medium | low | info
  confidence: 'confirmed' | 'likely' | 'uncertain';
  reproduction: {
    url: string;                // full URL observed
    route: string;              // normalized pathname (grouping/scoring)
    steps: string[];            // ordered, human-readable actions
    screenshotPath?: string;    // screenshot captured at the finding
    consoleExcerpt?: string[];  // relevant console errors/warnings
    networkExcerpt?: string[];  // relevant failed/relevant network lines
  };
  suggestedFix: string;
  needsOutOfBandVerification?: boolean; // true when the real outcome can only
                                        // be confirmed outside the browser
}

Confidence semantics: confirmed = deterministically reproduced with proof (HTTP 500, axe violation, measured overflow); likely = a strong heuristic fired but a benign explanation is conceivable; uncertain = worth a look but easily a false positive, suppressed by default, surfaced only with all: true / --all. Why false positives stay low: a first-party noise filter drops favicons/analytics/HMR/expected-auth/engine-aborts, axe-core (zero-false-positive by design) backs the accessibility findings, and a broken page is reported once rather than re-flagged.

The 12 issue classes (issueClass)

  1. Broken pages/routes (4xx/5xx, blank renders, crash screens)
  2. Broken links (internal + external)
  3. Console errors / uncaught exceptions / failed network requests during interaction
  4. Empty data + placeholder/fake data (lorem, TODO, test@test.com)
  5. Broken forms (dead submit button, validation that never fires)
  6. State-loss (fill a form, go back, it's wiped)
  7. Flow regressions / dead-ends
  8. Bad loading states (infinite spinner) + missing error states
  9. Broken async outcomes (submitted but no success feedback, flagged needsOutOfBandVerification)
  10. Responsive issues (overflow, tiny tap targets)
  11. Accessibility (missing alt/labels, contrast, via axe-core)
  12. Unclear/buried primary actions

What the agent should NOT do

  • Do not claim a fix worked without re-running sniff. A fix is verified by re-running mode: "walk" against the running app and confirming the finding is gone, not by reading the diff.
  • Do not treat uncertain findings as confirmed. They are hidden by default for a reason; only escalate them after independent verification, and never present them as proven defects.
  • Do not run against production without care. walk drives a real browser and submits forms / clicks buttons. Point it at a dev/staging server (or the auto-detected local dev server). Against any shared environment, get explicit user sign-off first; never run destructive flows against live data.
  • Do not invent findings, severities, or fixes. Report only what sniff produced, with its reproduction proof attached. Do not fabricate routes, steps, or screenshots.

Developing in this repo

  • Build: npm run build (tsup → dist/). Typecheck: npm run typecheck.
  • Test: npx vitest run (full suite). Co-located *.test.ts files live next to the source they cover (e.g. src/mcp/server.test.ts, src/crawl/, src/discovery/).
  • Regression fixture & scorer (sniff-tests/): planted-bugs/ is a deliberately broken app (21 planted bugs across all 12 issue classes plus a clean control page at /clean); score-fixture.mjs (using score-lib.mjs) scores a sniff JSON report against planted-bugs/MANIFEST.json for recall, precision proxy, and hard false positives on the clean page. The locked target is 21/21 found at 100% precision with 0 false positives. run-crawl.mjs drives a crawl against the fixture; mcp-smoke.mjs smoke-tests the MCP server.
  • MCP surface lives in src/mcp/ (server.ts registers tools; handlers.ts implements them). The flow-walk engine is in src/crawl/; the finding/report types are in src/crawl/types.ts and src/core/types.ts.
  • Keep authoring and verification as separate passes. After any engine change, re-run the fixture scorer and the vitest suite; do not declare done until both pass.

10x marketplace

sniff is part of the 10x plugin marketplace (github.com/Aboudjem/10x). Install via: claude plugin marketplace add Aboudjem/10x then claude plugin install sniff@10x.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.