Communitygithub.com

SamuelChien/mega-skills-collection

このスキルは、「エージェントを作成」「エージェントを追加」「サブエージェントを記述」「エージェントフロントマター」「使用するタイミングの説明」「エージェントの例」「エージェントツール」「エージェントの色」「自律エージェント」といったユーザーリクエストや、Claude Codeプラグイン向けのエージェント構造、システムプロンプト、トリガー条件、エージェント開発のベストプラクティスに関するガイダンスが必要な場合に使用します。

mega-skills-collection とは?

このスキルは、Claude Codeプラグイン向けのエージェント(自律型サブプロセス)を開発するための包括的なガイドを提供します。エージェントは複雑でマルチステップのタスクを自律的に処理し、ユーザーが開始するアクション用の「コマンド」とは明確に区別されます。本スキルでは、Markdownファイル形式のYAMLフロントマター、descriptionフィールドを使用したトリガー条件の定義、システムプロンプトの設計、モデルや色のカスタマイズなど、エージェント開発に必要なすべての要素をカバーします。具体的には、エージェントの識別子の命名規則(小文字、ハイフン、3~50文字)、descriptionフィールドへの具体的な使用例の追加方法、system promptのベストプラクティス(二人称で記述、責任範囲や分析プロセス、品質基準、出力形式、エッジケースの明記)、ツールアクセスの最小権限原則など、実践的な開発指針が含まれています。また、AIアシスタントを活用した生成支援や手動での作成方法の両方をサポートし、エージェント開発者が効果的で堅牢な自律エージェントを迅速に構築できるようにします。

対応✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/SamuelChien/mega-skills-collection/tree/HEAD/agent-development

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

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

ドキュメント

Claude Codeプラグインのためのエージェント開発

概要

エージェントは、複雑でマルチステップなタスクを自律的に処理するサブプロセスです。エージェントの構造、トリガー条件、システムプロンプトの設計を理解することで、強力な自律機能を作成できます。

主要な概念:

  • エージェントは自律的な作業のため、コマンドはユーザーが開始するアクションのためのもの
  • YAMLフロントマターを含むMarkdownファイル形式
  • 例を用いたdescriptionフィールドによるトリガー
  • システムプロンプトがエージェントの動作を定義
  • モデルと色のカスタマイズ

エージェントファイル構造

完全なフォーマット

---
name: agent-identifier
description: Use this agent when [triggering conditions]. Examples:

<example>
Context: [Situation description]
user: "[User request]"
assistant: "[How assistant should respond and use this agent]"
<commentary>
[Why this agent should be triggered]
</commentary>
</example>

<example>
[Additional example...]
</example>

model: inherit
color: blue
tools: ["Read", "Write", "Grep"]
---

You are [agent role description]...

**Your Core Responsibilities:**
1. [Responsibility 1]
2. [Responsibility 2]

**Analysis Process:**
[Step-by-step workflow]

**Output Format:**
[What to return]

フロントマターフィールド

name (必須)

エージェントの識別子。名前空間と呼び出しに使用されます。

フォーマット: 小文字、数字、ハイフンのみ 長さ: 3〜50文字 パターン: 英数字で始まり、英数字で終わる必要があります

良い例:

  • code-reviewer
  • test-generator
  • api-docs-writer
  • security-analyzer

悪い例:

  • helper (汎用的すぎる)
  • -agent- (ハイフンで開始/終了)
  • my_agent (アンダースコアは不可)
  • ag (短すぎる、3文字未満)

description (必須)

Claudeがこのエージェントをトリガーする条件を定義します。これが最も重要なフィールドです。

必須項目:

  1. トリガー条件 (「Use this agent when...」)
  2. 使用例を示す複数の <example> ブロック
  3. 各例におけるContext、user request、assistant response
  4. エージェントがトリガーされる理由を説明する <commentary>

フォーマット:

Use this agent when [conditions]. Examples:

<example>
Context: [Scenario description]
user: "[What user says]"
assistant: "[How Claude should respond]"
<commentary>
[Why this agent is appropriate]
</commentary>
</example>

[More examples...]

ベストプラクティス:

  • 2〜4つの具体的な例を含める
  • プロアクティブなトリガーとリアクティブなトリガーの両方を示す
  • 同じ意図の異なる言い回しをカバーする
  • commentaryで推論を説明する
  • エージェントを使用すべきでない場合について具体的に記述する

model (必須)

エージェントが使用するモデル。

オプション:

  • inherit - 親と同じモデルを使用 (推奨)
  • sonnet - Claude Sonnet (バランス型)
  • opus - Claude Opus (最も高性能、高コスト)
  • haiku - Claude Haiku (高速、低コスト)

推奨事項: エージェントが特定のモデル機能を必要としない限り、inherit を使用してください。

color (必須)

UIにおけるエージェントの視覚的な識別子。

オプション: blue, cyan, green, yellow, magenta, red

ガイドライン:

  • 同じプラグイン内の異なるエージェントには異なる色を選択する
  • 類似したエージェントタイプには一貫した色を使用する
  • 青/シアン: 分析、レビュー
  • 緑: 成功指向のタスク
  • 黄: 注意、検証
  • 赤: クリティカル、セキュリティ
  • マゼンタ: クリエイティブ、生成

tools (オプション)

エージェントを特定のツールに制限します。

フォーマット: ツール名の配列

tools: ["Read", "Write", "Grep", "Bash"]

デフォルト: 省略した場合、エージェントはすべてのツールにアクセスできます

ベストプラクティス: ツールは必要な最小限に制限する (最小権限の原則)

一般的なツールセット:

  • 読み取り専用の分析: ["Read", "Grep", "Glob"]
  • コード生成: ["Read", "Write", "Grep"]
  • テスト: ["Read", "Bash", "Grep"]
  • フルアクセス: フィールドを省略するか、 ["*"] を使用する

システムプロンプトの設計

Markdown本文がエージェントのシステムプロンプトになります。エージェントに直接語りかける二人称で記述します。

構造

標準テンプレート:

You are [role] specializing in [domain].

**Your Core Responsibilities:**
1. [Primary responsibility]
2. [Secondary responsibility]
3. [Additional responsibilities...]

**Analysis Process:**
1. [Step one]
2. [Step two]
3. [Step three]
[...]

**Quality Standards:**
- [Standard 1]
- [Standard 2]

**Output Format:**
Provide results in this format:
- [What to include]
- [How to structure]

**Edge Cases:**
Handle these situations:
- [Edge case 1]: [How to handle]
- [Edge case 2]: [How to handle]

ベストプラクティス

✅ 推奨事項:

  • 二人称で記述する (「You are...」、「You will...」)
  • 責任について具体的に記述する
  • ステップバイステップのプロセスを提供する
  • 出力フォーマットを定義する
  • 品質基準を含める
  • エッジケースに対処する
  • 10,000文字未満に抑える

❌ 避けるべきこと:

  • 一人称で記述する (「I am...」、「I will...」)
  • 曖昧または汎用的にする
  • プロセスステップを省略する
  • 出力フォーマットを未定義のままにする
  • 品質ガイダンスをスキップする
  • エラーケースを無視する

エージェントの作成

方法1: AIアシスト生成

以下のプロンプトパターンを使用します (Claude Codeから抽出):

Create an agent configuration based on this request: "[YOUR DESCRIPTION]"

Requirements:
1. Extract core intent and responsibilities
2. Design expert persona for the domain
3. Create comprehensive system prompt with:
   - Clear behavioral boundaries
   - Specific methodologies
   - Edge case handling
   - Output format
4. Create identifier (lowercase, hyphens, 3-50 chars)
5. Write description with triggering conditions
6. Include 2-3 <example> blocks showing when to use

Return JSON with:
{
  "identifier": "agent-name",
  "whenToUse": "Use this agent when... Examples: <example>...</example>",
  "systemPrompt": "You are..."
}

その後、フロントマターを含むエージェントファイル形式に変換します。

完全なテンプレートについては examples/agent-creation-prompt.md を参照してください。

方法2: 手動作成

  1. エージェント識別子を選択する (3〜50文字、小文字、ハイフン)
  2. 例を含むdescriptionを記述する
  3. モデルを選択する (通常は inherit)
  4. 視覚的識別のための色を選択する
  5. ツールを定義する (アクセスを制限する場合)
  6. 上記の構造でシステムプロンプトを記述する
  7. agents/agent-name.md として保存する

バリデーションルール

識別子のバリデーション

✅ 有効: code-reviewer, test-gen, api-analyzer-v2
❌ 無効: ag (短すぎる), -start (ハイフンで開始), my_agent (アンダースコア)

ルール:

  • 3〜50文字
  • 小文字、数字、ハイフンのみ
  • 英数字で開始および終了する必要がある
  • アンダースコア、スペース、特殊文字は不可

descriptionのバリデーション

長さ: 10〜5,000文字 必須項目: トリガー条件と例 最適: 200〜1,000文字、2〜4つの例

システムプロンプトのバリデーション

長さ: 20〜10,000文字 最適: 500〜3,000文字 構造: 明確な責任、プロセス、出力フォーマット

エージェントの整理

プラグインエージェントディレクトリ

plugin-name/
└── agents/
    ├── analyzer.md
    ├── reviewer.md
    └── generator.md

agents/ 内のすべての .md ファイルは自動的に検出されます。

名前空間

エージェントは自動的に名前空間に配置されます:

  • 単一プラグイン: agent-name
  • サブディレクトリあり: plugin:subdir:agent-name

エージェントのテスト

トリガーのテスト

エージェントが正しくトリガーされることを確認するためのテストシナリオを作成します:

  1. 特定のトリガー例を含むエージェントを記述する
  2. テストで例と同様の表現を使用する
  3. Claudeがエージェントをロードすることを確認する
  4. エージェントが期待される機能を提供することを確認する

システムプロンプトのテスト

システムプロンプトが完全であることを確認します:

  1. エージェントに典型的なタスクを与える
  2. プロセスステップに従うことを確認する
  3. 出力フォーマットが正しいことを確認する
  4. プロンプトで言及されているエッジケースをテストする
  5. 品質基準が満たされていることを確認する

クイックリファレンス

最小限のエージェント

---
name: simple-agent
description: Use this agent when... Examples: <example>...</example>
model: inherit
color: blue
---

You are an agent that [does X].

Process:
1. [Step 1]
2. [Step 2]

Output: [What to provide]

フロントマターフィールドの概要

フィールド必須フォーマット例
nameはい小文字-ハイフンcode-reviewer
descriptionはいテキスト + 例Use when... ...
modelはいinherit/sonnet/opus/haikuinherit
colorはい色名blue
toolsいいえツール名の配列["Read", "Grep"]

ベストプラクティス

推奨事項:

  • ✅ descriptionに2〜4つの具体的な例を含める
  • ✅ 具体的なトリガー条件を記述する
  • ✅ 特別な必要性がない限り、modelには inherit を使用する
  • ✅ 適切なツールを選択する (最小権限)
  • ✅ 明確で構造化されたシステムプロンプトを記述する
  • ✅ エージェントのトリガーを徹底的にテストする

避けるべきこと:

  • ❌ 例のない汎用的なdescriptionを使用する
  • ❌ トリガー条件を省略する
  • ❌ すべてのエージェントに同じ色を設定する
  • ❌ 不要なツールアクセスを許可する
  • ❌ あいまいなシステムプロンプトを記述する
  • ❌ テストをスキップする

追加リソース

リファレンスファイル

詳細なガイダンスについては、以下を参照してください:

  • references/system-prompt-design.md - 完全なシステムプロンプトパターン
  • references/triggering-examples.md - 例のフォーマットとベストプラクティス
  • references/agent-creation-system-prompt.md - Claude Codeからの正確なプロンプト

サンプルファイル

examples/ にある実際の例:

  • agent-creation-prompt.md - AIアシストエージェント生成テンプレート
  • complete-agent-examples.md - さまざまなユースケース向けの完全なエージェント例

ユーティリティスクリプト

scripts/ にある開発ツール:

  • validate-agent.sh - エージェントファイル構造のバリデーション
  • test-agent-trigger.sh - エージェントが正しくトリガーされるかテスト

実装ワークフロー

プラグイン用のエージェントを作成するには:

  1. エージェントの目的とトリガー条件を定義する
  2. 作成方法を選択する (AIアシストまたは手動)
  3. agents/agent-name.md ファイルを作成する
  4. 必要なすべてのフィールドを含むフロントマターを記述する
  5. ベストプラクティスに従ってシステムプロンプトを記述する
  6. descriptionに2〜4つのトリガー例を含める
  7. scripts/validate-agent.sh でバリデーションする
  8. 実際のシナリオでトリガーをテストする
  9. プラグインのREADMEにエージェントを文書化する

自律動作のための明確なトリガー条件と包括的なシステムプロンプトに焦点を当ててください。

Individual skills in this repo

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

SamuelChien/mega-skills-collection

Security audit, hardening, threat modeling (STRIDE/PASTA), Red/Blue Team, OWASP checks, code review, incident response, and infrastructure security for any project.

SamuelChien/mega-skills-collection

Arquitecto de Soluciones Principal y Consultor Tecnológico de Andru.ia. Diagnostica y traza la hoja de ruta óptima para proyectos de IA en español.

SamuelChien/mega-skills-collection

Ingeniero de Sistemas de Andru.ia. Diseña, redacta y despliega nuevas habilidades (skills) dentro del repositorio siguiendo el Estándar de Diamante.

SamuelChien/mega-skills-collection

Estratega de Inteligencia de Dominio de Andru.ia. Analiza el nicho específico de un proyecto para inyectar conocimientos, regulaciones y estándares únicos del sector. Actívalo tras definir el nicho.

SamuelChien/mega-skills-collection

2D game development principles. Sprites, tilemaps, physics, camera.

SamuelChien/mega-skills-collection

3D game development principles. Rendering, shaders, physics, cameras.

SamuelChien/mega-skills-collection

Expert in building 3D experiences for the web - Three.js, React Three Fiber, Spline, WebGL, and interactive 3D scenes. Covers product configurators, 3D portfolios, immersive websites, and bringing depth to web experiences.

SamuelChien/mega-skills-collection

Accessibility audit skill for scanning, fixing, and verifying WCAG 2.2 Level A and AA compliance across React, Next.js, Vue, Angular, Svelte, and plain HTML codebases. Use when auditing accessibility, fixing a11y violations, checking color contrast, generating compliance reports, or integrating accessibility checks into CI/CD pipelines.

SamuelChien/mega-skills-collection

Ab Test Analyzer - Auto-activating skill for Data Analytics. Triggers on: ab test analyzer, ab test analyzer Part of the Data Analytics skill category.

SamuelChien/mega-skills-collection

A B Test Config Creator - Auto-activating skill for ML Deployment. Triggers on: a b test config creator, a b test config creator Part of the ML Deployment skill category.

SamuelChien/mega-skills-collection

When the user wants to plan, design, or implement an A/B test or experiment. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "conversion experiment," "statistical significance," or "test this." For tracking implementation, see analytics-tracking.

SamuelChien/mega-skills-collection

Acceptance Criteria Creator - Auto-activating skill for Enterprise Workflows. Triggers on: acceptance criteria creator, acceptance criteria creator Part of the Enterprise Workflows skill category.

SamuelChien/mega-skills-collection

Use when a coding task should be driven end-to-end from issue intake through implementation, review, deployment, and acceptance verification with minimal human re-intervention.

SamuelChien/mega-skills-collection

Accessibility Audit Runner - Auto-activating skill for Frontend Development. Triggers on: accessibility audit runner, accessibility audit runner Part of the Frontend Development skill category.

SamuelChien/mega-skills-collection

You are an accessibility expert specializing in WCAG compliance, inclusive design, and assistive technology compatibility. Conduct audits, identify barriers, and provide remediation guidance.

SamuelChien/mega-skills-collection

Web accessibility patterns for WCAG 2.2 compliance including ARIA, keyboard navigation, screen readers, and testing

SamuelChien/mega-skills-collection

Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed, or change policy for the Discord channel.

SamuelChien/mega-skills-collection

Create unified specification packages across Business, Development, and Design teams. Staged elaboration (L0 Vision → L1 Requirements → L2 Team Detail → L3 Acceptance Criteria) to build shared understanding. Does not write code.

SamuelChien/mega-skills-collection

Research a company or person and get actionable sales intel. Works standalone with web search, supercharged when you connect enrichment tools or your CRM. Trigger with "research [company]", "look up [person]", "intel on [prospect]", "who is [name] at [company]", or "tell me about [company]".

SamuelChien/mega-skills-collection

Validate messaging consistency across website, GitHub repos, and local documentation generating read-only discrepancy reports. Use when checking content alignment or finding mixed messaging. Trigger with phrases like "check consistency", "validate documentation", or "audit messaging".

関連スキル