rdrr
CLAUDE.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.
In this repositoryOne other file it gives its agents.
- AGENTS.mdAGENTS.md
The file
Show its rules and text
We split this CLAUDE.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
- Distinctive: line 54
No classes. Use factory functions, closures, or plain objects.
- Very specific: line 70
Keep domain boundaries clean -- provider/ depends on extract/, never the reverse.
- Very specific: line 74
Prefer const over let. Never use var.
- Very specific: line 75
Prefer for...of over .forEach().
- Distinctive: line 76
Prefer early returns over nested conditionals.
- Distinctive: line 77
Prefer template literals over string concatenation.
- Very specific: line 78
Prefer nullish coalescing (??) over logical OR (||) for defaults.
- Very specific: line 79
Prefer optional chaining (?.) over manual null checks.
- Distinctive: line 80
Use discriminated unions over optional fields where variants are distinct.
- Very specific: line 82
Use satisfies for type-safe object literals without widening.
- Very specific: line 96
Use vitest -- import describe, it, expect, vi from "vitest".
- Very specific: line 100
All dependencies are pinned (no ^ or ~).
- Distinctive: line 101
Prefer modern, lightweight packages.
- Distinctive: line 113
After completing any implementation, review the code for:
- Distinctive: line 121
Run /simplify before presenting code to the user.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.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.
Files
CLAUDE.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.
- npm:
rdrr - Homepage: https://rdrr.app
Project structure
| Path | Role |
src/index.ts | Library entry -- barrel exports |
src/cli.ts | CLI entry (commander) |
src/rdrr.ts | Orchestrator: parse(url) detects type, routes to provider |
src/detect.ts | URL classification (YouTube, GitHub, npm, X, webpage) |
src/types.ts | Public types |
src/shared.ts | Shared 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-- useunknownand narrow. noUncheckedIndexedAccessis enabled -- always handleundefinedfrom index access.verbatimModuleSyntax-- useimport typefor type-only imports.- Target: ES2022. Use modern syntax:
Object.hasOwn(),Array.at(),structuredClone().
Functions
- Arrow functions everywhere. No
functiondeclarations 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 onextract/, never the reverse.
Patterns
- Prefer
constoverlet. Never usevar. - Prefer
for...ofover.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
satisfiesfor 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-- importdescribe,it,expect,vifrom"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
anytype 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.
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
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.

