agentleFS
swimmwatchswimmwatch/cloakbrowser-mcp/AGENTS.md

cloakbrowser-mcp

AGENTS.md172 starsChanged 5 months agoMITView on GitHub

Repository-specific instructions for AI coding agents working on cloakbrowser-mcp. Global agent instructions remain authoritative for general communication, research, tool use, editing, and completion behavior. cloakbrowser-mcp is a stdio MCP bridge for upstream @playwright/mcp. It starts Playwright MCP as a child process, injects the CloakBrowser Chromium executable through a generated config, forwards upstream tools unchanged, and adds two local introspection tools. - Runtime: Node.js ^22.13.0 || >=24.0.0, ES modules, strict TypeScript with NodeNext. - Public surface: CLI package only, bin: cloakbrowser-mcp.…

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 33,398 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository5 other files it gives its agents.

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

40 rules. About 3 are common, 21 are distinctive, and 16 are very specific to this project.

  • ≈3

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈21

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 16

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not copy, rewrite, or mutate upstream Playwright MCP browser tool contracts.

    line 22
  2. Very specific:

    Do not add CLOAKBROWSER_MCP_* aliases.

    line 26
  3. Distinctive:

    Run the smallest relevant checks while developing.

    line 40
  4. Very specific:

    Keep TypeScript strict mode and ESM.

    line 52
  5. Very specific:

    Use #src/... for runtime source, @/...

    line 53
  6. Distinctive:

    Prefer explicit types and small pure functions.

    line 55
  7. Very specific:

    Do not use console.* in runtime code.

    line 60
  8. Very specific:

    Do not add any, // @ts-ignore, or non-null assertions to silence the checker.

    line 62
  9. Distinctive:

    Keep generated browser configuration in the bridge boundary and upstream process transport in the server boundary.

    line 66
  10. Common:

    Treat generated configs, profiles, extensions, proxy credentials, and browser child processes as lifecycle-owned resources.

    line 68
  11. Common:

    Keep errors actionable without exposing secrets or protocol-breaking output.

    line 70
  12. Distinctive:

    Use the fake upstream server for proxy behavior.

    line 71
  13. Distinctive:

    Prefer property-based tests for parsers, options, environment handling, and similar boundary-heavy pure logic.

    line 73
  14. Distinctive:

    Use distribution or Docker end-to-end tests for packaged CLI, container entrypoint, or real-browser behavior.

    line 75
  15. Distinctive:

    Keep large HTML documents and complete page markup in separate template files.

    line 80
  16. Very specific:

    Do not use style attributes or inline JavaScript event-handler attributes.

    line 83
  17. Distinctive:

    Use CloakBrowser Free without a license for development and ordinary checks, including end-to-end tests that do not require Pro-specific …

    line 88
  18. Distinctive:

    Use a licensed CloakBrowser client only for end-to-end tests or verification explicitly requiring Pro-specific behavior.

    line 90
  19. Common:

    Do not use or inspect saved license credentials for ordinary checks.

    line 97
  20. Distinctive:

    Use the active skill catalog and matching skill by name.

    line 103
  21. Distinctive:

    Keep generic workflow instructions, interview guides, and task-packet contracts in the global skills.

    line 105
  22. Very specific:

    Use Codex's standard Request User Input tool (request_user_input) for unresolved user decisions, following the tool's current host …

    line 107
  23. Very specific:

    Use documentation-and-adrs for a focused technical document or ADR.

    line 127
  24. Very specific:

    Use top-level contents: read in GitHub workflows.

    line 134
  25. Very specific:

    Keep scripts/lib/playwright-mcp-upstream.mjs able to read a tag from a pinned upstream Playwright MCP image reference.

    line 140
  26. Distinctive:

    Do not broadly disable zizmor or OpenSSF Scorecard findings.

    line 142
  27. Very specific:

    Keep SECURITY.md actionable with a private vulnerability-reporting path.

    line 143
  28. Distinctive:

    After workflow, Docker, token-permission, or registry-publishing changes, run:

    line 147
  29. Distinctive:

    Update relevant public documentation when CLI, Docker, environment, or tool behavior changes.

    line 156
  30. Very specific:

    Update each affected *.ru.md, *.be.md, *.uk.md, *.es.md, *.pt-BR.md, *.zh.md, *.ja.md, *.de.md, *.fr.md, and *.hi.md, or document why …

    line 159
  31. Very specific:

    Do not bulk-regenerate translations unless explicitly requested.

    line 164
  32. Distinctive:

    Keep one logical change per commit and obtain explicit confirmation before committing.

    line 177
  33. Very specific:

    Follow Conventional Commits 1.0.0.

    line 178
  34. Distinctive:

    Keep subjects concise, imperative, and present tense after the conventional prefix.

    line 180
  35. Distinctive:

    Call out security-sensitive changes in pull request descriptions.

    line 182
  36. Very specific:

    Follow project-pull-request and project-release for external delivery.

    line 183
  37. Distinctive:

    Do not restore the old native adapter, custom capability model, origin policy, artifact manager, verify helpers, or custom browser tools.

    line 188
  38. Distinctive:

    Do not add unused dependencies or introduce a bundler or runtime without approval.

    line 190
  39. Very specific:

    Do not commit dist/, coverage/, artifacts/, site/, .venv-docs/, or node_modules/.

    line 191
  40. Distinctive:

    Do not weaken TypeScript, ESLint, Prettier, test, security, or compatibility checks.

    line 193

≈ “Common” is an estimate: at least 1 in 5 of the 43,423 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md

Repository-specific instructions for AI coding agents working on cloakbrowser-mcp. Global agent instructions remain authoritative for general communication, research, tool use, editing, and completion behavior.

Project

cloakbrowser-mcp is a stdio MCP bridge for upstream @playwright/mcp. It starts Playwright MCP as a child process, injects the CloakBrowser Chromium executable through a generated config, forwards upstream tools unchanged, and adds two local introspection tools.

  • Runtime: Node.js ^22.13.0 || >=24.0.0, ES modules, strict TypeScript with NodeNext.
  • Public surface: CLI package only, bin: cloakbrowser-mcp.
  • Docker base: pinned official Playwright MCP image from Dockerfile.
  • Repository artifacts are written in English unless a localization file requires another language.

Invariants

  • Do not copy, rewrite, or mutate upstream Playwright MCP browser tool contracts.
  • Local tools are limited to cloakbrowser_binary_info and cloakbrowser_bridge_info.
  • PLAYWRIGHT_MCP_* is the primary configuration namespace.
  • CLOAK_PLAYWRIGHT_MCP_* is only for bridge-specific Cloak toggles.
  • Do not add CLOAKBROWSER_MCP_* aliases.
  • Runtime logs never go to stdout; preserve stdio protocol safety.
  • Preserve Streamable HTTP session isolation and child-process cleanup.

Layout

  • src/cli.ts: CLI entry point; src/server.ts: outer MCP proxy.
  • src/bridge/: config, environment, paths, and local tools.
  • src/cli/: options and lifecycle; src/http/: HTTP sessions and transport.
  • src/logging/, src/protocol/, src/runtime/, src/project/: shared runtime support.
  • tests/unit/, tests/integration/, tests/fixtures/: Vitest suites and fake upstream.

Development

Run the smallest relevant checks while developing. Before completion, run:

npm run check

Task-specific commands include npm run test:unit, npm run test:integration, npm run build, npm run package:verify, npm run docker:build, npm run docker:smoke, and npm run bridge:compare.

TypeScript And Runtime

  • Keep TypeScript strict mode and ESM; internal imports end with .js.
  • Use #src/... for runtime source, @/... in tests, @tests/... for test helpers, and #scripts/... for scripts instead of relative internal imports.
  • Prefer explicit types and small pure functions.
  • Pass only constants, variable references, or single-use inline callbacks as call arguments. Compute other expressions first and store their results, including objects created with constructors, in named variables or constants. Preserve evaluation order and conditional execution when moving expressions.
  • Do not use console.* in runtime code. CLI help/version may use process.stdout; errors may use process.stderr.
  • Do not add any, // @ts-ignore, or non-null assertions to silence the checker.

Bridge And Tests

  • Keep generated browser configuration in the bridge boundary and upstream process transport in the server boundary.
  • Treat generated configs, profiles, extensions, proxy credentials, and browser child processes as lifecycle-owned resources.
  • Keep errors actionable without exposing secrets or protocol-breaking output.
  • Use the fake upstream server for proxy behavior.
  • Tests write only to tmpdir() paths they create and clean up.
  • Prefer property-based tests for parsers, options, environment handling, and similar boundary-heavy pure logic.
  • Use distribution or Docker end-to-end tests for packaged CLI, container entrypoint, or real-browser behavior.

HTML Templates

  • Keep large HTML documents and complete page markup in separate template files. Small HTML fragments may remain inline in code.
  • In HTML files, write CSS in <style> tags and JavaScript in <script> tags. Do not use style attributes or inline JavaScript event-handler attributes; register event listeners from the script instead.

CloakBrowser License Use

  • Use CloakBrowser Free without a license for development and ordinary checks, including end-to-end tests that do not require Pro-specific behavior.
  • Use a licensed CloakBrowser client only for end-to-end tests or verification explicitly requiring Pro-specific behavior. Do not use it for routine agent browsing, development, unit tests, or fake-upstream integration tests.
  • For license-free checks, select a known Free binary, clear CLOAKBROWSER_LICENSE_KEY, and use an isolated temporary cache without a license.key file. An empty environment key alone does not disable the dependency's saved-key fallback. Clean up the temporary cache afterward.
  • Do not use or inspect saved license credentials for ordinary checks. Do not stop unrelated browser sessions to obtain a Pro license slot.

Workflow Routing

Generic engineering workflows are installed globally through Engineer Agent Workflows. Use the active skill catalog and matching skill by name. Do not vendor global workflow copies into this repository or hardcode plugin-cache paths. Keep generic workflow instructions, interview guides, and task-packet contracts in the global skills; do not maintain local copies or references duplicating them. Use Codex's standard Request User Input tool (request_user_input) for unresolved user decisions, following the tool's current host constraints.

  • /spec routes to spec-driven-development.
  • /plan routes to planning-and-task-breakdown.
  • One authorized task packet routes to incremental-implementation.
  • Manifest-scoped UI design after planning routes to design-planning.
  • Review, simplification, context engineering, technical documentation or ADRs, decision challenges, idea refinement, interviews, performance, and security route to their matching global skills.
  • Global workflow skills are explicit-only. One stage does not authorize another, commits, publication, or external mutations.

Project-owned skills remain under .agents/skills/:

  • project-docs-maintainer: documentation-set maintenance, localization, and generated documentation consistency.
  • project-pull-request: GitHub pull request preparation and mutation.
  • project-release: release preparation, publication, verification, and recovery.

Use documentation-and-adrs for a focused technical document or ADR. Use project-docs-maintainer when generated or localized documentation must remain consistent. Durable workflow artifacts belong under docs/specs/<slug>/; the selected skill owns its questions, manifests, reviews, checklists, and handoffs.

Supply Chain

  • Use top-level contents: read in GitHub workflows; add write permissions only to the job that needs them.
  • Pin external Actions by full commit SHA with the intended version in a trailing comment, for example # v6.
  • Pin Docker images as tag@sha256:<digest> while retaining the readable tag. Use image reference variables such as NODE_IMAGE_REF, not tag-only build inputs.
  • Keep scripts/lib/playwright-mcp-upstream.mjs able to read a tag from a pinned upstream Playwright MCP image reference.
  • Do not broadly disable zizmor or OpenSSF Scorecard findings.
  • Keep SECURITY.md actionable with a private vulnerability-reporting path.
  • Branch protection, rulesets, required reviewers, and required checks are maintainer-controlled and require explicit confirmation of the exact policy.

After workflow, Docker, token-permission, or registry-publishing changes, run:

docker run --rm -v "$PWD:/repo" --workdir /repo docker.io/rhysd/actionlint:1.7.12@sha256:b1934ee5f1c509618f2508e6eb47ee0d3520686341fec936f3b79331f9315667 -color
python3 -m pipx run zizmor --min-severity high .

Documentation

Update relevant public documentation when CLI, Docker, environment, or tool behavior changes. English documentation is the source for localized MkDocs pages.

  • Update each affected *.ru.md, *.be.md, *.uk.md, *.es.md, *.pt-BR.md, *.zh.md, *.ja.md, *.de.md, *.fr.md, and *.hi.md, or document why deferred.
  • Translate only changed prose, using DeepL when available and manual translation when unavailable. Preserve Markdown structure, code, identifiers, URLs, flags, variables, package names, image paths, and Material icon tokens.
  • Do not bulk-regenerate translations unless explicitly requested. Refresh only actual affected entries in docs/data/translation-manifest.json.
  • Run npm run docs:build, npm run docs:seo:validate, npm run docs:translations:check, and npm run check.
  • Compatibility data is owned by docs/data/version-compatibility.json. Generate and verify tables with npm run docs:compatibility and npm run docs:compatibility:check.
  • CHANGELOG.md follows Keep a Changelog 1.1.0. Before release-note edits, open https://keepachangelog.com/en/1.1.0/ and preserve [Unreleased], ISO dates, comparison links, and standard sections.

Commit And Release Hygiene

  • Keep one logical change per commit and obtain explicit confirmation before committing.
  • Follow Conventional Commits 1.0.0. Before committing, open https://www.conventionalcommits.org/en/v1.0.0/.
  • Keep subjects concise, imperative, and present tense after the conventional prefix.
  • Bump version only when explicitly requested.
  • Call out security-sensitive changes in pull request descriptions.
  • Follow project-pull-request and project-release for external delivery. Local validation or artifact preparation does not authorize later actions.

Prohibited Changes

  • Do not restore the old native adapter, custom capability model, origin policy, artifact manager, verify helpers, or custom browser tools.
  • Do not add unused dependencies or introduce a bundler or runtime without approval.
  • Do not commit dist/, coverage/, artifacts/, site/, .venv-docs/, or node_modules/.
  • Do not weaken TypeScript, ESLint, Prettier, test, security, or compatibility checks.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.