d-zero-dev/frontend-guidelines/dzero-js

Claude Code and agent skill by d-zero-dev/frontend-guidelines

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

D-ZERO の JavaScript/TypeScript コーディング規約。JS/TS を書く・編集する・レビューするときに使う。イベント処理、DOM 操作、状態変更、ライブラリ追加、スクリプト読み込みに適用する。

Install

npx vskill@latest install d-zero-dev/frontend-guidelines/dzero-js

SKILL.md

The same SKILL.md was published earlier as majiayu000/claude-skill-registry-data/dzero-js.

JavaScript コーディング規約

実装レイヤー選定(dzero-tech-selection)を経ていない場合は先にそちらを読むこと。HTML だけで実現できるものは JavaScript で実装しない。 詳細はJavaScript ガイドラインを参照。

実装規範

モジュール設計
  • 目的や機能ごとにファイルを分割する
  • 実行タイミングをコントロールできるよう、ひとつの関数にまとめて export する(定数の export は可)
  • importした時点でブラウザや DOM に影響する処理が走る実装(import 副作用)を避ける。import 後に任意に実行できる状態にする
  • type="module"環境のためファイル参照に拡張子は必須。TypeScript ファイルの参照は.tsを.jsに変えて書く。__assets/_libsはエイリアス@で参照する
DOM・スタイル操作
  • style属性のプロパティを直接書き換えない。状態の変更は、その状態を表すdata-*属性の変更で行い、スタイルは CSS 側で管理する(JS はロジックと管理に徹する)
  • 動的な値を反映する場合はカスタムプロパティを使う(el.style.setProperty('--block-size', ...))
  • インタラクションの呼び出しはcommand属性を基本とし、規定にないアクションやフックはcommandイベント(e.command/e.source)で実装する。[commandfor]の要素に直接イベントリスナを張るような、意図と振る舞いの関連が不明確な実装は避ける
パフォーマンス
  • 頻発するイベント・タイマー(scroll/resize/mousemove/touchmove/wheel/setTimeout/setInterval)での監視は避け、代替 API を使う:
  • ビューポート進入の検知 → IntersectionObserver
  • 要素サイズ変更の検知 → ResizeObserver
  • ウィンドウ幅・メディアクエリ状態 → window.matchMedia
  • イベントリスナには Passive Event Listener({ passive: true })を利用する
  • 同一フレーム内で複数回走りうる処理はrequestAnimationFrame(+ cancelAnimationFrame)で間引く
  • 同じ戻り値を期待できる処理(セレクタクエリ等)は変数化して繰り返さない
ライブラリ
  • 許可リスト: core-js、@oddbird/popover-polyfill、invokers-polyfill、what-input、jQuery、Splide。リスト外のライブラリは必ず相談する
  • 信頼性(継続的な保守運用が可能か)を十分に検証する
  • yarn で NPM からインストールしてimportで利用するのが基本。package.jsonとyarn.lockの変更はコミットする
  • CDN から直接参照しない。外部ファイルとして読み込む必要がある場合はダウンロードして同じサーバーにセルフホストする
読み込み
  • script要素にはtype="module"が必要。基本はimportを利用し、script要素での直接読み込みは例外(依存順に注意)
  • インライン JavaScript が許されるのは、タグマネージャー・トラッキング・SNS 埋め込み・そのページ限定と保証されたコードのみ。書く場合は<script type="module">(タグマネージャー等は加工せずそのまま貼る)
lint
  • リントエラー(ESLint/Prettier)は例外なく必ず修正する。eslint-disableで逃げず、ルールが現状にそぐわない場合は Config ファイルの変更を提案する

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
20
Repository forks
6
7-day trend score
0

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/d-zero-dev/frontend-guidelines/dzero-js/badge)](https://verified-skill.com/skills/d-zero-dev/frontend-guidelines/dzero-js)

Something wrong with this skill or its page? Tell us.