agentreadme

Report · marked 25 Aug 2026

mozilla/pdf.js

Solid foundations, held back in a few specific places.

JavaScript · 53,780 stars · 2,549 files · branch master

Fix these first

01
Test command is discoverable
Add a `test` script or a `test` target that runs the whole suite with no arguments. The convention is the interface — an agent tries `npm test` and `make test` before it tries reading your CI config.
02
Discoverable commands
Declare the handful of commands that matter in package.json scripts, a Makefile, or a justfile. Naming them turns guesswork into a lookup.
03
File sizes fit in context
A single file that fills the context window forces an agent to work from fragments, and it will confidently edit code it never saw. Splitting the worst offenders pays for itself immediately.

The full marking

Every deduction below names the file or setting it came from.

Instructions 23/27 A

Whether the repo tells an agent how to behave before it starts guessing.

Agent instruction file 12/12
AGENTS.md is present, which is the format the most tools read.
Also found: CLAUDE.md
Instruction quality 8/12
Real instructions, with gaps.
Worth fixing: it never states a build, test, or run command.
7,075 characters, a workable length
uses headings, so an agent can skim it
includes copyable code blocks
README as an entry point 3/3
README has a clear getting-started section.
Setup 8/14 B-

Whether an agent can install the project and get it running without a human.

Deterministic install 6/6
package-lock.json pins the dependency tree.
Found package-lock.json
Discoverable commands 0/6
No declared commands. An agent has to infer how to build and run this from the file tree.
Declare the handful of commands that matter in package.json scripts, a Makefile, or a justfile. Naming them turns guesswork into a lookup.
Environment config n/a
Not applicable — this reads as a library, with no environment to configure.
Pinned runtime version 2/2
The language runtime version is pinned.
package.json engines.node >=22.13.0 || >=24
Reproducible environment n/a
Not applicable — a library doesn't need a container to be worked on.
Verification loop 18/25 B+

Whether an agent can check its own work. This is the category that most decides whether agent output is trustworthy.

Tests exist 8/8
1592 test files against 519 source files.
e.g. src/core/file_spec.js, test/.gitignore, test/add_test.mjs
Test command is discoverable 0/7
There's no obvious way to run the tests. Even if tests exist, an agent won't reliably find the entry point.
Add a `test` script or a `test` target that runs the whole suite with no arguments. The convention is the interface — an agent tries `npm test` and `make test` before it tries reading your CI config.
Continuous integration 4/4
15 GitHub Actions workflows define what "passing" means.
Lint and format rules 3/3
eslint.config.mjs encodes the house style.
Static type checking 3/3
Strict type checking is on, which catches a whole class of agent mistakes before they run.
Context economy 11/20 B-

Whether the repo fits in a context window, or fights it.

No committed build output 6/6
No generated directories committed.
.gitignore hygiene 3/3
.gitignore covers 10 patterns.
File sizes fit in context 0/6
16 source files are over 100KB.
A single file that fills the context window forces an agent to work from fragments, and it will confidently edit code it never saw. Splitting the worst offenders pays for itself immediately.
external/openjpeg/openjpeg_nowasm_fallback.js — 441KB
test/unit/api_spec.js — 326KB
test/unit/annotation_spec.js — 214KB
Repository weight 2/5
About 195MB checked out. Large enough that cloning and searching are both slow.
Large binaries and vendored trees slow every operation an agent performs. Git LFS or a separate assets repo keeps the working tree navigable.

Here is your AGENTS.md

Drafted from what is actually in this repository: the install command from your lockfile, the commands you already declare, your real directory layout. Anything marked TODO needs a person. Save it at the root as AGENTS.md.

AGENTS.md — drafted for mozilla/pdf.js
# AGENTS.md

PDF Reader in JavaScript

## Setup

```
npm ci
```

## Commands

```
# TODO: nothing declares a build or test command, so an agent has to guess.
# This is the single most valuable section of this file. Fill it in.
```

## Layout

- `src/`        212 source files
- `test/`       126 source files
- `web/`        84 source files
- `external/`   75 source files
- `examples/`   10 source files
- `extensions/` 9 source files

## Conventions

- Tests live alongside the code they cover, following `src/core/file_spec.js`.
- TypeScript runs in strict mode. Type errors are the fastest feedback available, so do not weaken it.
- CI defines what passing means. See `.github/workflows/ci.yml`, and keep it green.
- TODO: add the two or three conventions a newcomer always gets wrong here.

## Gotchas

- `external/openjpeg/openjpeg_nowasm_fallback.js` is 441KB. It will not fit comfortably in context, so read it in parts.

---

Drafted by agentreadme.com from what is in this repository. Everything marked TODO
needs a human. Check it in as AGENTS.md at the root.

Open the raw markdown  or  curl -o AGENTS.md agentreadme.com/draft/mozilla/pdf.js.md

Show the mark

The badge re-checks daily, so it keeps up as the repository changes. Use mark again to force it now.

agent ready 72 out of 100

[![agent ready](https://agentreadme.com/badge/mozilla/pdf.js.svg)](https://agentreadme.com/mozilla/pdf.js)

Other JavaScript repositories, marked

react/react 71 B+ affaan-m/ECC 90 A trekhleb/javascript-algorithms 69 B Snailclimb/JavaGuide 53 C+ airbnb/javascript 54 C+ vercel/next.js 77 B+

All JavaScript repositories

Think this mark is wrong?

Every deduction above names the file it came from, so this can be settled by looking. If a check missed something, that is a rule worth fixing.

Open an issue, already filled in