Communitygithub.com

YepAPI/skills

依存関係のセキュリティ — npm audit、ロックファイル検証、サプライチェーン攻撃の防止。

skills とは?

このスキルは、Node.jsプロジェクトにおける依存関係のセキュリティを強化するためのベストプラクティスを提供します。主な機能は、npm auditによる脆弱性スキャン、lockfile-lintを使用したロックファイルの整合性検証、そしてサプライチェーン攻撃の防止です。CI/CDパイプライン(GitHub Actionsなど)に組み込むことで、高リスクまたは重大な脆弱性が検出された場合にビルドを失敗させるルールを強制します。また、新しい依存関係をインストールする前に、ダウンロード数、最終公開日、メンテナー数を確認するなど、パッケージの信頼性を評価する手順も含まれています。Snyk、Socket.dev、GitHub Dependabotなどのツールと統合してリアルタイムのアラートを設定し、週次での依存関係更新を推奨することで、既知の脆弱性の蓄積を防ぎます。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/YepAPI/skills/tree/HEAD/skills/dependency-security

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

依存関係のセキュリティ

ルール

  • CIで npm audit を実行 — 高/重大な脆弱性がある場合はビルドを失敗させる
  • lockfile-lint を使用して、すべてのパッケージが公式のnpmレジストリに解決されることを検証する
  • package.json でメジャーバージョンを固定する:マイナーアップデートには ^ を使用し、* や latest は使用しない
  • 新しい依存関係をインストールする前に確認する:npmのダウンロード数、最終公開日、メンテナー数をチェックする
  • npm ls --all を使用して推移的依存関係を監査する — 直接の依存関係はさらに何百ものパッケージを引き込む
  • Snyk、Socket.dev、またはGitHub Dependabotを設定して、リアルタイムの脆弱性アラートを受信する
  • 依存関係を毎週更新する — 古い依存関係は既知の脆弱性を蓄積する
# GitHub Actions — CIで監査を実行
- name: 依存関係の監査
  run: npm audit --audit-level=high

- name: ロックファイルの整合性を検証
  run: npx lockfile-lint --path package-lock.json --type npm --allowed-hosts npm --validate-https
// package.json — メジャーバージョンを固定
{
  "dependencies": {
    "next": "^14.0.0",
    "react": "^18.0.0",
    "zod": "^3.0.0"
  }
}

避けるべきこと

  • パッケージを事前に確認せずに npm install random-package を実行する — タイポスクワッティングは現実の脅威です
  • npm audit の警告を無視する — 既知の脆弱性は最も簡単な攻撃経路です
  • バージョン範囲として * や latest を使用する — 侵害された公開が即座にビルドに影響します
  • 信頼できないパッケージからの postinstall スクリプトを確認せずに実行する
  • 人気のあるパッケージが安全だと決めつける — event-stream(数百万ダウンロード)も侵害されました

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

YepAPI/skills

WCAG 2.1 AA — semantic HTML, keyboard navigation, screen readers.

YepAPI/skills

Experiment setup, variant splitting, statistical significance, and feature flag integration.

YepAPI/skills

CRUD generators, data tables, user management, role-based access, and bulk operations.

YepAPI/skills

Monitor what ChatGPT and Gemini say about your brand using YepAPI.

YepAPI/skills

Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.

YepAPI/skills

Commander.js, interactive prompts with Clack, spinners, colors, config files, exit codes, and npm publishing.

YepAPI/skills

cmdk integration, Cmd+K trigger, fuzzy search, grouped actions, keyboard navigation, and dynamic action registration.

YepAPI/skills

Content planning with trend and sentiment data from YepAPI.

YepAPI/skills

Content calendar, keyword-driven planning, and content briefs.

YepAPI/skills

Theme switching with CSS variables, system preference detection, next-themes, and persistence.

YepAPI/skills

Threaded comments, @mentions, reactions, moderation queue, optimistic UI, and cursor pagination.

YepAPI/skills

Competitive analysis between domains using YepAPI.

YepAPI/skills

Layout grids, KPI cards, data tables with sorting/filtering, sidebar navigation, and responsive breakpoints.

YepAPI/skills

Data encryption — TLS everywhere, AES-256-GCM for PII, bcrypt passwords, encrypted backups.

YepAPI/skills

Chart patterns with Recharts/Nivo/D3, responsive containers, color scales, and accessibility.

YepAPI/skills

Drizzle schema definition, push vs migrate, type-safe queries, relations, transactions, and prepared statements.

YepAPI/skills

Upload handling, resize/compress, CDN delivery, blur placeholders, and next/image patterns.

YepAPI/skills

Local business and Google Maps research using YepAPI.

YepAPI/skills

Cursor-based pagination, IntersectionObserver, virtualized lists with @tanstack/react-virtual, and scroll position restoration.

YepAPI/skills

Chat UI components, streaming responses with AI SDK, context window management, and RAG patterns.

関連スキル