backlog-mcp AGENTS.md

backlog-mcp AGENTS.md is an instructions file for Codex, OpenCode from gkoreli/backlog-mcp. It costs 3,723 tokens per session, scanned A, original, MIT.

Development instructions for backlog-mcp, including its testing rules and the way its code uses an in-memory filesystem. Unit tests check real production code without reading or writing the computer's files.

In plain words
What is it for?
Use them when adding tests, choosing test locations, running all or package-specific tests, and mocking filesystem operations with memfs.
Why use it?
They keep tests fast, isolated, and repeatable while preventing accidental dependence on a developer's local filesystem or external services.

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

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for backlog-mcp AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/gkoreli/backlog-mcp/agents-md.svg)](https://agentmods.dev/instructions/gkoreli/backlog-mcp/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/gkoreli/backlog-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/gkoreli/backlog-mcp/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 3,723 This file is loaded in full into every session.
When invoked 3,723 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.03723 $0.03723
Opus 5 $0.01861 $0.01861
Sonnet 5 $0.00745 $0.00745
Haiku 4.5 $0.00372 $0.00372

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

Security

Grade A, and why

backlog-mcp 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 4d 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 · 322 lines

How it starts

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

AGENTS.md — Guidelines for AI Agents Working in backlog-mcp

Testing

Philosophy

Unit tests only. No integration tests.

  • Unit tests mock external dependencies (filesystem, network, etc.)
  • Tests should be fast, deterministic, and isolated
  • If tests touch real filesystem, they're not unit tests

How It Works

All tests use memfs for in-memory filesystem mocking. Zero real file I/O.

  1. vitest.config.ts loads src/__tests__/helpers/setup.ts globally (server package)
  2. setup.ts mocks node:fs with memfs before any test runs
  3. Tests call real production code (e.g., storage.add())
  4. Production code calls writeFileSync/readFileSync → intercepted by memfs → stored in RAM
  5. Filesystem resets between test files (not between individual tests)

Test Locations

Package Test location Count
Server packages/server/src/__tests__/*.test.ts 537
Viewer packages/viewer/**/*.test.ts 92
pnpm test                                # All workspace tests
pnpm --filter backlog-mcp test           # Server only
pnpm --filter @backlog-mcp/viewer test   # Viewer only

Rules

DO:

  • Write unit tests that use the mocked fs automatically
  • Create test data using production APIs (storage.add(), etc.)
  • Use beforeAll/afterAll for setup/teardown within a test file
  • Mock external modules explicitly with vi.mock() when needed
  • Use tmpdir() for path strings — only fs operations are mocked

DON'T:

  • Don't write custom fs mocks — use the global memfs setup
  • Don't use beforeEach to reset filesystem (breaks beforeAll patterns)
  • Don't rewrite tests to fit mocks — fix the mock instead

Correct Patterns

// Test using production APIs — memfs handles I/O
it('should create a task', () => {
  const task = createTask({ id: 'TASK-0001', title: 'Test' });
  storage.add(task);
  const retrieved = storage.get('TASK-0001');
  expect(retrieved?.title).toBe('Test');
});

// Mock paths module when needed
beforeEach(() => {
  vi.spyOn(paths, 'backlogDataDir', 'get').mockReturnValue('/test/data');
});

// Mock specific modules for isolation
vi.mock('../storage/backlog.js', () => ({
  storage: { list: vi.fn(), get: vi.fn() },
}));

Read the full file on GitHub · 322 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. 4d ago First seen · 322 lines · 3,723 tokens per session scan A d3c1ec10313c

Subscribe to this mod's changes

backlog-mcp AGENTS.md is an instructions file published in the GitHub repository gkoreli/backlog-mcp (5 stars, last pushed 1mo ago), licensed MIT. It adds 3,723 tokens to every session, about $0.0186 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-31.