Communitygithub.com

ml-adoption-playbook

AIエージェントやソフトウェアエンジニアが既存の非MLコードベースに機械学習アルゴリズムを追加するためのエンドツーエンドの方法論。問題の枠組み設定、データの準備、アーキテクチャの分離、ベースラインモデルの統合をカバーします。問題の枠組みからベースラインモデルまで、機械学習機能をコードベースに追加する際に使用します。

ml-adoption-playbook とは?

このスキルは、機械学習モデルを既存のソフトウェアエンジニアリングプロジェクトに実装するための適応型方法論を提供します。従来のソフトウェアエンジニアリングとMLOpsのギャップを埋め、MLの調査、分離、トレーニング、統合の構造化を支援します。主なフェーズは5つあります。フェーズ1「問題の枠組み設定と実現可能性」では、ヒューリスティックなチェック、ビジネス指標の定義、間違い予算の設定を行います。フェーズ2「データの準備」では、データソースの監査、データ契約の確立、データリークの防止を実施します。フェーズ3「アーキテクチャ統合と分離」では、モデルをAPIエンドポイントや専用サービスとして分離し、フォールバックメカニズムやフィーチャーフラグを設計します。フェーズ4「モデル実装とトレーニング」では、シンプルなベースラインモデルから始め、再現可能性を確保し、評価スクリプトを作成します。フェーズ5「MLOpsへの引き継ぎ」では、実験トラッキングやモデルレジストリ、ドリフト検出のセットアップを案内します。このプレイブックは、Claude Code、Cursor、CodexなどのAIエージェントがユーザーと対話しながら各フェーズを進め、適切な質問を投げかけ、データ契約を作成し、分離インターフェースを記述し、再現可能なトレーニングスクリプトを提供することを想定しています。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/ml-adoption-playbook

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

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

ドキュメント

ML採用プレイブック

このスキルは、機械学習モデルを既存のソフトウェアエンジニアリングプロジェクトに導入するための適応型手法を提供します。従来のSWEとMLOpsのギャップを埋め、MLの調査、デカップリング、トレーニング、統合の方法を構造化します。

アクティベーションのタイミング

  • ユーザーが既存のコードベースに「MLを追加する」または「アルゴリズムを追加する」と依頼した場合。
  • 新しいモデル(例:レコメンデーション、分類、予測)を非MLアプリケーションに統合する計画を立てている場合。
  • エージェントがMLコンポーネントを適応的に構築、トレーニング、デプロイするためのワークフローを構造化する場合。

フェーズ1:問題のフレーミングと実現可能性

モデルコードを書く前に、「なぜ」と「どのように」を確立します。

  • ヒューリスティックチェック: 単純なヒューリスティック(例:正規表現、ルールベースのソート)で問題をより早く解決できるかどうかをユーザーに尋ねます。可能であれば、そこから始めます。
  • メトリクスの定義: MLモデルが改善しようとしているビジネスメトリクス(例:クリックスルー率、レイテンシ低減)を定義します。
  • ミス予算: 「悪い」予測がどのようなものか、システムがどのようにそれに対処するかを定義します。

フェーズ2:データの準備状態

データがクリーンでアクセス可能でなければ、MLは役に立ちません。

  • データソースの監査: トレーニングデータがどこにあるかを特定します。ライブデータベース、静的CSV、APIのいずれですか?
  • データ契約: 入力データのスキーマを確立します。必要な特徴量は何ですか?特徴量が欠落している場合はどうなりますか?
  • 漏洩防止: ユーザーが提案するデータ分割が、誤って将来の情報をトレーニングセットに漏洩させないことを確認します(例:時系列データの時系列分割)。

フェーズ3:アーキテクチャ統合とデカップリング

モデル推論をコアビジネスロジックに強く結合させないでください。

  • API境界: モデルをAPIエンドポイント(例:fastapi-patterns や django-patterns の使用)または専用のサービスクラスの背後に配置することを提案します。
  • フォールバックメカニズム: デフォルト状態を設計します。モデルの応答に時間がかかりすぎる場合やエラーが発生した場合、システムはハードコードされたルールに正常にフォールバックする必要があります。
  • フィーチャーフラグ: 新しいML推論呼び出しをフィーチャーフラグでラップし、安全にロールアウト(またはロールバック)できるようにします。

フェーズ4:モデルの実装とトレーニング

再現性と反復のためにコードを構造化します。

  • シンプルに始める: 最初にベースラインモデルを構築します(例:シンプルなscikit-learnのロジスティック回帰、または最小限のPyTorch線形層)。
  • 再現性: pytorch-patterns または同様のベストプラクティスを適用します:ランダムシードを固定し、コードをデバイス非依存にし、テンソル/配列の形状を明示的に文書化します。
  • 自動化された証拠: データ変換と推論スキーマのテストを要求します。ベースラインと比較する評価スクリプトなしでモデルを受け入れないでください。

フェーズ5:MLOpsへの引き継ぎ

ベースラインモデルが統合されたら、継続的な運用に焦点を移します。

  • mle-workflow を参照: ユーザーを実験トラッキング、モデルレジストリ、ドリフト検出の設定へと導きます。
  • CI/CD: 既存のCIパイプラインにモデル評価ステップを追加し、将来のコミットでモデルパフォーマンスが低下しないようにします。

反復的エージェントワークフロー

このプレイブックを介してユーザーを支援する際、エージェントは次のことを行う必要があります。

  1. 明確化の質問をして アーキテクチャを提案する前にフェーズ1を完了します。
  2. データ契約のドラフト をフェーズ2で作成し、ユーザーの承認を得ます。
  3. デカップリングインターフェース(API/サービス) をフェーズ3で記述し、その後 トレーニングループを記述します。
  4. 再現可能なスクリプト をフェーズ4で提供し、モデルをトレーニングしてアーティファクトを保存します。

Individual skills in this repo

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

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

関連スキル