AgentLint Verified 100/100259 JavaScript repos analyzed

    JavaScript CLAUDE.md & AGENTS.md Template

    ESM/CJS hygiene, Node test runners, and dependency discipline distilled from 259 JavaScript repos.

    # JavaScript Project — JavaScript Harness
    
    Node.js 22 ESM project tested with `node --test` / Vitest and linted with ESLint.
    
    ## Commands
    
    - Install cleanly: `npm ci`
    - Fast single test: `node --test test/target.test.js`
    - Full suite: `npm test`
    - Lint: `npm run lint`
    
    ## Rules
    
    - Don't use `require()` inside browser-targeted ESM modules. Instead use static ES `import`. Because Vite/Rollup leaks `require` into browser bundles and crashes at runtime.
    - Don't add new runtime dependencies without justification. Instead use Node 22 built-ins (`fetch`, `node:test`, `node:fs/promises`). Because extra packages widen supply-chain risk.
    - When changing CLI arguments, read `docs/cli-spec.md` before editing parsers.
    
    ## Continuity
    
    - Keep `.env` and `CLAUDE.local.md` in `.gitignore` and update `HANDOFF.md` at milestones.

    Most Adopted JavaScript Rules Across Real Open-Source Repos

    Measured across 259 public JavaScript repositories in the 4,533-repo harness study:

    npmtooling

    npm package manager

    43.2%112 repos
    reactframework

    React for UI

    35.1%91 repos
    error-handlingpatterns

    Proper error handling with context

    30.5%79 repos
    unit-teststesting

    Write unit tests for all changes

    28.6%74 repos
    nodejsframework

    Node.js runtime

    27.8%72 repos
    dockertooling

    Docker for containerization

    25.1%65 repos
    conventional-commitsworkflow

    Use conventional commit messages

    24.3%63 repos
    ci-cdtooling

    CI/CD pipeline must pass

    20.1%52 repos
    Essential Commands (Checks W1 & W7)
    install
    npm ci
    fastTest
    node --test test/unit.test.js
    fullTest
    npm test
    lint
    npm run lint
    build
    npm run build
    Common JavaScript Agent Pitfalls
    • 01Agents mix require() into browser ESM bundles, breaking production builds silently.
    • 02Unpinned dependencies or npm install instead of npm ci causes lockfile churn.

    More Verified Stack Templates