Borrowing it
Nothing to install: this file belongs to hrshx3o5o6/brocogni. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/hrshx3o5o6/brocogni/main/AGENTS.mdgit clone --depth 1 https://github.com/hrshx3o5o6/brocogniWrote 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.
[](https://agentmods.dev/instructions/hrshx3o5o6/brocogni/agents-md)<a href="https://agentmods.dev/instructions/hrshx3o5o6/brocogni/agents-md"><img src="https://agentmods.dev/badge/instructions/hrshx3o5o6/brocogni/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/hrshx3o5o6/brocogni/agents-md"><img src="https://agentmods.dev/badge/instructions/hrshx3o5o6/brocogni/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01200 | $0.01200 |
| Opus 5 | $0.00600 | $0.00600 |
| Sonnet 5 | $0.00240 | $0.00240 |
| Haiku 4.5 | $0.00120 | $0.00120 |
Grade A, and why
brocogni 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 10d 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.
How it starts
The opening of the file, as written. The whole thing — 66 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Brocogni
Commands
npm run check # tsc --noEmit (type-check only, no output)
npm run build # tsc -p tsconfig.json (emit to dist/)
npm test # build + node --test 'dist/test/**/*.test.js'
npm start # node dist/src/runtime/mcp.js
Tests are deterministic, no browser needed. 6 tests across 3 files.
Architecture
src/
index.ts Entry — wires observer → semantic → selector pipeline
observer/cdpObserver CDP session: AX tree + DOM snapshot via CDP (not Playwright API)
semantic/infer Filters AX tree to actionable roles, infers purpose, generates selectors
semantic/fuse Extracts DOM geometry and fuses bounding boxes onto AX nodes
selector/generate Generates ARIA, CSS, XPath, relational sibling selectors
selector/rank Scores selectors (semantic, stability, uniqueness, resilience)
runtime/service BrowserCognitionService — orchestrates all pipeline steps
runtime/mcp JSON-RPC MCP server (the npm binary entrypoint)
runtime/contracts Request/response type interfaces
runtime/delta State diffing: keyed by backendDOMNodeId, falls back to node id
runtime/prompts/instructions AGENT_INSTRUCTIONS prompt for "write-robust-playwright-script"
context/compiler Trims nodes by mode (action/extract/debug) and budget
types/schema SemanticNode, SelectorCandidate, SemanticPageState, etc.
setup/index.ts Interactive setup — detects 7 clients, writes config files
Key facts an agent will miss without this
- Entrypoint:
src/runtime/mcp.tsis the npm binary (binin package.json). It's also thestartscript. The configured entry inopencode.jsonfor this repo points to it. - TTY gate: When stdin is a TTY (bare
npx browser-cognition-mcp), it runs interactive setup, not the MCP server. Server mode only with piped stdin. Use--help/--version/--setupflags for CLI discoverability. - CDP auto-connect:
getOrCreatePage()probes ports 9222–9224 for existing Chrome viaconnectOverCDPbefore falling back tochromium.launch(). SetsisCdpMode = true, which makescleanup()skip closing the browser (won't kill user's Chrome). - Browser lifecycle: No shared
contextInstancevariable. Each new page creates or reuses the first available context frombrowserInstance.contexts()[0]. CDP mode uses the existing browser's contexts directly. - MCP protocol quirks:
notifications/initializedsilently ignored (no response). Error responses guard against null/undefinedid. Protocol version echoes client request with fallback to"2024-11-05". - 13 MCP tools: navigate, observe, delta, verify, act, get_selector_plan, find_targets, screenshot, evaluate, save_cookies, list_pages, use_page, evaluate (also
browser_infoandbrowser_run_scriptexist in handler but not in TOOLS array — hidden/internal). - Semantic nodes only: Only 7 actionable ARIA roles survive filtering (button, link, textbox, combobox, checkbox, radio, menuitem, tab). Other roles dropped.
- Selector fallback chain: For each node, generates ordered candidates: ARIA role+name → text-based XPath → relational CSS/XPath (preceding/following named sibling). Sorted by score descending.
- Delta keying: Nodes are matched by
attributes.backendDOMNodeId. If absent, falls back toid_${node.id}string key. - Packaging:
package.json"files"is scoped todist/src/only. No test files, no examples shipped. - Setup detects 7 clients: Antigravity, Cursor, Windsurf, Claude Desktop, Claude Code, OpenCode, Hermes. Each auto-configures on selection (writes JSON/YAML to the right location). Detection uses env vars (
CURSOR_TRACE_ID,TERM_PROGRAM,CLAUDE_CODE, etc.) andfs.existsSyncfor config paths. @clack/prompts: Dynamic import only in setup path (not at MCP server runtime).
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.
- 10d ago First seen · 66 lines · 1,200 tokens per session scan A f2036370f29b
brocogni AGENTS.md is an instructions file published in the GitHub repository hrshx3o5o6/brocogni (8 stars, last pushed 1mo ago), licensed MIT. It adds 1,200 tokens to every session, about $0.0060 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.
Other instructions, from other repositories
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.