agentleFS
redf0x1redf0x1/camofox-browser/.cursor/rules/001-camofox-core.mdc

camofox-browser / rules

Cursor rule438 starsChanged 8 months agoMITView on GitHub

Core camofox-browser concepts — element refs, snapshot-first workflow, server basics

  • Reads credentials

The file

We split this 001-camofox-core.mdc into the rules it gives an agent

5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never assume old refs remain valid after:

    line 19
  2. Distinctive:

    Treat refs as ephemeral state, not permanent IDs.

    line 28
  3. Very specific:

    Always keep userId consistent through a flow.

    line 31
  4. Very specific:

    If CAMOFOX_API_KEY is configured, provide Bearer auth for protected routes.

    line 41
  5. Very specific:

    Use --format json for machine parsing.

    line 43

≈ “Common” is an estimate: at least 1 in 5 of the 6,668 Cursor rule 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
001-camofox-core.mdc
---
description: "Core camofox-browser concepts — element refs, snapshot-first workflow, server basics"
alwaysApply: true
---

# CamoFox Core Rules

## What CamoFox Is
- CamoFox Browser is an anti-detection browser automation server built on Camoufox.
- Primary interface is REST API on port `9377` with CLI wrapper `camofox`.
- OpenClaw-compatible routes are available (`/tabs/open`, `/navigate`, `/snapshot`, `/act`).

## Snapshot-First Workflow (Required)
1. Open/create a tab.
2. Capture snapshot to get current `eN` refs.
3. Interact using refs when possible.
4. Re-snapshot after navigation or major UI updates.

Never assume old refs remain valid after:
- navigation
- modal transitions
- SPA rerenders
- display mode toggles

## Element Refs (`eN`) Rules
- Refs are produced by snapshot endpoints and are user/tab scoped.
- Refs are preferred over selectors for robust automation.
- Treat refs as ephemeral state, not permanent IDs.

## User/Session Rules
- Always keep `userId` consistent through a flow.
- `sessionKey` (or legacy `listItemId`) groups tabs by task.
- `DELETE /sessions/:userId` is the full cleanup operation.

## Server Basics
- Health check: `GET /health`.
- Presets list: `GET /presets`.
- Context display toggle: `POST /sessions/:userId/toggle-display`.

## Critical Safety Rules
- If `CAMOFOX_API_KEY` is configured, provide Bearer auth for protected routes.
- OpenClaw `POST /stop` always requires `x-admin-key`, and it must match configured admin key value.
- Use `--format json` for machine parsing.

## Quick Reference
```bash
camofox open https://example.com         # create tab
camofox snapshot                         # get refs
camofox click e5                         # interact by ref
camofox type e8 "hello"                  # type text
camofox get-url --format json            # structured output
```

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.