claude-code-gitea-action/CLAUDE.md
claude (ops) 32685a740f
Some checks failed
Test Custom Executables / test-custom-executables (push) Has been cancelled
CI / test (push) Has been cancelled
CI / prettier (push) Has been cancelled
CI / typecheck (push) Has been cancelled
Sync Base Action to claude-code-base-action / Sync base-action to claude-code-base-action repository (push) Has been cancelled
Test Claude Code Action / test-inline-prompt (push) Has been cancelled
Test Claude Code Action / test-prompt-file (push) Has been cancelled
Test Claude Env Feature / test-claude-env-with-comments (push) Has been cancelled
Test MCP Servers / test-mcp-integration (push) Has been cancelled
Test MCP Servers / test-mcp-config-flag (push) Has been cancelled
Test Settings Feature / test-settings-inline-allow (push) Has been cancelled
Test Settings Feature / test-settings-inline-deny (push) Has been cancelled
Test Settings Feature / test-settings-file-allow (push) Has been cancelled
Test Settings Feature / test-settings-file-deny (push) Has been cancelled
Forgejo-patched claude-code-gitea-action (View-job URL uses per-repo run index)
Fork of markwylde/claude-code-gitea-action@b744372 (v1.0.21) with the
'View job' link fixed to use GITHUB_RUN_NUMBER (per-repo index) instead of
GITHUB_RUN_ID (global id), because Forgejo routes run pages by per-repo index.
See VENDOR.txt.
2026-07-01 06:42:55 +00:00

3 KiB

CLAUDE.md

This file provides guidance to Claude Code when working with code in this repository.

Development Tools

  • Runtime: Bun 1.2.11

Common Development Tasks

Available npm/bun scripts from package.json:

# Test
bun test

# Formatting
bun run format          # Format code with prettier
bun run format:check    # Check code formatting

Architecture Overview

This is a GitHub Action that enables Claude to interact with GitHub PRs and issues. The action:

  1. Trigger Detection: Uses check-trigger.ts to determine if Claude should respond based on comment/issue content
  2. Context Gathering: Fetches GitHub data (PRs, issues, comments) via github-data-fetcher.ts and formats it using github-data-formatter.ts
  3. AI Integration: Supports multiple Claude providers (Anthropic API, AWS Bedrock, Google Vertex AI)
  4. Prompt Creation: Generates context-rich prompts using create-prompt.ts
  5. MCP Server Integration: Installs and configures GitHub MCP server for extended functionality

Key Components

  • Trigger System: Responds to /claude comments or issue assignments
  • Authentication: OIDC-based token exchange for secure GitHub interactions
  • Cloud Integration: Supports direct Anthropic API, AWS Bedrock, and Google Vertex AI
  • GitHub Operations: Creates branches, posts comments, and manages PRs/issues

Project Structure

src/
├── check-trigger.ts        # Determines if Claude should respond
├── create-prompt.ts        # Generates contextual prompts
├── github-data-fetcher.ts  # Retrieves GitHub data
├── github-data-formatter.ts # Formats GitHub data for prompts
├── install-mcp-server.ts  # Sets up GitHub MCP server
├── update-comment-with-link.ts # Updates comments with job links
└── types/
    └── github.ts          # TypeScript types for GitHub data

Important Notes

  • Actions are triggered by @claude comments or issue assignment unless a different trigger_phrase is specified
  • The action creates branches for issues and pushes to PR branches directly
  • All actions create OIDC tokens for secure authentication
  • Progress is tracked through dynamic comment updates with checkboxes

MCP Tool Development

When adding new MCP tools:

  1. Add to MCP Server: Implement the tool in the appropriate MCP server file (e.g., src/mcp/local-git-ops-server.ts)
  2. Expose to Claude: Add the tool name to BASE_ALLOWED_TOOLS array in src/create-prompt/index.ts
  3. Tool Naming: Follow the pattern mcp__server_name__tool_name (e.g., mcp__local_git_ops__checkout_branch)
  4. Documentation: Update the prompt's "What You CAN Do" section if the tool adds new capabilities

Feature Development Reminders

When implementing new features that add action inputs, configuration options, or capabilities:

  1. Always update README.md to document new inputs in the inputs table
  2. Update example workflows to show how new inputs can be used
  3. Add appropriate defaults and descriptions to action.yml