AGENTS.md•1.84 kB
# AGENTS.md — Quick Rules for Coding Agents
- Build: `npm install`; `npm run build`; watch: `npm run dev`.
- Lint: `npm run lint` (type-check only; no ESLint/Prettier).
- Test (all): `npm test`; coverage: `npm run test:coverage`; watch: `npm run test:watch`.
- Test (single file): `npm test -- src/__tests__/n8n-client.test.ts`.
- Test (single case): `npm test -- -t "pattern"` (works with watch too).
- Node/TS: Node >= 18; ESM only; strict TS (`tsconfig.json`).
- Imports: Always use relative ESM with `.js` extension in TS (e.g., `./types.js`).
- Layout: source in `src/`; tests in `src/__tests__/` as `<name>.test.ts`; build to `dist/`.
- Formatting: two-space indent; match surrounding style; avoid gratuitous refactors.
- Types: avoid `any`; prefer explicit types; use `unknown` then narrow; `Record<string, unknown>` for maps.
- Naming: files kebab-case; types/interfaces PascalCase; functions/vars camelCase; constants UPPER_SNAKE if truly constant.
- Errors: Return structured JSON via `success()`/`error()` from `src/output.ts`.
- Logging: Use `logger` (stderr). Do not `console.log` (MCP stdout must stay clean).
- Secrets: Never log secrets; built-in redaction exists; don’t echo env vars.
- Debug: `MCP_DEBUG=debug` and/or `MCP_ENABLE_SOURCE_MAPS=1` for richer stacks.
- Jest: ESM via `ts-jest`; tests matched by `**/__tests__/**/*.test.ts`; mapper strips `.js` in tests.
- CI parity: `npm ci && npm run lint && npm run build && npm test && npm run test:coverage` before PRs.
- Copilot: Follow `.github/copilot-instructions.md` — never cancel builds/tests; timeouts: install 60s, build 30s, test 30s, coverage 60s.
- Cursor rules: None present now; if added under `.cursor/` or `.cursorrules`, follow them.
- Security: Don’t commit secrets; configure `N8N_BASE_URL` + `N8N_API_KEY` or `N8N_USERNAME`/`N8N_PASSWORD`.