本文へ移動
cccskills
無料GitHub で公開

node-scripts-dev

Use when creating or modifying any .mjs file in the Handsontable monorepo - scripts, utilities, or library modules. Covers .mjs conventions, native node: imports, top-level await, cross-platform compatibility, and fs/promises async patterns. Trigger on any new .mjs file creation, not just files in scripts/ directories.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md4.4 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Writing Node.js .mjs Modules

All Node.js-side code (scripts, utilities, library modules, Playwright helpers, build tooling) is ESM .mjs.

File conventions

  • Extension: .mjs for all Node.js-side code.
  • Location: scripts/ for CLI-invoked scripts, lib/ for shared modules; package-specific paths are fine (performance-tests/lib/, wrappers/react-wrapper/scripts/).
  • Invocation: node scripts/your-script.mjs from package.json scripts, or as a cmd in handsontable/scripts/tasks.json.

Adding npm scripts to the handsontable core package

handsontable/ uses a unified dispatcher. Put every command in handsontable/scripts/tasks.json and keep a thin shim in package.json:

"my-task": {
  "cmd": "node scripts/my-script.mjs",
  "deps": ["build:styles"],
  "mode": "inherit"
}
"my-task": "node scripts/run.mjs my-task"
FieldRequiredValuesPurpose
cmdyesshell stringRun via spawn(..., { shell: true })
depsnotask name arrayTasks that must complete first (DAG scheduler in parallel mode, sequential in direct invocation)
modenoquiet (default) | inherit | interactivequiet = spinner; inherit = stream output (linters); interactive = full TTY pass-through (Jest)
cwdnopath relative to handsontable/Working directory override
passthroughnobooleanAppend extra CLI flags (after --) to the cmd
notenostringAnnotation only

Pipelines go in the pipelines block:

"pipelines": {
  "my-pipeline": {
    "before": ["clean"],
    "tasks": ["my-task", "other-task"],
    "after":  ["prepare-package-for-publish"]
  }
}

before and after run sequentially; tasks run sequentially with --sequential or via DAG with --parallel.

Wrapper packages and performance-tests/, visual-tests/ take scripts directly in their own package.json (no run.mjs dispatcher).

Imports and top-level await

  • Prefix built-ins with node: (import { readFile } from 'node:fs/promises', node:path, node:url, node:child_process, node:util).
  • Use top-level await in module scope; wrap in try/catch only for an error boundary.

Native modules over dependencies

Do not add third-party dependencies for what Node.js does natively.

TaskUseNot
Read/write filesnode:fs/promisesfs-extra
Delete recursivelyrm({ recursive: true, force: true })rimraf
Move/renamerename()mv
Run child processnode:child_process + promisify(exec)execa
Parse CLI argsnode:util parseArgs() or process.argvyargs, commander
Path manipulationnode:pathslash, normalize-path
Glob matchingnode:fs readdir + filter (glob/fast-glob only for complex patterns)glob, fast-glob otherwise

Cross-platform (Linux, macOS, Windows)

  • package.json scripts: use Node helpers in place of bash constructs (if [ ], mv, rm -rf, a && b || c conditionals). Plain && sequencing is fine.
  • Build paths with node:path join().
  • Use async node:fs/promises (readdir, rename, rm, access).
  • __dirname equivalent: import.meta.dirname (Node 21+) or dirname(fileURLToPath(import.meta.url)).
  • Reference: wrappers/react-wrapper/scripts/prepare-types.mjs.

Existence check:

const exists = async (path) => access(path).then(() => true, () => false);

Error handling

  • Set process.exitCode = 1 on failure so cleanup finishes.
  • Comment every silent catch with why the error is swallowed.
  • Include the file path or operation in error messages.

Existing scripts

ScriptPurpose
scripts/sync-skills-to-cursor.mjsSync .claude/skills to .cursor/rules
scripts/translate-to-native-npm.mjsWorkspace command delegation
scripts/verify-bundles.mjsPost-build version verification
scripts/pre-release.mjsPre-release version generation
wrappers/react-wrapper/scripts/prepare-types.mjsCross-platform type preparation

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Use when developing or modifying the @handsontable/angular-wrapper package - Angular components with decorators, NgZone performance optimization, and ng-packagr build system

日本語の概要は準備中です。原文の説明を表示しています。

handsontable/handsontable2.2万2026年10月12日 更新

Use when testing a local or public URL on a real device via BrowserStack, opening a live browser session on Android, iOS, or desktop browsers, or when the user mentions BrowserStack, real device testing, mobile testing, cross-browser testing, touch testing, or wants to verify behavior on a specific phone, tablet, or browser version. Also trigger when the user says "test this on Android/iPhone/Safari/Chrome mobile", asks to open a live session, or mentions demo-mobile.html, even if they don't mention BrowserStack by name.

日本語の概要は準備中です。原文の説明を表示しています。

handsontable/handsontable2.2万2026年10月12日 更新

Use when a source code change needs a changelog entry, or before committing and pushing any bug fix, feature, or behavior change to source code - detecting when entries are required, categorizing changes correctly (added/changed/fixed/deprecated/removed/security), writing user-facing titles, and creating the JSON entry in .changelogs/

日本語の概要は準備中です。原文の説明を表示しています。

handsontable/handsontable2.2万2026年10月12日 更新

Query the pre-built code-review-graph knowledge graph (Tree-sitter, whole monorepo) instead of walking call chains with Grep+Read – 2-6x cheaper, and it catches dynamic dispatch that grep misses. Use for ANY task that spans multiple files, even when the user never mentions a graph or asks for it - fixing or tracing a bug ("fix this bug", "why does X happen", "trace this"), exploring unfamiliar code ("how does X work", "who calls X", "what imports Y", "where is X used or handled"), planning or doing a refactor ("rename X", "is it safe to change or remove X", "what would break", "blast radius", "find dead code"), or reviewing changes ("review this PR", "review this branch or diff"). When you are about to Grep for a symbol's callers, callees, or importers, use this skill.

日本語の概要は準備中です。原文の説明を表示しています。

handsontable/handsontable2.2万2026年10月12日 更新

Use when working with row or column indexes in Handsontable - translating between physical, visual, and renderable coordinates, using IndexMapper, or debugging index-related bugs where rows or columns appear in wrong positions

日本語の概要は準備中です。原文の説明を表示しています。

handsontable/handsontable2.2万2026年10月12日 更新

Use when creating code examples for documentation pages - JavaScript, TypeScript, React, Angular, and Vue variants with proper imports, registration, and license key

日本語の概要は準備中です。原文の説明を表示しています。

handsontable/handsontable2.2万2026年10月12日 更新

handsontable のスキルをすべて見る

このスキルの問題を報告する