jpskill.com
🛠️ 開発・MCP コミュニティ

oq

JavaScript/TypeScriptプロジェクトで、UnoCSSやESLintなどの設定を基に、個人の好みに合わせて開発環境を効率的に構築するSkill。

📜 元の英語説明(参考)

oQ's opinionated tooling and conventions for JavaScript/TypeScript projects. Based on Anthony Fu's style with personal customizations for UnoCSS, ESLint, pnpm catalog, and automated releases. Use when setting up new projects with these preferences.

🇯🇵 日本人クリエイター向け解説

一言でいうと

JavaScript/TypeScriptプロジェクトで、UnoCSSやESLintなどの設定を基に、個人の好みに合わせて開発環境を効率的に構築するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-17
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

コーディング規約

コードの構成

  • 単一責任: 各ソースファイルは、明確で焦点を絞ったスコープ/目的を持つべきです。
  • 大規模ファイルの分割: ファイルが大きくなったり、多くの懸念事項を扱ったりする場合は、分割してください。
  • 型の分離: 型とインターフェースは常に types.ts または types/*.ts に分離してください。
  • 定数の抽出: 定数は専用の constants.ts ファイルに移動してください。

ランタイム環境

  • アイソモーフィックコードを優先: 可能であれば、Node、ブラウザ、ワーカーで動作するランタイムに依存しないコードを記述してください。
  • 明確なランタイムインジケーター: コードが環境固有である場合は、ファイルの先頭にコメントを追加してください。
// @env node
// @env browser

TypeScript

  • 明示的な戻り値の型: 可能であれば、戻り値の型を明示的に宣言してください。
  • 複雑なインライン型を避ける: 複雑な型は、専用の type または interface 宣言に抽出してください。

コメント

  • 不要なコメントを避ける: コードは自己説明的であるべきです。
  • 「なぜ」を説明し、「どのように」を説明しない: コメントは、コードが何をするかではなく、その理由や意図を説明するべきです。

テスト (Vitest)

  • テストファイル: foo.tsfoo.test.ts (同じディレクトリ)
  • describe/it API を使用してください (test ではありません)。
  • 複雑な出力には toMatchSnapshot を使用してください。
  • 言語固有のスナップショットには、明示的なパスを指定して toMatchFileSnapshot を使用してください。

ツール選択

@antfu/ni コマンド

コマンド 説明
ni 依存関係をインストールします
ni <pkg> / ni -D <pkg> 依存関係 / 開発依存関係を追加します
nr <script> スクリプトを実行します
nu 依存関係をアップグレードします
nun <pkg> 依存関係をアンインストールします
nci クリーンインストール (pnpm i --frozen-lockfile) を実行します
nlx <pkg> パッケージを実行します (npx)

TypeScript 設定

{
  "compilerOptions": {
    "target": "ESNext",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true
  }
}

ESLint セットアップ

// eslint.config.ts
import antfu from '@antfu/eslint-config'
import nuxt from './.nuxt/eslint.config.mjs'

export default antfu(
  {
    unocss: true,
    pnpm: true,
    typescript: true,
    vue: true,
    rules: {
      'vue/max-attributes-per-line': ['error', {
        singleline: { max: 1 },
        multiline: { max: 1 },
      }],
      'unused-imports/no-unused-imports': 'off',
    },
    formatters: {
      css: true,
      html: true,
      markdown: 'dprint',
    },
  },
)
  .append(nuxt())

詳細な設定オプションについては、oq-eslint-config を参照してください。

Git フック

{
  "simple-git-hooks": {
    "pre-commit": "pnpm i --frozen-lockfile --ignore-scripts --offline && npx lint-staged"
  },
  "lint-staged": { "*": "eslint --fix" },
  "scripts": {
    "prepare": "npx simple-git-hooks"
  }
}

pnpm カタログ

バージョン管理のために pnpm-workspace.yaml で名前付きカタログを使用してください。

カタログ 目的
prod 本番環境の依存関係
inlined バンドラーにインライン化される依存関係
dev 開発ツール (リンター、バンドラー、テスト)
frontend フロントエンドライブラリ

デフォルトのカタログは避けてください。 カタログ名はプロジェクトのニーズに合わせて調整できます。

追加ツール:

  • カタログ管理には pnpm-workspace-utils を使用してください。
  • インタラクティブなパッケージ管理には nip を使用してください。

参考文献

トピック 説明 参照
ESLint 設定 Vue ルールとフォーマッターを備えたカスタムの @antfu/eslint-config セットアップ oq-eslint-config
UnoCSS 設定 フォント、アイコン、プレフィックス付きアトリビュティファイを備えたカスタムの UnoCSS セットアップ oq-unocss-config
プロジェクトセットアップ .gitignore、GitHub Actions、VS Code 拡張機能 setting-up
リリースワークフロー changelogithub を使用した自動リリース release-workflow
pnpm カタログ 厳格な pnpm カタログ設定とツール pnpm-catalog
アプリ開発 Vue/Nuxt/UnoCSS の規約とパターン app-development
モノレポ pnpm ワークスペース、一元化されたエイリアス、Turborepo monorepo
ライブラリ開発 tsdown バンドル、純粋な ESM 公開 library-development
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Coding Practices

Code Organization

  • Single responsibility: Each source file should have a clear, focused scope/purpose
  • Split large files: Break files when they become large or handle too many concerns
  • Type separation: Always separate types and interfaces into types.ts or types/*.ts
  • Constants extraction: Move constants to a dedicated constants.ts file

Runtime Environment

  • Prefer isomorphic code: Write runtime-agnostic code that works in Node, browser, and workers whenever possible
  • Clear runtime indicators: When code is environment-specific, add a comment at the top of the file:
// @env node
// @env browser

TypeScript

  • Explicit return types: Declare return types explicitly when possible
  • Avoid complex inline types: Extract complex types into dedicated type or interface declarations

Comments

  • Avoid unnecessary comments: Code should be self-explanatory
  • Explain "why" not "how": Comments should describe the reasoning or intent, not what the code does

Testing (Vitest)

  • Test files: foo.tsfoo.test.ts (same directory)
  • Use describe/it API (not test)
  • Use toMatchSnapshot for complex outputs
  • Use toMatchFileSnapshot with explicit path for language-specific snapshots

Tooling Choices

@antfu/ni Commands

Command Description
ni Install dependencies
ni <pkg> / ni -D <pkg> Add dependency / dev dependency
nr <script> Run script
nu Upgrade dependencies
nun <pkg> Uninstall dependency
nci Clean install (pnpm i --frozen-lockfile)
nlx <pkg> Execute package (npx)

TypeScript Config

{
  "compilerOptions": {
    "target": "ESNext",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true
  }
}

ESLint Setup

// eslint.config.ts
import antfu from '@antfu/eslint-config'
import nuxt from './.nuxt/eslint.config.mjs'

export default antfu(
  {
    unocss: true,
    pnpm: true,
    typescript: true,
    vue: true,
    rules: {
      'vue/max-attributes-per-line': ['error', {
        singleline: { max: 1 },
        multiline: { max: 1 },
      }],
      'unused-imports/no-unused-imports': 'off',
    },
    formatters: {
      css: true,
      html: true,
      markdown: 'dprint',
    },
  },
)
  .append(nuxt())

For detailed configuration options: oq-eslint-config

Git Hooks

{
  "simple-git-hooks": {
    "pre-commit": "pnpm i --frozen-lockfile --ignore-scripts --offline && npx lint-staged"
  },
  "lint-staged": { "*": "eslint --fix" },
  "scripts": {
    "prepare": "npx simple-git-hooks"
  }
}

pnpm Catalogs

Use named catalogs in pnpm-workspace.yaml for version management:

Catalog Purpose
prod Production dependencies
inlined Bundler-inlined dependencies
dev Dev tools (linter, bundler, testing)
frontend Frontend libraries

Avoid the default catalog. Catalog names can be adjusted per project needs.

Additional tools:

  • Use pnpm-workspace-utils for catalog management
  • Use nip for interactive package management

References

Topic Description Reference
ESLint Config Custom @antfu/eslint-config setup with Vue rules and formatters oq-eslint-config
UnoCSS Config Custom UnoCSS setup with fonts, icons, and prefixed attributify oq-unocss-config
Project Setup .gitignore, GitHub Actions, VS Code extensions setting-up
Release Workflow Automated releases with changelogithub release-workflow
pnpm Catalog Strict pnpm catalog configuration and tools pnpm-catalog
App Development Vue/Nuxt/UnoCSS conventions and patterns app-development
Monorepo pnpm workspaces, centralized alias, Turborepo monorepo
Library Development tsdown bundling, pure ESM publishing library-development