Skip to content
Documentation
Command

/start-11-4

Lesson command

From plugin
ai-agent-camp
345200 skills8 agents200 commands
Install
$ npx -y skills add minicoohei/ai-agent-camp --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/start-11-4

Context preview

What this command does when you run it.

Lesson command

Command definition

start-11-4.md
description: "Lesson command"
chapter: "courses/aiagent/lesson03-core/module11-github-actions"
duration: "約25分"
prerequisites: ["start-11-2"]
level: "intermediate"
tags: ["github-actions", "claude-code", "codex", "ai", "automation", "code-review"]
nonInteractiveMode: deferred

🎓 Lesson 11-4: Claude Code / Codex / Cursor を GitHub Actions で呼ぶ

📍 このセッションでやること

**Lesson 11-4: AI CLI を GitHub Actions で呼ぶ** へようこそ!

| 項目 | 内容 | |------|------| | ゴール | Claude Code CLI / Codex CLI を GitHub Actions ワークフロー内で実行し、コードレビューや PR 自動生成を行う | | 所要時間 | 約25分 | | 使うスキル | GitHub Actions, Claude Code CLI, Codex CLI, gh CLI | | 前提条件 | Lesson 11-2 完了(Secrets 設定の理解) |

**このセッションの流れ:** 1. AI CLI ツールの概要と利用パターン 2. Claude Code をワークフローで実行 3. PR 自動レビューワークフローの作成 4. Codex CLI のワークフロー実行 5. 実践演習: Issue → AI 実装 → PR 自動作成パイプライン

セッション終了時には、AI CLI ツールを GitHub Actions で活用するワークフローが構築されています。

> **💡 ヒント**: AIの応答が途中で止まった場合は「続きを表示して」「止まってるよ」と入力すると再開します。

---

🎯 準備チェック

**AskQuestionの設定:**

{
  "title": "🎯 セッション開始前の確認",
  "questions": [{
    "id": "readiness",
    "prompt": "準備はできていますか?",
    "options": [
      {"id": "ready", "label": "準備OK!始めましょう"},
      {"id": "check_prereq", "label": "前提条件を確認したい"},
      {"id": "different_lesson", "label": "別のレッスンに移動したい"}
    ]
  }]
}

(ready → Step 1へ) (check_prereq → Lesson 11-2 完了確認。API キーの準備状況確認) (different_lesson → モジュール一覧を表示)

---

🚀 Step 1: AI CLI ツールの概要

{
  "title": "🚀 Step 1: AI CLI ツールの概要",
  "questions": [{
    "id": "step_action",
    "prompt": "GitHub Actions で使える AI CLI ツールの概要を確認します。",
    "options": [
      {"id": "practice", "label": "このまま進める"},
      {"id": "review", "label": "各ツールの違いを確認"},
      {"id": "skip", "label": "スキップ"}
    ]
  }]
}

**選択後の案内(例)**:

| ツール | コマンド | API キー | 主な用途 | |--------|---------|---------|---------| | Claude Code | `claude -p "prompt"` | `ANTHROPIC_API_KEY` | コードレビュー、実装、分析 | | Codex CLI | `codex -q "prompt"` | `OPENAI_API_KEY` | コード生成、修正、質問応答 |

**GitHub Actions での共通パターン:**

# API キーは必ず Secrets 経由で渡す
env:
  ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

**Secrets に設定する API キー:**

  • `ANTHROPIC_API_KEY`: Claude Code 用(Anthropic コンソールで取得)
  • `OPENAI_API_KEY`: Codex 用(OpenAI コンソールで取得)

**期待される結果**: 各ツールの違いと必要な設定を理解する。

---

🚀 Step 2: Claude Code をワークフローで実行

{
  "title": "🚀 Step 2: Claude Code ワークフロー",
  "questions": [{
    "id": "step_action",
    "prompt": "Claude Code CLI を GitHub Actions で実行するワークフローを作成します。",
    "options": [
      {"id": "practice", "label": "このまま進める"},
      {"id": "review", "label": "claude CLI のオプションを確認"},
      {"id": "skip", "label": "スキップ"}
    ]
  }]
}

**選択後の案内(例)**:

`.github/workflows/claude-review.yml` を作成:

name: Claude Code Review
on:
  pull_request:
    types: [opened, synchronize]
  workflow_dispatch:
    inputs:
      prompt:
        description: 'Claude に送るプロンプト'
        type: string
        default: 'このリポジトリのコード品質を分析してください'

jobs:
  claude-review:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Install Claude Code
        run: npm install -g @anthropic-ai/claude-code

      - name: Run Claude Code review
        env:
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
        run: |
          if [ "${{ github.event_name }}" = "pull_request" ]; then
            DIFF=$(git diff ${{ github.event.pull_request.base.sha }}..HEAD)
            PROMPT="以下の diff をレビューしてください。問題点、改善提案、良い点をまとめてください:\n\n$DIFF"
          else
            PROMPT="${{ inputs.prompt }}"
          fi
          claude -p "$PROMPT" --output-format text > review_result.txt

      - name: Post review comment
        if: github.event_name == 'pull_request'
        uses: actions/github-script@v7
        with:
          script: |
            const fs = require('fs');
            const review = fs.readFileSync('review_result.txt', 'utf8');
            await github.rest.issues.createComment({
              owner: context.repo.owner,
              repo: context.repo.repo,
              issue_number: context.issue.number,
              body: `## 🤖 Claude Code Review\n\n${review}`
            });

**ポイント:**

  • `claude -p` でプロンプトを直接渡す(非対話モード)
  • PR トリガーでは `git diff` を渡してレビュー
  • `actions/github-script` でレビュー結果を PR コメントに投稿

**期待される結果**: PR 作成時に Claude Code が自動レビューし、コメントを投稿する。

---

🚀 Step 3: PR 自動レビューワークフロー

{
  "title": "🚀 Step 3: PR 自動レビュー",
  "questions": [{
    "id": "step_action",
    "prompt": "PR の変更内容を分析し、構造化されたレビューコメントを投稿するワークフローを強化します。",
    "options": [
      {"id": "practice", "label": "このまま進める"},
      {"id": "review", "label": "レビュー観点を確認"},
      {"id": "skip", "label": "スキップ"}
    ]
  }]
}

**選択後の案内(例)**:

レビュープロンプトを強化:

      - name: Run structured review
        env:
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
        run: |
          DIFF=$(git diff ${{ github.event.pull_request.base.sha }}..HEAD)
          cat <<'PROMPT' > /tmp/review_prompt.txt
          以下の diff をレビューしてください。

          ## レビュー観点
          1. **バグリスク**: 潜在的なバグやエッジケース
          2. **セキュリティ**: 脆弱性やシークレットのハードコード
          3. **パフォーマンス**: 非効率な処理やN+1問題
          4. **可読性**: 命名、構造、コメントの適切さ
          5. **テスト**: テストカバレッジの不足

          ## 出力形式
          各観点について「✅ 問題なし」または「⚠️ 要確認: 具体的な指摘」で回答してください。

          ## Diff
          PROMPT
          echo "$DIFF" >> /tmp/review_prompt.txt
          claude -p "$(cat /tmp/review_prompt.txt)" --output-format text > review_result.txt

**期待される結果**: 構造化されたレビューコメントが PR に投稿される。

---

🚀 Step 4: Codex CLI のワークフロー実行

{
  "title": "🚀 Step 4: Codex CLI",
  "questions": [{
    "id": "step_action",
    "prompt": "Codex CLI を GitHub Actions で実行するワークフローを作成します。",
    "options": [
      {"id": "practice", "label": "このまま進める"},
      {"id": "review", "label": "Codex CLI のオプションを確認"},
      {"id": "skip", "label": "スキップ"}
    ]
  }]
}

**選択後の案内(例)**:

`.github/workflow

Read more
Ships withai-agent-camp

AI Agent Training for Non-Engineers - Complete Guide to Claude Code / Cursor / Codex ### ⚠️ Before you clone Official repository (maintained by the authors): Running AI agents from this repo grants them shell, file-write, and external-API permissions on your

Get the whole plugin