以下の内容はhttps://www.yokoyan.net/entry/2026/01/02/125050より取得しました。


はじめての ClaudeCode セットアップと Agent Skills を動かしたのでメモ

はじめに

年始に時間があったので、ClaudeCodeと Agent Skillsに触れたのでメモ。

参考手順

school.learning-next.app

インストール環境

  • Windows11 Pro 64bit

事前準備

  • Windows版Nodeのインストール
  • PowerShellの権限変更
    • 管理者で起動し、以下ポリシーを変更。 Set-ExecutionPolicy RemoteSigned

ClaudeCodeのインストール

  • PowerShellで以下のコマンドを実行。 npm install -g @anthropic-ai/claude-code
  • バージョン確認
claude --version
2.0.76 (Claude Code)

ClaudeCodeの起動と初期設定

  • PowerShellで、 Claude コマンドを実行する
  • EnterKey を押下
Welcome to Claude Code v2.0.76
…………………………………………………………………………………………………………………………………………………………

     *                                       █████▓▓░
                                 *         ███▓░     ░░
            ░░░░░░                        ███▓░
    ░░░   ░░░░░░░░░░                      ███▓░
   ░░░░░░░░░░░░░░░░░░░    *                ██▓░░      ▓
                                             ░▓▓███▓▓░
 *                                 ░░░░
                                 ░░░░░░░░
                               ░░░░░░░░░░░░░░░░
       █████████                                        *
      ██▄█████▄██                        *
       █████████      *
…………………█ █   █ █………………………………………………………………………………………………………………

 Let's get started.

 Choose the text style that looks best with your terminal
 To change this later, run /theme

 ❯ 1. Dark mode ✔
   2. Light mode
   3. Dark mode (colorblind-friendly)
   4. Light mode (colorblind-friendly)
   5. Dark mode (ANSI colors only)
   6. Light mode (ANSI colors only)

╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
 1  function greet() {
 2 -  console.log("Hello, World!");
 2 +  console.log("Hello, Claude!");
 3  }
  • Claudeのサブスクリプション設定。1を選択して、Enterを押す
 Claude Code can be used with your Claude subscription or billed based on API usage through your Console account.

 Select login method:

 ❯ 1. Claude account with subscription · Pro, Max, Team, or Enterprise

   2. Anthropic Console account · API usage billing
  • ブラウザが起動するので、承認する
  • ターミナルに戻り、以下が表示されれば成功
Logged in as hoge@fuga
Login successful. Press Enter to continue…
  • ターミナルの初期設定。Enterを押す。
 Use Claude Code's terminal setup?

 For the optimal coding experience, enable the recommended settings
 for your terminal: Shift+Enter for newlines

 ❯ 1. Yes, use recommended settings
   2. No, maybe later with /terminal-setup

 Enter to confirm · Esc to skip
  • 以下のように表示されれば設定完了。
╭─── Claude Code v2.0.76   /model to try Opus 4.5

─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
> Try "write a test for <filepath>"
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ? for shortcuts        

プロジェクト初期化

  • /init で初期化。 CLAUDE.md ファイルを生成する。
 Opened changes in Visual Studio Code ⧉

 Save file to continue…

 Do you want to make this edit to CLAUDE.md?
 ❯ 1. Yes
   2. Yes, allow all edits during this session (shift+tab)
   3. Type here to tell Claude what to do differently

はじめての Agent Skills の作成

  • ターミナルに以下を入力
> 動くAgent Slillsのサンプルを作成してください。
  • SLILL.md など作成される。
  • 最終成果物は以下。
Agent Skillsの動作サンプルを作成しました!以下の内容が含まれています:

  作成したファイル

  📚 ドキュメント

  - README.md - Agent Skillsの完全な日本語チュートリアル
  - CLAUDE.md - Claude Codeのための技術ガイド(更新済み)

  🎯 Agent Skills

  1. Simple Commit Helper(基本例)

  .claude/skills/simple-commit-helper/SKILL.md
  - 単一ファイル構造のシンプルなSkill
  - Gitコミットメッセージを生成
  - 使用方法: "Help me write a commit message" とClaude Codeに尋ねる

  2. Anthropic API Reviewer(高度な例)

  .claude/skills/anthropic-api-reviewer/
  ├── SKILL.md           # メインSkill定義
  ├── REFERENCE.md       # 詳細なAPIリファレンス
  └── scripts/
      └── find_api_usage.py  # API使用検出スクリプト
  - マルチファイル構造
  - ツール制限(allowed-tools)の実装例
  - Pythonヘルパースクリプト付き
  - 使用方法: "Review my Anthropic API code" とClaude Codeに尋ねる

  使い方

  1. Claude Codeを再起動してSkillsを読み込む
  2. 利用可能なSkillsを確認:
  "What skills are available?"
  3. Skillsを試す:
    - Commit Helper: "Help me create a commit message"
    - API Reviewer: "Review the hello_world.py file"

  主な特徴

  - ✅ 2つの完全に動作するAgent Skillsサンプル
  - ✅ 基本から高度な構造まで実例を提供
  - ✅ 日本語の詳細なドキュメント
  - ✅ ツール制限とマルチファイル構造の実装例
  - ✅ 実用的なユーティリティスクリプト
  - ✅ テスト済み(find_api_usage.pyスクリプトが正常に動作)

  これで、Agent Skillsの作成方法を学ぶための完全なチュートリアル環境が整いました!

作成された Skills の確認

> 使えるスキルを教えて下さい 

● このリポジトリに作成したAgent Skillsは以下の2つです:

  1. simple-commit-helper(シンプル・コミット・ヘルパー)

  説明: ステージされたGit変更から明確で簡潔なコミットメッセージを生成します

  いつ使えるか:
  - コミットメッセージを作成したい時
  - コミット内容をレビューしたい時

  使用例:
  "コミットメッセージを書いて"
  "Help me create a commit message"
  "何をコミットするか確認したい"

  ファイル: .claude/skills/simple-commit-helper/SKILL.md

  ---
  2. anthropic-api-reviewer(Anthropic APIレビュアー)

  説明: Anthropic Claude APIを使用するPythonコードをレビューし、ベストプラクティス、エラーハンドリング、最適化をチェックします

  いつ使えるか:
  - Anthropic APIを使うコードをレビューしたい時
  - APIの使い方が正しいか確認したい時
  - ベストプラクティスに従っているかチェックしたい時

  使用例:
  "hello_world.pyをレビューして"
  "Review my Anthropic API code"
  "このファイルのAPI使用をチェックして"

  ファイル:
  - .claude/skills/anthropic-api-reviewer/SKILL.md
  - .claude/skills/anthropic-api-reviewer/REFERENCE.md
  - .claude/skills/anthropic-api-reviewer/scripts/find_api_usage.py

  ---
  ⚠️ 重要な注意事項

  これらのSkillsを使用するには:

  1. Claude Codeを再起動する必要があります
  2. 再起動後、Claudeが自動的にSkillsを読み込みます
  3. 上記の使用例のような質問をすると、Claudeが該当するSkillの使用を提案します

  確認方法

  Claude Codeを再起動後、以下のように尋ねてください:
  "What skills are available?"

  すると、利用可能なすべてのSkillsがリストアップされます。

Agent Slills の利用

事前準備(Git)

  • Git のブランチ、ステージング確認(まだ何もやってない)
> git status
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        .claude/
        CLAUDE.md
        README.md
        hello_world.py
        quickstart.py
  • 1ファイルのみステージングする
> git add ./CLAUDE.md
warning: in the working copy of 'CLAUDE.md', LF will be replaced by CRLF the next time Git touches it

コミットメッセージを考える Skills を使用する

> コミットメッセージを考えてください 

● コミットメッセージを考えます。まず、リポジトリの状態を確認させてください。

● Bash(git status)
  ⎿  On branch master

     No commits yet
     … +11 lines (ctrl+o to expand)

● 現在の状態を確認しました。CLAUDE.mdだけがステージされていますが、このプロジェクト全体を見ると、他のファイルも一緒にコミットする方が適切だと思います 。

  まず、ステージされたCLAUDE.mdの変更内容を確認します:

● Bash(git diff --staged)
  ⎿  diff --git a/CLAUDE.md b/CLAUDE.md
     new file mode 100644
     index 0000000..c856e72
     … +78 lines (ctrl+o to expand)

● 提案

  現在はCLAUDE.mdだけがステージされていますが、2つの選択肢があります:

  オプション1: すべてのファイルを含む初期コミット(推奨)

  すべてのファイルをステージしてまとめてコミットする場合:

  git add .

  コミットメッセージ:
  Add Agent Skills tutorial with working examples

  - Add CLAUDE.md with repository guidance for Claude Code
  - Add README.md with comprehensive Japanese tutorial
  - Include hello_world.py demonstrating basic Anthropic API usage
  - Create two working Agent Skills examples:
    - simple-commit-helper: Basic Skill for commit message generation
    - anthropic-api-reviewer: Advanced Skill with multi-file structure
  - Include API best practices reference and utility scripts

  This provides a complete tutorial for learning Agent Skills development
  with Claude Code.

  オプション2: CLAUDE.mdだけをコミット

  現在ステージされているCLAUDE.mdだけをコミットする場合:

  コミットメッセージ:
  Add CLAUDE.md with repository guidance

  - Document environment setup and dependencies
  - Describe Python API examples and Agent Skills structure
  - Include guidance for Agent Skills development
  - Provide API usage patterns and best practices

  ---
  おすすめ: オプション1をお勧めします。これは初期コミットとして、プロジェクト全体の構造と目的を一度に記録できます。

  どちらのオプションを選びますか?それとも、別の方法でファイルを分けてコミットしたいですか?
  • オプション1にするが、コミットメッセージを日本語にしたい旨を追加。
    • すると、勝手に git add . を実行する
      • さらに日本語のコミットメッセージを作成する
 Bash command

   git commit -m "Agent Skillsチュートリアルと動作サンプルを追加

   - CLAUDE.mdを追加(Claude Code用のリポジトリガイダンス)
   - README.mdを追加(包括的な日本語チュートリアル)
   - hello_world.pyを追加(基本的なAnthropic API使用例)
   - 2つの動作するAgent Skillsサンプルを作成:
     - simple-commit-helper: コミットメッセージ生成用の基本Skill
     - anthropic-api-reviewer: マルチファイル構造の高度なSkill
   - APIベストプラクティスリファレンスとユーティリティスクリプトを含む

   Claude CodeでAgent Skills開発を学ぶための完全なチュートリアルを提供

   🤖 Generated with [Claude Code](https://claude.com/claude-code)

   Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>"
   Commit with Japanese message

 Do you want to proceed?
 ❯ 1. Yes
   2. Yes, and don't ask again for similar commands in C:\vscode\agent_skills_tutorial
   3. Type here to tell Claude what to do differently
  • コミット完了メッセージが表示される
● ✅ コミットが完了しました!

  コミット内容

  - コミットハッシュ: 37dfe56
  - ブランチ: master (初期コミット)
  - ファイル数: 8ファイル
  - 変更行数: 839行追加

  コミットされたファイル

  1. .claude/skills/anthropic-api-reviewer/REFERENCE.md
  2. .claude/skills/anthropic-api-reviewer/SKILL.md
  3. .claude/skills/anthropic-api-reviewer/scripts/find_api_usage.py
  4. .claude/skills/simple-commit-helper/SKILL.md
  5. CLAUDE.md
  6. README.md
  7. hello_world.py
  8. quickstart.py

  コミットメッセージ

  Agent Skillsチュートリアルと動作サンプルを追加

  - CLAUDE.mdを追加(Claude Code用のリポジトリガイダンス)
  - README.mdを追加(包括的な日本語チュートリアル)
  - hello_world.pyを追加(基本的なAnthropic API使用例)
  - 2つの動作するAgent Skillsサンプルを作成:
    - simple-commit-helper: コミットメッセージ生成用の基本Skill
    - anthropic-api-reviewer: マルチファイル構造の高度なSkill
  - APIベストプラクティスリファレンスとユーティリティスクリプトを含む

  Claude CodeでAgent Skills開発を学ぶための完全なチュートリアルを提供

  🤖 Generated with Claude Code
  Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

  これでAgent Skillsチュートリアルプロジェクトの初期コミットが完了しました!

コミット内容確認

> git log
Date:   Fri Jan 2 11:51:40 2026 +0900

    Agent Skillsチュートリアルと動作サンプルを追加
    
    - CLAUDE.mdを追加(Claude Code用のリポジトリガイダンス)
    - README.mdを追加(包括的な日本語チュートリアル)
    - hello_world.pyを追加(基本的なAnthropic API使用例)
    - 2つの動作するAgent Skillsサンプルを作成:
      - simple-commit-helper: コミットメッセージ生成用の基本Skill
      - anthropic-api-reviewer: マルチファイル構造の高度なSkill
    - APIベストプラクティスリファレンスとユーティリティスクリプトを含む
    
    Claude CodeでAgent Skills開発を学ぶための完全なチュートリアルを提供
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    
    Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

動かしてみた所感

やはり自分の手で動かすのは大事だと感じました。いきなり、 Agen Skills に取り組もうとしましたが、その前に ClaudeCode が使えないとそもそも前に進めない。順番に理解しないとダメですね。

ブログ執筆の Skills や、原稿執筆の Skills ができたら便利そうなので、次は自分の Skills 作成をやってみようと思います。




以上の内容はhttps://www.yokoyan.net/entry/2026/01/02/125050より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14