backend-node — Claude Code rule: what it does, how to install
backend-node is a Claude Code rule for Node.js backend files and hook ingestion logic. It keeps API responses compatible and enforces database transaction safety.
MIT ★ 1,198 updated 2026-10-23
.claude/rules/backend-node.mdWhat backend-node does
The rule scopes to server/**/*.js and scripts/**/*.js. It mandates backward compatibility for API responses unless you explicitly ask for breaking changes. Route modifications require thorough input validation and structured error formats.
Database interactions must follow prepared-statement patterns established in server/db.js. Hook ingestion routines need to remain non-blocking and deterministic, keeping transaction boundaries intact during event handling. Touching status transitions requires verifying session and agent state machines.
What it helps with
- preserve backward compatibility for Node.js API responses
- enforce thorough input validation and structured errors on routes
- keep hook ingestion deterministic and non-blocking
- maintain transaction boundaries in event processing logic
- follow prepared-statement patterns from
server/db.js
Example prompts for the agent
- Add input validation to the new endpoint in
server/routes.js - Refactor event processing in
scripts/worker.jswhile maintaining transaction safety - Update agent status transitions and verify the lifecycle state machine
How to install backend-node
Manually: put the files in place
.claude/rules/backend-node.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/backend-node.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/backend-node.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/backend-node.mdManually: put the files in place
.clinerules/backend-node.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about backend-node
How do I install backend-node in Claude Code?
Place the rule file at .claude/rules/backend-node.md inside your repository. Claude Code applies it automatically when editing matching files.
Which paths does the backend-node rule monitor?
The rule scopes specifically to server/**/*.js and scripts/**/*.js.
How does backend-node handle database queries?
It instructs the assistant to use prepared-statement patterns established in server/db.js and preserve transaction integrity.
Source text
backend-node.md · MIT
--- paths: - "server/**/*.js" - "scripts/**/*.js" --- # Backend and Hook Rules - Keep API responses backward-compatible unless a breaking change is explicitly requested. - Maintain deterministic, non-blocking hook ingestion behavior. - Preserve transaction boundaries and data integrity in event processing logic. - For route changes, validate input thoroughly and return structured errors. - Prefer prepared-statement usage patterns already established in `server/db.js`. - If touching status transitions, verify session and agent lifecycle state machines still make sense.
© hoangsonww · MIT · hoangsonww/Claude-Code-Agent-Monitor