Skip to content
Documentation
Command

/start-11-4.en

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.en

Context preview

What this command does when you run it.

Lesson command

Command definition

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

๐ŸŽ“ Lesson 11-4: Running Claude Code / Codex / Cursor in GitHub Actions

๐Ÿ“ What You'll Do

**Lesson 11-4: Running AI CLI in GitHub Actions**!

| Item | Details | |------|------| | Goal | Run Claude Code CLI / Codex CLI within GitHub Actions workflows for automated code review and PR generation | | Duration | ~25 min | | Skills used | GitHub Actions, Claude Code CLI, Codex CLI, gh CLI | | Prerequisites | Lesson 11-2 completed (understanding of Secrets configuration) |

**Session flow:** 1. Overview of AI CLI tools and usage patterns 2. Run Claude Code in a workflow 3. Create a PR auto-review workflow 4. Run Codex CLI in a workflow 5. Hands-on exercise: Issue โ†’ AI implementation โ†’ auto-PR pipeline

By the end of this session, you'll have workflows built that leverage AI CLI tools in GitHub Actions.

> **๐Ÿ’ก Hint**: If the AI response stops midway, type "please continue" or "keep going" to resume.

---

๐ŸŽฏ Readiness Check

**AskQuestion configuration:**

{
  "title": "๐ŸŽฏ Pre-session check",
  "questions": [{
    "id": "readiness",
    "prompt": "Are you ready?",
    "options": [
      {"id": "ready", "label": "Ready! Let's start"},
      {"id": "check_prereq", "label": "Check prerequisites"},
      {"id": "different_lesson", "label": "Go to a different lesson"}
    ]
  }]
}

(ready โ†’ Go to Step 1) (check_prereq โ†’ Verify Lesson 11-2 completion. Check API key availability) (different_lesson โ†’ Display module list)

---

๐Ÿš€ Step 1: Overview of AI CLI Tools

{
  "title": "๐Ÿš€ Step 1: AI CLI Tools Overview",
  "questions": [{
    "id": "step_action",
    "prompt": "Review the AI CLI tools available for use in GitHub Actions.",
    "options": [
      {"id": "practice", "label": "Proceed"},
      {"id": "review", "label": "Review the differences between each tool"},
      {"id": "skip", "label": "Skip"}
    ]
  }]
}

**Guidance after selection:**

| Tool | Command | API Key | Primary Use | |--------|---------|---------|---------| | Claude Code | `claude -p "prompt"` | `ANTHROPIC_API_KEY` | Code review, implementation, analysis | | Codex CLI | `codex -q "prompt"` | `OPENAI_API_KEY` | Code generation, fixes, Q&A |

**Common pattern for GitHub Actions:**

# Always pass API keys via Secrets
env:
  ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

**API keys to set in Secrets:**

  • `ANTHROPIC_API_KEY`: For Claude Code (obtain from Anthropic console)
  • `OPENAI_API_KEY`: For Codex (obtain from OpenAI console)

**Expected result:** Understand the differences between each tool and the required configuration.

---

๐Ÿš€ Step 2: Run Claude Code in a Workflow

{
  "title": "๐Ÿš€ Step 2: Claude Code Workflow",
  "questions": [{
    "id": "step_action",
    "prompt": "Create a workflow that runs Claude Code CLI in GitHub Actions.",
    "options": [
      {"id": "practice", "label": "Proceed"},
      {"id": "review", "label": "Review claude CLI options"},
      {"id": "skip", "label": "Skip"}
    ]
  }]
}

**Guidance after selection:**

Create `.github/workflows/claude-review.yml`:

name: Claude Code Review
on:
  pull_request:
    types: [opened, synchronize]
  workflow_dispatch:
    inputs:
      prompt:
        description: 'Prompt to send to Claude'
        type: string
        default: 'Analyze the code quality of this repository'

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="Please review the following diff. Summarize issues, improvement suggestions, and good points:\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}`
            });

**Key points:**

  • Use `claude -p` to pass a prompt directly (non-interactive mode)
  • On PR trigger, pass `git diff` for review
  • Use `actions/github-script` to post the review result as a PR comment

**Expected result:** When a PR is created, Claude Code automatically reviews it and posts a comment.

---

๐Ÿš€ Step 3: PR Auto-Review Workflow

{
  "title": "๐Ÿš€ Step 3: PR Auto-Review",
  "questions": [{
    "id": "step_action",
    "prompt": "Enhance the workflow to analyze PR changes and post structured review comments.",
    "options": [
      {"id": "practice", "label": "Proceed"},
      {"id": "review", "label": "Review the review criteria"},
      {"id": "skip", "label": "Skip"}
    ]
  }]
}

**Guidance after selection:**

Enhance the review prompt:

      - 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/revi
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