/start-11-4.en
Lesson command
$ npx -y skills add minicoohei/ai-agent-camp --agent claude-codeHow 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.mddescription: "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/reviRead more
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/reviAI 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
Other commands on ai-agent-camp.
- /check-setup.en
Top-level alias โ see lesson/check-setup.en.md for the full body.
Open command - /check-setup.es
Alias de nivel superior โ el cuerpo completo estรก en lesson/check-setup.es.md.
Open command - /check-setup
Top-level alias โ see lesson/check-setup.md for the full body.
Open command - /check-security.en
Lesson command
Open command - /check-security.es
Lesson command
Open command - /check-security
Lesson command
Open command

