node-crawler AGENTS.md

Repository instructions for bda-research/node-crawler, covering how to build, test, format, and structure the code. They explain that tests run against compiled output rather than the original TypeScript files.

In plain words
What is it for?
They guide builds, tests with Ava and mocked HTTP requests, TypeScript and ESLint style, module settings, and parts of the crawler architecture.
Why use it?
They prevent common project mistakes, such as testing stale files, using the wrong test filename, or running commands in the wrong order.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/bda-research/node-crawler/agents-md
Clone the repo
git clone --depth 1 https://github.com/bda-research/node-crawler

Made for: Codex, OpenCode.

Per session 408 This file is loaded in full into every session.
When invoked 408 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00408 $0.00408
Opus 5 $0.00204 $0.00204
Sonnet 5 $0.00082 $0.00082
Haiku 4.5 $0.00041 $0.00041

Measured 2d ago against content hash 99682743a495, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

node-crawler AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 36 lines

What it actually says

AGENTS.md

This file provides guidance to the AI agent when working with code in this repository.

Build & Test

Tests run against compiled output in dist/, not source. Always build before testing:

npm run build   # tsup → dist/index.js + dist/index.cjs
npm test        # NODE_ENV=test ava (runs test/*.js, excludes test/*test.js)

CI pipeline: npx eslint && npm run build && npm test

Testing

  • ava with nock for HTTP mocking. No real network calls.
  • Test files are plain .js (not .ts) and import from ../dist/index.js.
  • Ava config excludes test/*test.js — new test files should NOT use the .test.js suffix (e.g. callback.js, not callback.test.js).
  • Tests use a custom testCb wrapper from test/lib/avaTestCb.js for callback-based async. Call t.end() to signal completion.
  • Default test timeout is 20s.

Code Style

  • TypeScript strict mode, ESM throughout ("type": "module").
  • ESLint enforced on src/**/*.ts: double quotes, semicolons required, no-console is an error, unused vars prefixed with _ are allowed.
  • Target: ES2020. Module resolution: bundler.

Architecture Notes

  • got is lazy-loaded on first use via dynamic import("got") — do not add a top-level static import for it.
  • cheerio is the default HTML parser (exposed as res.$). jsdom is not supported.
  • Rate limiter uses a cluster of independent limiters. rateLimit is global-only — modify per-limiter via crawler.setLimiter(), not per-request options.
  • The callback pattern requires calling done() to signal task completion and release the slot.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 36 lines · 408 tokens per session scan A 99682743a495

Subscribe to this mod's changes

node-crawler AGENTS.md is an instructions file published in the GitHub repository bda-research/node-crawler (6,798 stars, last pushed 2mo ago), licensed MIT. It adds 408 tokens to every session, about $0.0020 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.