Hermes Agent: スキルシステム

最終更新:2026-08-31

スキルシステムはHermesの「自己進化」のコアです。あらかじめ設定された機能を使うだけでなく、新しいスキルを学び、既存のスキルを自動改善し、使うほど強くなります。

💡 ヒント: スキルはHermes独自のコア機能です。従来のエージェントと異なり、Hermesのスキルは静的なコードではなく、自動作成、改善、合成可能な動的な能力ユニットです。

📋 前提知識: 第6課 メモリシステム

1. 学ぶ内容

# 内容
スキルの概念と種類
/learnコマンドによる教育
自動スキル学習の仕組み
スキルファイル構造と作成
スキルの合成とチェイニング

2. ストーリー

(1) 課題:毎回同じ指示を繰り返す

BobはAIにコードレビューを頼むたびに「型安全性をチェック、XSS脆弱性を探せ、パフォーマンスをチェック、テストカバレッジ...」と繰り返さなければならない。

(2) 解決策:一度教えれば、永遠に記憶

BASH
/learn When I ask you to review code, always check these 5 items:
1. Type safety (TypeScript strict mode)
2. Security vulnerabilities (XSS, SQL injection)
3. Performance issues (N+1 queries, memory leaks)
4. Test coverage
5. Code style consistency

→ ✅ Skill "code-review-checklist" created!
→ 次回「コードレビュー」と言うだけで、エージェントが5項目を自動実行

3. スキルの種類

種類 ソース 編集可能
組み込み システムプレインストール web-search, code-review
学習済み /learnで作成 my-code-style
自動 観察から作成 frequent-pattern
プラグイン プラグインマーケットプレイス jira-integration
複合 複数スキルの組み合わせ full-review

スキルレベルはシンプル(固定Prompt)から自己進化(観察+改善)まで。


4. /learnコマンド

BASH
# シンプルな嗜好
/learn Always add unit tests when answering code questions

# 条件付きトリガー
/learn When I mention "daily report", summarize today's Git commits

# ツールチェーン
/learn When I say "search", use web-search then summarize

# 名前付きスキル
/learn --name "react-review" When reviewing React components check: props types, hooks rules, performance

インタラクティブ教育

BASH
/learn --interactive

Agent: I'm ready to learn! Describe the skill you want me to learn.
me: Help me do code reviews
Agent: I understand. To create an accurate skill, please answer:
  1. Which languages? → Python, TypeScript
  2. What to focus on? → Security, performance, types
  3. Output format? → Markdown report

me: [Answer questions]

Agent: ✅ Skill "code-review" created!

5. 自動スキル学習

BASH
# 同じようなリクエストを3回行う:
me: Write a FastAPI route with type hints and docs
me: Write another route, same style
me: One more route, same as before

# Hermesが提案:
Agent: 💡 I noticed you've requested the same code style 3 times.
  Create skill "fastapi-route-style"?
  /confirm or /dismiss

me: /confirm
Agent: ✅ Skill "fastapi-route-style" created!

6. スキルファイル構造

YAML
# ~/.hermes/skills/custom/react-component-review.yaml
name: "react-component-review"
description: "Review React component code quality"
version: "1.0.0"
triggers:
  - "review component"
  - "コンポーネント検査"
actions:
  - type: "check"
    category: "type-safety"
    prompt: "Check TypeScript types are complete and correct"
  - type: "check"
    category: "accessibility"
    prompt: "Check WCAG 2.1 accessibility"
  - type: "check"
    category: "performance"
    prompt: "Check React performance issues"
  - type: "generate"
    format: "markdown"
    template: "review-report"

7. スキルの合成

YAML
# 複合スキル
name: "full-release"
description: "Complete release workflow"
type: "composite"
skills:
  - name: "code-review"
  - name: "run-tests"
  - name: "check-security"
  - name: "deploy-staging"
  - name: "notify-team"
execution: "sequential"
BASH
me: Review this component, run tests, deploy if passing

Agent: [Chain execution]
  1. ⚡ code-review → 2 issues found
  2. 🔧 Fix → Done
  3. ⚡ code-review → Passed
  4. 🧪 run-tests → All passed
  5. 🚀 deploy-staging → Deployed
  6. 📢 notify-team → Team notified

❓ よくある質問

Q スキルはいくつ作成できますか?
A ハードリミットはありません。50-100スキルで問題なく動作します。意味検索により数量がパフォーマンスに影響することはありません。
Q スキルを共有できますか?
A はい。hermes skill export <name>でYAMLをエクスポート、他の人がhermes skill importでインポートできます。
Q スキルとツールの違いは?
A ツールはアトミックな操作(ファイル読み込み、検索)です。スキルはより高次の能力(コードレビュー)で、複数のツールを組み合わせることができます。

📖 まとめ


📝 練習問題

  1. 基本(⭐): /learnでシンプルなスキルを作成し、新しい会話で動作することを確認してください。
  2. 中級(⭐⭐): 自動化ワークフローの3ステップツールスキル(検索 → 要約 → 翻訳)を作成してください。
  3. 上級(⭐⭐⭐): 自己進化実験を設計:5日間同じパターンを使用し、エージェントがスキル作成を提案するか観察してください。
Web-Tutorial.com

Web-Tutorial 技術チーム

複数の開発者によって共同維持されているプログラミングチュートリアルプラットフォーム。各チュートリアルは専門分野の開発者が執筆・レビューしています。正確で信頼性の高いコンテンツを目指しています — 問題を見つけた場合はお知らせください。

100%