13 nodejs rules available
Thirteen Windsurf rules match nodejs, covering Prisma, NestJS, tRPC, Stripe, WebSockets, Electron and GraphQL; ten are short. Only the Node.js backend rule is substantive. Windsurf's rules documentation now redirects to Devin docs, which use .devin/rules/; legacy .windsurfrules files are still imported. The file below sets backend baselines the integration rules assume.
Windsurf's rules documentation (docs.windsurf.com/windsurf/cascade/memories) now redirects to Devin documentation, which describes rules for the Devin Local agent in Devin Desktop. Current rules live in .devin/rules/*.md with a trigger setting, and the legacy Windsurf files (.windsurf/rules/*.md, .windsurf/global_rules.md and .windsurfrules) are still imported by default. AGENTS.md files are read as always-on rules.
.devin/rules/nodejs.mdStarting point, not a tested configuration for your repository. Applied when files matching globs are involved (trigger: glob). Review the instructions, adapt the file paths and run your project's existing checks.
--- trigger: glob globs: "**/*.js,**/*.mjs,**/*.cjs,**/*.ts" --- # Node.js instructions for Windsurf ## Focus for this project - Verify webhook signatures against the raw request body before parsing. - Record processed event IDs so a retried webhook does not repeat side effects. - Keep secret keys in environment variables validated at startup. ## Node.js conventions - Check "type" in package.json and the engines field: write ESM import syntax in "type": "module" packages and CommonJS otherwise, and only use APIs available in the declared Node.js version. - Import built-ins with the node: prefix (node:fs/promises, node:path) and never use synchronous fs calls on a request path. - Validate every request body, query string and environment variable at the boundary and fail fast on missing configuration. - Await or explicitly handle every promise; no floating promises and no unhandled rejections. ## Before you finish - Run the project's test script (node --test if no framework is configured), lint and type check and report the actual output. If you cannot run them, say so and list the exact commands instead of saying they pass. - Summarize which of the rules above affected the change. - If a legacy .windsurfrules or .windsurf/rules file gives conflicting guidance, point out the conflict instead of silently choosing one.
Create your own Windsurf rules for Node.js and share with the community.
Ask for a small change to one matching file. Check the tool's loaded context or instruction view, inspect the diff for the requested convention, and run the relevant build or test. A well-formatted file does not guarantee the model follows every instruction.
The docs recommend keeping rules short and specific. The current docs say AGENTS.md, AGENTS.local.md and AGENT.md are read as always-on rules, including files in subdirectories. Use .devin/rules/ when you need glob, model-decision or manual triggers.
Documentation checked 2026-11-05: Devin docs: Local customizations (redirect target of Windsurf memories docs)Windsurf docs: Cascade memories (redirects)
Illustrative input and expected result. This example is a verification guide, not a recorded model run.
You use the Windsurf agent to add a Stripe webhook and want signature verification and idempotent processing.
Add a Stripe webhook endpoint that marks invoices paid.
A route reading the raw body, stripe.webhooks.constructEvent with the signing secret, a processed-events check, 400 on bad signatures, tests with a mocked event, and test output.
Content reviewed 2026-11-05. Confirm instruction activation in your installed client before relying on it.
Generate file upload components and handlers