agentleFS
fkonovalovfkonovalov/rdrr/AGENTS.md

rdrr

AGENTS.md195 starsChanged 8 months agoMITView on GitHub

This file provides context for AI assistants working in this repository. rdrr is a TypeScript library and CLI that converts any URL into clean markdown. 10x fewer tokens for AI agents. Supports: webpages, YouTube transcripts, GitHub issues/PRs/discussions/files, Stack Overflow, npm packages, X/Twitter, llms.txt.

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,736 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 repositoryOne other file it gives its agents.

The file

Show its rules and text

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

15 rules. About 0 are common, 7 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No classes. Use factory functions, closures, or plain objects.

    line 54
  2. Very specific:

    Keep domain boundaries clean -- provider/ depends on extract/, never the reverse.

    line 70
  3. Very specific:

    Prefer const over let. Never use var.

    line 74
  4. Very specific:

    Prefer for...of over .forEach().

    line 75
  5. Distinctive:

    Prefer early returns over nested conditionals.

    line 76
  6. Distinctive:

    Prefer template literals over string concatenation.

    line 77
  7. Very specific:

    Prefer nullish coalescing (??) over logical OR (||) for defaults.

    line 78
  8. Very specific:

    Prefer optional chaining (?.) over manual null checks.

    line 79
  9. Distinctive:

    Use discriminated unions over optional fields where variants are distinct.

    line 80
  10. Very specific:

    Use satisfies for type-safe object literals without widening.

    line 82
  11. Very specific:

    Use vitest -- import describe, it, expect, vi from "vitest".

    line 96
  12. Very specific:

    All dependencies are pinned (no ^ or ~).

    line 100
  13. Distinctive:

    Prefer modern, lightweight packages.

    line 101
  14. Distinctive:

    After completing any implementation, review the code for:

    line 113
  15. Distinctive:

    Run /simplify before presenting code to the user.

    line 121

≈ “Common” is an estimate: at least 1 in 5 of the 16,597 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

This file provides context for AI assistants working in this repository.

What is this project?

rdrr is a TypeScript library and CLI that converts any URL into clean markdown. 10x fewer tokens for AI agents.

Supports: webpages, YouTube transcripts, GitHub issues/PRs/discussions/files, Stack Overflow, npm packages, X/Twitter, llms.txt.

Project structure

PathRole
src/index.tsLibrary entry -- barrel exports
src/cli.tsCLI entry (commander)
src/rdrr.tsOrchestrator: parse(url) detects type, routes to provider
src/detect.tsURL classification (YouTube, GitHub, npm, X, webpage)
src/types.tsPublic types
src/shared.tsShared utilities
src/extract/Domain: HTML content extraction engine
src/extract/sites/Site-specific extractors (reddit, twitter, etc.)
src/extract/elements/Element processors (code, math, images, footnotes)
src/extract/filters/Content filtering (hidden, scoring, patterns)
src/extract/utils/DOM helpers
src/provider/Domain: Content providers (web, youtube, github, stackoverflow, npm, x)

Common commands

pnpm build       # tsc --noEmit && tsdown
pnpm dev         # tsdown --watch
pnpm test        # vitest run
pnpm lint        # knip && oxlint ./src
pnpm fmt         # oxfmt --write .

Code conventions

TypeScript

  • Strict TypeScript. Avoid any -- use unknown and narrow.
  • noUncheckedIndexedAccess is enabled -- always handle undefined from index access.
  • verbatimModuleSyntax -- use import type for type-only imports.
  • Target: ES2022. Use modern syntax: Object.hasOwn(), Array.at(), structuredClone().

Functions

  • Arrow functions everywhere. No function declarations except top-level exports when hoisting is needed.
  • Functional style -- prefer pure functions, avoid mutation.
  • No classes. Use factory functions, closures, or plain objects.
  • Small focused files -- each file does one thing, ideally under 100 lines (data files excepted).
  • 600+ lines in a file is a signal to decompose. Split into focused modules by responsibility.

Exports

  • Named exports only -- no default exports anywhere.
  • Each module exposes its public surface through an index.ts.
  • Types are exported alongside values: export { foo, type FooType }.

Architecture (DDD)

  • Organize code by domain, not by technical layer.
  • Each domain directory (extract/, provider/) is self-contained with its own types, utils, and index.
  • Site-specific logic belongs in extract/sites/, not scattered across generic modules.
  • Generic modules (engine, filters, elements) must not contain site-specific conditionals. If a site needs special handling, create a site extractor.
  • Keep domain boundaries clean -- provider/ depends on extract/, never the reverse.

Patterns

  • Prefer const over let. Never use var.
  • Prefer for...of over .forEach().
  • Prefer early returns over nested conditionals.
  • Prefer template literals over string concatenation.
  • Prefer nullish coalescing (??) over logical OR (||) for defaults.
  • Prefer optional chaining (?.) over manual null checks.
  • Use discriminated unions over optional fields where variants are distinct.
  • Destructure parameters when accessing 2+ properties.
  • Use satisfies for type-safe object literals without widening.

Naming

  • Files: kebab-case (small-images.ts).
  • Types/interfaces: PascalCase (ParseResult).
  • Functions/variables: camelCase (extractVideoId).
  • Constants (module-level data): UPPER_SNAKE_CASE (BLOCK_ELEMENTS).
  • Boolean variables/params: prefix with is, has, should, can.

Tests

  • Tests live in __tests__/ subdirectory next to the module they cover.
  • Files are named <subject>.test.ts.
  • Use vitest -- import describe, it, expect, vi from "vitest".

Dependencies

  • All dependencies are pinned (no ^ or ~).
  • Prefer modern, lightweight packages.

Formatting

  • No semicolons.
  • Double quotes.
  • 120 char line width.
  • Sorted imports (type imports first).
  • Formatter: oxfmt. Linter: oxlint.

Code Review Standards

After completing any implementation, review the code for:

  • Functions longer than 30 lines (likely doing too much)
  • Logic duplicated more than twice (extract to utility)
  • Any any type usage in TypeScript (replace with real types)
  • Components with more than 3 props that could be grouped into an object
  • Missing error handling on async operations

Run /simplify before presenting code to the user.

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.