# Claude Code Instructions — isomorphic-rollup

## Review Rules

Before writing or modifying any code, load the relevant rule files from `.claude/rules/` and apply
their detection guidance proactively — catch violations before they are written, not after.

Rule files and the files they govern:
- `rules/polyfill.md` — `src/polyfill/**`
- `rules/ui-page.md` — `src/ui-page/**`, `src/glob/**`
- `rules/node-resolve.md` — `src/node-resolve/**`, `src/resolver/**`, `src/node-fs-adapter/**`, `src/web-fs-loader/**`
- `rules/servicenow-react.md` — `src/servicenow/**`, `src/swc/**`, `src/seismic/**`
- `rules/build-and-deps.md` — `package.json`, `rollup.config.cjs`, any new `src/*/` plugin

## Coding Standards

When writing or modifying code, check for the following:

- **Correctness** — logic errors, edge cases, cross-environment behavior (Node vs browser)
- **Testing** — new plugins require a test file in `test/`; new behavior in existing plugins requires new test cases
- **Dependencies** — exact version pinning only in `package.json`; no `^`, `~`, or ranges
- **Isomorphic safety** — no top-level Node-only imports (`fs`, `path`, `os`) in shared plugin code; use injected FS adapters
- **Error handling** — propagate meaningful error codes (e.g., `ENOENT`); no silent swallowing
- **Export map** — changes to `exports` in `package.json` must be backward-compatible

## Issue Classification

When flagging a problem in code you are reviewing or about to write, use:

- **🚨 Must fix** — rule violation, correctness bug, or breaking change
- **⚠️ Should fix** — important but not blocking (performance, missing test, deprecated pattern)
- **🔍 Observation** — trade-off or nuance worth noting, no action required

## Constraints

- Read relevant rule files before touching any of their scoped paths
- Do not add features, refactors, or cleanup beyond what is asked
- Respect existing code style and conventions in the file being edited
- If a rule would be violated by the requested change, flag it and propose a compliant alternative
