agentleFS
hubtypehubtype/botonic/.cursor/rules/general.md

botonic / rules

Cursor rule627 starsChanged 10 months agoMITView on GitHub

Botonic is an npm workspaces monorepo. All packages live in packages/: When adding dependencies, respect this graph to avoid cycles. Shared types: Types used in more than one package must be declared in @botonic/core and exported from there, so other packages import them from a single source of truth.

  • Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.

    Of the Cursor rule files we read, the 4,263 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.

The file

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

12 rules. About 0 are common, 4 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When adding dependencies, respect this graph to avoid cycles.

    line 34
  2. Distinctive:

    All packages must pass lint and format checks

    line 66
  3. Distinctive:

    When adding or modifying a feature, tests must be added to cover the use case

    line 72
  4. Very specific:

    Test file names must end with test.ts or test.tsx

    line 74
  5. Distinctive:

    All packages must pass tests before considering development complete

    line 75
  6. Very specific:

    Use __mocks__/ for shared mocks within the package

    line 78
  7. Very specific:

    Types: Use import type when importing types only

    line 83
  8. Very specific:

    Avoid any, prefer explicit types

    line 84
  9. Very specific:

    Create folder in packages/<name>/

    line 88
  10. Very specific:

    Add package.json with name: "@botonic/<name>"

    line 89
  11. Very specific:

    When creating a new package, start with a version equal to the current minor version of @botonic/core

    line 90
  12. Very specific:

    Create tsconfig.json and tsconfig.esm.json if it compiles TS

    line 91

≈ “Common” is an estimate: at least 1 in 5 of the 7,111 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
general.md

Botonic Project Rules — Packages

Repository

  • The default branch is master.

Monorepo Structure

Botonic is an npm workspaces monorepo. All packages live in packages/:

packages/
├── botonic-cli/           # CLI to create, serve and deploy bots
├── botonic-core/         # Framework core (no @botonic dependencies)
├── botonic-react/        # React components (depends on @botonic/core)
├── botonic-dx/           # Dev experience, bundlers
├── botonic-dx-bundler-rspack/
├── botonic-dx-bundler-webpack/
├── botonic-eslint-config/
├── botonic-plugin-ai-agents/
├── botonic-plugin-flow-builder/
├── botonic-plugin-hubtype-analytics/
├── botonic-plugin-knowledge-bases/

Package Dependencies

  • @botonic/core: Base package, no dependencies on other @botonic/*
  • @botonic/react: Depends on @botonic/core
  • @botonic/plugin-flow-builder: Depends on @botonic/react
  • Plugins (ai-agents, hubtype-analytics, knowledge-bases): Depend on @botonic/core
  • @botonic/dx: Depends on @botonic/dx-bundler-rspack and @botonic/eslint-config

When adding dependencies, respect this graph to avoid cycles.

Shared types: Types used in more than one package must be declared in @botonic/core and exported from there, so other packages import them from a single source of truth.

Standard Package Structure

packages/<package-name>/
├── src/                  # TypeScript/TSX source code
├── lib/                  # Compiled output (CJS in lib/cjs, ESM in lib/esm)
├── tests/                # Jest tests
├── package.json
├── tsconfig.json         # CJS build
├── tsconfig.esm.json     # ESM build (when applicable)
└── README.md

Build

  • Each package compiles to CJS and ESM when applicable
  • Standard script: tsc -p tsconfig.json && tsc -p tsconfig.esm.json
  • Output: lib/cjs/ and lib/esm/
  • package.json: main → ./lib/cjs/index.js, module → ./lib/esm/index.js

TypeScript Configuration

  • Extends from ../../tsconfig.cjs.base.json or ../../tsconfig.esm.base.json
  • Workspace paths at root: @botonic/core and @botonic/react point to ./packages/*/src

Linting and Formatting

  • Biome for lint and format
  • All packages must pass lint and format checks
  • Lint and format must run without errors before considering development complete
  • Config in biome.json (root); packages/botonic-react has overrides for React

Testing

  • When adding or modifying a feature, tests must be added to cover the use case
  • Each package has a tests/ folder with all test files
  • Test file names must end with test.ts or test.tsx
  • All packages must pass tests before considering development complete
  • Jest with jest.config.js or jest.config.cjs per package
  • Tests in tests/, with structure similar to src/
  • Use __mocks__/ for shared mocks within the package

Code Conventions

  1. Imports: Sort imports (Biome organizeImports: on)
  2. Types: Use import type when importing types only
  3. Avoid any, prefer explicit types

Adding/Modifying Packages

  1. Create folder in packages/<name>/
  2. Add package.json with name: "@botonic/<name>"
  3. When creating a new package, start with a version equal to the current minor version of @botonic/core
  4. Create tsconfig.json and tsconfig.esm.json if it compiles TS
  5. Include scripts: build, test, lint, lint:check, format
  6. Add engines: { "node": ">=22.19.0", "npm": ">=10.0.0" }

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.