agentleFS
redf0x1redf0x1/camofox-browser/.cursor/rules/050-cli-dev.mdc

camofox-browser / rules

Cursor rule438 starsChanged 8 months agoMITView on GitHub

Conventions for developing camofox CLI commands

The file

We split this 050-cli-dev.mdc into the rules it gives an agent

11 rules. About 0 are common, 6 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep command handlers thin: parse input, call transport, format output.

    line 12
  2. Very specific:

    Prefer .argument() + .option() signatures with explicit validation.

    line 15
  3. Very specific:

    Use printWithOptionalFormat or context formatter for consistent output.

    line 18
  4. Very specific:

    Use apiRequestWithFallback / requestWithFallback where legacy paths exist.

    line 21
  5. Distinctive:

    Keep fallback logic deterministic and minimal.

    line 23
  6. Distinctive:

    Avoid leaking secrets in errors or logs.

    line 28
  7. Distinctive:

    Never print decrypted passwords to stdout.

    line 31
  8. Distinctive:

    Keep password values in narrow scope and wipe best-effort buffers.

    line 33
  9. Very specific:

    Avoid any; use narrow records/interfaces for payloads.

    line 37
  10. Distinctive:

    Keep helpers pure when possible.

    line 38
  11. Very specific:

    Verify help text and command signatures with --help outputs.

    line 41

≈ “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
050-cli-dev.mdc
---
description: "Conventions for developing camofox CLI commands"
globs: "src/cli/**"
alwaysApply: false
---

# CLI Development Conventions

## Structure
- Register commands in `src/cli/commands/*.ts` grouped by domain.
- Wire modules in `src/cli/index.ts` only.
- Keep command handlers thin: parse input, call transport, format output.

## Command Design
- Prefer `.argument()` + `.option()` signatures with explicit validation.
- Support active tab fallback for optional `[tabId]` where relevant.
- Resolve user via `resolveCommandUser` and default to CLI/global setting.
- Use `printWithOptionalFormat` or context formatter for consistent output.

## Transport and Fallback
- Use `apiRequestWithFallback` / `requestWithFallback` where legacy paths exist.
- Handle 404 fallback explicitly for compatibility branches.
- Keep fallback logic deterministic and minimal.

## Error Handling
- Route all errors to `context.handleError`.
- Throw actionable validation errors for bad CLI input.
- Avoid leaking secrets in errors or logs.

## Auth Vault Safety
- Never print decrypted passwords to stdout.
- For `--inject`, require explicit username/password refs.
- Keep password values in narrow scope and wipe best-effort buffers.

## TypeScript Practices
- Preserve strict typing for command options and action handlers.
- Avoid `any`; use narrow records/interfaces for payloads.
- Keep helpers pure when possible.

## Testing/Validation
- Verify help text and command signatures with `--help` outputs.
- Validate JSON/text/plain formatting behavior.
- Confirm auto-start behavior and `server` command exclusions in preAction logic.

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.