esm-cjs-risk-scan
Skill by logseq
Scans Logseq ClojureScript Node and Electron code for npm packages that may fail to load because of ESM and CJS incompatibility. Useful when changing Electron dependencies, debugging startup import errors, or auditing packages before upgrades.
Install esm-cjs-risk-scan
Built from the published package, never by AI.
git clone --depth 1 https://github.com/logseq/logseq /tmp/logseq && mkdir -p ~/.claude/skills && cp -r /tmp/logseq/.agents/skills/esm-cjs-risk-scan ~/.claude/skills/esm-cjs-risk-scanRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/logseq/logseq /tmp/logseq && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/logseq/.agents/skills/esm-cjs-risk-scan ~/.gemini/antigravity-cli/skills/esm-cjs-risk-scanAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
The esm-cjs-risk-scan skill runs a Node script that scans ClojureScript source files (.cljs, .cljc, .clj) for three import patterns: shadow-cljs npm imports, direct js/require calls, and dynamic-import calls. For each package it reads the package metadata and probes whether require() and import() succeed from the static, resources, and repository root directories. Results are grouped into HIGH, MEDIUM, OK, and INFO risk levels, each with a suggested action.
The default scope covers only Electron main-process code. The all-node scope adds test, CLI, db-sync, graph-parser, and publishing directories. Output can be a table, TSV, or JSON. The probes run in plain Node rather than inside Electron, so the skill includes a heuristic for Electron-dependent packages and points to compiled shadow-cljs shims as the definitive check. It is aimed at developers working on the Logseq Electron app and its Node tooling.
Written from the project's SKILL.md and checked against it.
What it can do
- Import pattern detectionFinds npm-import, js-require, and dynamic-import usages in ClojureScript files.
- Module load probesTests require() and import() from the static, resources, and root directories.
- Risk classificationLabels each package HIGH, MEDIUM, OK, or INFO with a recommended action.
- Scope selectionScans either electron-only code or all Node-related source directories.
- Multiple output formatsPrints a table, tab-separated values, or JSON, with optional verbose error details.
What you need
- Node.js to run the scanner script
- A Logseq repository checkout with the skill in .agents/skills
- pnpm and Electron for the optional runtime test
Try asking
- Scan the Electron main process for ESM-only packages that may fail on require
Good to know
- Probes run in plain Node, not inside the Electron runtime.
- Electron-dependent packages may need a manual check.
- Browser and worker builds are excluded from the all-node scope.
- The scanner is a pre-build approximation of what shadow-cljs generates.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/skills/esm-cjs-risk-scan/SKILL.md, .agents/skills/esm-cjs-risk-scan/scripts/scan_esm_cjs_risk.mjs. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md13 KB -
scripts/scan_esm_cjs_risk.mjs23 KB
Alternatives to esm-cjs-risk-scan
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
esm-cjs-risk-scan: common questions
Is S:OK R:ERR .:ERR a problem?
No. The skill says this is normal for Electron-specific packages installed in static/node_modules.
What does ERR(e-dep) mean?
The probe failed only because the electron runtime is absent. The skill says such packages load fine in Electron.
What makes require() fail for an ESM package?
The exports map. If exports has only an import key and no default or require key, Node's resolver rejects require().
How do I install esm-cjs-risk-scan?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is esm-cjs-risk-scan free?
The code is published under the AGPL-3.0 licence. The service it connects to may have its own pricing.
Is esm-cjs-risk-scan safe to use?
It scores 89 of 100. Grades: maintenance A, licence C, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to esm-cjs-risk-scan?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
