contentful.js AGENTS.md

A set of instructions for working on the Contentful JavaScript library, including where project guidance, tests, architecture notes, and migration information live.

In plain words
What is it for?
Use it when navigating the repository, changing TypeScript or build targets, reviewing pull requests, or deciding which tests and documentation to consult.
Why use it?
It directs coding agents to the repository's established rules and checks, reducing the chance of breaking types, browser targets, HTTP configuration, or bundle-size limits.

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/contentful/contentful.js/agents-md
Clone the repo
git clone --depth 1 https://github.com/contentful/contentful.js

Made for: Codex, OpenCode.

Per session 860 This file is loaded in full into every session.
When invoked 860 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.00860 $0.00860
Opus 5 $0.00430 $0.00430
Sonnet 5 $0.00172 $0.00172
Haiku 4.5 $0.00086 $0.00086

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

Security

Grade A, and why

contentful.js 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 · 61 lines

How it starts

The opening of the file, as written. The whole thing — 61 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agent Guide

Read this file first. It tells you where to find context in this repo.

Quick Reference

What you need Where to look
How this repo is structured ARCHITECTURE.md
How to build/test/run CONTRIBUTING.md
Why decisions were made docs/ADRs/
What this repo does README.md
PR review rules .bito/guidelines/
Active specs/work docs/specs/
Version migration guides MIGRATION.md
Advanced usage patterns ADVANCED.md
TypeScript usage TYPESCRIPT.md

Sharp Edges & Invariants

  • Always run npm run test:types after modifying types — type regressions are not caught by Vitest unit tests. The tsd type tests in test/types/ are the only gate.
  • Always run npm run check after changing build targets — es-check validates that output matches declared ES version targets (ES2017 for CJS/ESM, ES2018 for browser bundles).
  • Never modify the axios instance directly — HTTP configuration flows through contentful-sdk-core's createHttpClient. Custom headers go in CreateClientParams.headers.
  • Bundle size is CI-enforcedsize-limit checks run in CI. If you add a dependency, verify it doesn't blow the 85KB (browser) / 45KB (min) limits via npm run test:size.
  • dist/esm-raw/ is an intermediate build artifact — it's Rollup input, not a shipped output. Never import from it or reference it in package.json exports.
  • Link resolution happens in contentful-resolve-response — not in this repo. If link resolution is broken, look there.
  • Content Source Maps only work with CPAincludeContentSourceMaps: true requires host: 'preview.contentful.com'. It will not work with the CDA.
  • __VERSION__ is replaced at Rollup build time — it's defined in rollup.config.js via @rollup/plugin-replace. Don't reference it expecting a value at dev/test time without building first.

Read the full file on GitHub · 61 lines

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 · 61 lines · 860 tokens per session scan A 8bc456be0539

Subscribe to this mod's changes

contentful.js AGENTS.md is an instructions file published in the GitHub repository contentful/contentful.js (1,296 stars, last pushed 15d ago), licensed MIT. It adds 860 tokens to every session, about $0.0043 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.