Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b61185b
Test: Update README title for workflow testing
km-anthropic Aug 11, 2025
8052d27
Enable PR review submission and remove old workflow
km-anthropic Aug 11, 2025
44dd9dd
Final test: Update README for complete review workflow test
km-anthropic Aug 11, 2025
57cb0d9
Match old workflow exactly - prevent approvals
km-anthropic Aug 11, 2025
14e99e2
Add auto-review workflow for testing
km-anthropic Aug 12, 2025
c9bad6e
Allow MCP GitHub tools in auto-review workflow
km-anthropic Aug 12, 2025
0932e8c
Fix quoting in claude_args for workflow
km-anthropic Aug 12, 2025
583874c
Explicitly list MCP tools instead of using glob
km-anthropic Aug 12, 2025
74ee3b5
Explicitly specify PR number in prompt
km-anthropic Aug 12, 2025
6c58dba
Use fork's v1-dev with context prefixing
km-anthropic Aug 12, 2025
e2e4286
Simplify workflow - use origin v1-dev without explicit PR number
km-anthropic Aug 12, 2025
ff46b61
Add explicit MCP tool instructions to workflow
km-anthropic Aug 12, 2025
dc5d664
Use fork's v1-dev which has context prefixing
km-anthropic Aug 12, 2025
89eda5e
Point workflow to origin's v1-dev branch
km-anthropic Aug 12, 2025
1dd746f
Add slash command for comprehensive PR review
km-anthropic Aug 12, 2025
d6a4b9c
Add simple PR review slash command for GitHub Actions
km-anthropic Aug 12, 2025
d0f938f
Merge fork changes
km-anthropic Aug 12, 2025
39b3855
Update workflow to use /review slash command
km-anthropic Aug 12, 2025
50aee38
Update review slash command to simple version that always posts comments
km-anthropic Aug 12, 2025
f317d3c
Add deep-thinker subagent for testing subagent functionality
km-anthropic Aug 14, 2025
7ccb615
Fix: Copy subagent files from repo to Claude runtime environment
km-anthropic Aug 14, 2025
3005c85
Fix: Use CLAUDE_WORKING_DIR to correctly locate subagent files
km-anthropic Aug 14, 2025
a37014c
Update workflow to use fork version with subagent fix
km-anthropic Aug 14, 2025
0a82bcd
Test PR 411: Point workflow to piotrb's fork with sticky comment feature
km-anthropic Aug 19, 2025
9700ba8
Fix: Use correct fork path janeapp/claude-code-action
km-anthropic Aug 19, 2025
e9dc305
Add auto-fix CI workflows with slash command and inline approaches
km-anthropic Aug 19, 2025
110acf1
Test CI failure for auto-fix workflows
km-anthropic Aug 19, 2025
54d68a2
Trigger new CI failure to test auto-fix workflows
km-anthropic Aug 19, 2025
130eff6
Update CI fix workflows to ensure Claude commits changes
km-anthropic Aug 19, 2025
7143108
Add explicit fix-ci-commit command for clearer git commit instructions
km-anthropic Aug 19, 2025
7fc38f2
Remove tool restrictions from fix-ci slash commands to allow git oper…
km-anthropic Aug 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .claude/agents/deep-thinker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: deep-thinker
description: A subagent that performs deep analysis with extended thinking
tools:
- "*"
proactive: false
---

# Deep Thinker Subagent

You are a specialized subagent designed to perform deep, thorough analysis of complex problems using extended thinking capabilities.

## Your Purpose

You excel at:
- Breaking down complex problems into smaller components
- Analyzing trade-offs and implications
- Providing comprehensive, well-reasoned solutions
- Exploring edge cases and potential issues

## Instructions

When given a task:
1. Use extended thinking to thoroughly analyze the problem
2. Consider multiple approaches and their trade-offs
3. Identify potential issues or edge cases
4. Provide a detailed, well-structured response

## Important

Always think deeply before responding. Take your time to ensure thoroughness and accuracy in your analysis.
55 changes: 55 additions & 0 deletions .claude/commands/fix-ci-commit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
description: Fix CI failures and commit changes (for use when branch already exists)
---

# Fix CI Failures and Commit

You are on a branch that was created to fix CI failures. Your task is to fix the issues and commit the changes.

## CI Failure Information

$ARGUMENTS

## Your Tasks

1. **Analyze the failures** - Understand what went wrong from the logs
2. **Fix the issues** - Make the necessary code changes
3. **Commit your fixes** - Use git to commit all changes

## Step-by-Step Instructions

### 1. Fix the Issues

Based on the error logs:
- Fix syntax errors
- Fix formatting issues
- Fix test failures
- Fix any other CI problems

### 2. Commit Your Changes (REQUIRED)

After fixing ALL issues, you MUST:

```bash
# Stage all changes
git add -A

# Commit with descriptive message
git commit -m "Fix CI failures

- Fixed syntax errors
- Fixed formatting issues
- Fixed test failures
[List actual fixes made]"
```

**IMPORTANT**: You MUST use the Bash tool to run the git add and git commit commands above. The workflow expects you to commit your changes.

### 3. Verify (Optional)

If possible, run verification commands:
- `bun run format:check` for formatting
- `bun test` for tests
- `bun run typecheck` for TypeScript

Begin by analyzing the failure logs and then fix the issues.
66 changes: 66 additions & 0 deletions .claude/commands/fix-ci.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
description: Analyze and fix CI failures by examining logs and making targeted fixes
---

# Fix CI Failures

You are tasked with analyzing CI failure logs and fixing the issues. Follow these steps:

## Context Provided

$ARGUMENTS

## Step 1: Analyze the Failure

Parse the provided CI failure information to understand:
- Which jobs failed and why
- The specific error messages and stack traces
- Whether failures are test-related, build-related, or linting issues

## Step 2: Search and Understand the Codebase

Use search tools to locate the failing code:
- Search for the failing test names or functions
- Find the source files mentioned in error messages
- Review related configuration files (package.json, tsconfig.json, etc.)

## Step 3: Apply Targeted Fixes

Make minimal, focused changes:
- **For test failures**: Determine if the test or implementation needs fixing
- **For type errors**: Fix type definitions or correct the code logic
- **For linting issues**: Apply formatting using the project's tools
- **For build errors**: Resolve dependency or configuration issues
- **For missing imports**: Add the necessary imports or install packages

Requirements:
- Only fix the actual CI failures, avoid unrelated changes
- Follow existing code patterns and conventions
- Ensure changes are production-ready, not temporary hacks
- Preserve existing functionality while fixing issues

## Step 4: Commit Changes

After applying ALL fixes, use the Bash tool to:
1. Run: `git add -A` to stage all modified files
2. Run: `git commit -m "Fix CI failures: <description>"` to commit the changes
3. Include details about which CI jobs/tests were fixed in the commit message
4. Important: You MUST use the Bash tool to run these git commands to commit your changes

## Step 5: Verify Fixes Locally

Run available verification commands:
- Execute the failing tests locally to confirm they pass
- Run the project's lint command (check package.json for scripts)
- Run type checking if available
- Execute any build commands to ensure compilation succeeds

## Important Guidelines

- Focus exclusively on fixing the reported CI failures
- Maintain code quality and follow the project's established patterns
- If a fix requires significant refactoring, document why it's necessary
- When multiple solutions exist, choose the simplest one that maintains code quality
- Add clear comments only if the fix is non-obvious

Begin by analyzing the failure details provided above.
22 changes: 22 additions & 0 deletions .claude/commands/review.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
allowed-tools: Bash(gh pr comment:*), Bash(gh pr diff:*), Bash(gh pr view:*), Read, Glob, Grep
description: Code review a pull request
---

Review the current pull request and provide feedback.

1. Use `gh pr view` to get the PR details and `gh pr diff` to see the changes
2. Look for potential bugs, issues, or improvements
3. Always post a comment with your findings using `gh pr comment`

Format your comment like this:

## Code Review

[Your feedback here - be specific and constructive]

- If you find issues, describe them clearly
- If everything looks good, say so
- Link to specific lines when relevant

🤖 Generated with [Claude Code](https://claude.ai/code)
175 changes: 175 additions & 0 deletions .github/workflows/auto-fix-ci-inline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
name: Auto Fix CI Failures (Inline)

on:
workflow_run:
workflows: ["CI"]
types:
- completed

permissions:
contents: write
pull-requests: write
actions: read
issues: write

jobs:
auto-fix:
if: |
github.event.workflow_run.conclusion == 'failure' &&
github.event.workflow_run.name != 'Auto Fix CI Failures' &&
github.event.workflow_run.name != 'Auto Fix CI Failures (Inline)'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_branch }}
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup git
run: |
git config --global user.name "claude[bot]"
git config --global user.email "198276+claude[bot]@users.noreply.github.com"

- name: Create fix branch
id: branch
run: |
BRANCH_NAME="claude-auto-fix-ci-${{ github.event.workflow_run.head_branch }}-${{ github.run_id }}"
git checkout -b "$BRANCH_NAME"
echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT

- name: Get CI failure details

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thoughts on fetching this up front vs. using the actions server that we already have?

id: failure_details
uses: actions/github-script@v7
with:
script: |
const run = await github.rest.actions.getWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{ github.event.workflow_run.id }}
});

const jobs = await github.rest.actions.listJobsForWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{ github.event.workflow_run.id }}
});

const failedJobs = jobs.data.jobs.filter(job => job.conclusion === 'failure');

let errorLogs = [];
for (const job of failedJobs) {
const logs = await github.rest.actions.downloadJobLogsForWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
job_id: job.id
});
errorLogs.push({
jobName: job.name,
logs: logs.data
});
}

return {
runUrl: run.data.html_url,
failedJobs: failedJobs.map(j => j.name),
errorLogs: errorLogs
};

- name: Fix CI failures with Claude
uses: km-anthropic/claude-code-action@v1-dev

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use anthropics?

with:
prompt: |
You are tasked with analyzing CI failure logs and fixing the issues. Follow these steps:

## Context Provided

Failed CI Run: ${{ fromJSON(steps.failure_details.outputs.result).runUrl }}
Failed Jobs: ${{ join(fromJSON(steps.failure_details.outputs.result).failedJobs, ', ') }}

Error logs:
${{ toJSON(fromJSON(steps.failure_details.outputs.result).errorLogs) }}

## Step 1: Analyze the Failure

Parse the provided CI failure information to understand:
- Which jobs failed and why
- The specific error messages and stack traces
- Whether failures are test-related, build-related, or linting issues

## Step 2: Search and Understand the Codebase

Use search tools to locate the failing code:
- Search for the failing test names or functions
- Find the source files mentioned in error messages
- Review related configuration files (package.json, tsconfig.json, etc.)

## Step 3: Apply Targeted Fixes

Make minimal, focused changes:
- **For test failures**: Determine if the test or implementation needs fixing
- **For type errors**: Fix type definitions or correct the code logic
- **For linting issues**: Apply formatting using the project's tools
- **For build errors**: Resolve dependency or configuration issues
- **For missing imports**: Add the necessary imports or install packages

Requirements:
- Only fix the actual CI failures, avoid unrelated changes
- Follow existing code patterns and conventions
- Ensure changes are production-ready, not temporary hacks
- Preserve existing functionality while fixing issues

## Step 4: Commit Changes

After applying ALL fixes:
1. Stage all modified files with `git add -A`
2. Commit with: `git commit -m "Fix CI failures: prettier formatting and syntax errors"`
3. Important: You MUST commit your changes - the branch already exists

## Step 5: Verify Fixes Locally

Run available verification commands:
- Execute the failing tests locally to confirm they pass
- Run the project's lint command (check package.json for scripts)
- Run type checking if available
- Execute any build commands to ensure compilation succeeds

## Important Guidelines

- Focus exclusively on fixing the reported CI failures
- Maintain code quality and follow the project's established patterns
- If a fix requires significant refactoring, document why it's necessary
- When multiple solutions exist, choose the simplest one that maintains code quality

Begin by analyzing the failure details provided above.
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
timeout_minutes: "30"
use_sticky_comment: "true"
claude_args: "--max-turns 15"

- name: Push fix branch
if: success()
run: |
git push origin ${{ steps.branch.outputs.branch_name }}

- name: Create pull request comment
if: success()
uses: actions/github-script@v7
with:
script: |
const branchName = '${{ steps.branch.outputs.branch_name }}';
const baseBranch = '${{ github.event.workflow_run.head_branch }}';
const prUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/compare/${baseBranch}...${branchName}?quick_pull=1`;

const issueNumber = ${{ github.event.workflow_run.pull_requests[0]?.number || 'null' }};

if (issueNumber) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
body: `## 🤖 CI Auto-Fix Available\n\nClaude has analyzed the CI failures and prepared fixes.\n\n[**→ Create pull request to fix CI**](${prUrl})\n\n_This fix was generated automatically based on the [failed CI run](${{ fromJSON(steps.failure_details.outputs.result).runUrl }})._`
});
}
Loading