diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 0000000..9de81e5 --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,63 @@ +{ + "$schema": "https://json.schemastore.org/claude-code-settings.json", + "env": { + "BASH_DEFAULT_TIMEOUT_MS": "60000", + "BASH_MAX_TIMEOUT_MS": "60000", + "MAX_MCP_OUTPUT_TOKENS": "150000" + }, + "includeCoAuthoredBy": true, + "permissions": { + "allow": [ + "Bash", + "Bash(gh:*)", + "Bash(git:*)", + "Bash(chmod:*)", + "Bash(sed:*)", + "Bash(make:*)", + "Bash(shellcheck:*)", + "Bash(actionlint:*)", + "Bash(shfmt:*)", + "Bash(npx:*)", + "Bash(eslint:*)", + "Bash(djlint:*)", + "Bash(grep:*)", + "Bash(yamllint:*)", + "WebSearch", + "Read(/tmp/**)", + "Read(**/IdeaProjects/**)", + "mcp__zp__Zen__thinkdeep", + "mcp__zp__Zen__planner", + "mcp__zp__Zen__analyze", + "mcp__gh__GitHub__create_pull_request", + "mcp__gh__GitHub__get_commit", + "mcp__gh__GitHub__get_job_logs", + "mcp__gh__GitHub__get_pull_request_files", + "mcp__gh__GitHub__get_pull_request_reviews", + "mcp__gh__GitHub__get_pull_request", + "mcp__gh__GitHub__get_pull_request_status", + "mcp__gh__GitHub__get_workflow_run_logs", + "mcp__gh__GitHub__get_pull_request_diff", + "mcp__gh__GitHub__get_pull_request_comments", + "mcp__gh__GitHub__list_branches", + "mcp__gh__GitHub__list_commits", + "mcp__gh__GitHub__get_workflow_run", + "mcp__gh__GitHub__list_pull_requests", + "mcp__gh__GitHub__list_workflow_jobs", + "mcp__gh__GitHub__list_workflow_runs", + "mcp__gh__GitHub__list_workflows", + "mcp__gh__GitHub__merge_pull_request", + "mcp__gh__GitHub__search_pull_requests", + "mcp__gh__GitHub__search_repositories", + "mcp__gh__GitHub__rerun_failed_jobs", + "mcp__gh__GitHub__rerun_workflow_run", + "mcp__gh__GitHub__run_workflow", + "mcp__gh__GitHub__search_code", + "mcp__gh__GitHub__update_pull_request", + "mcp__gh__GitHub__update_pull_request_branch" + ], + "ask": ["Bash(python:*)", "Bash(python3:*)", "Bash(rm:*)"], + "deny": ["Bash(pip install:*)", "Bash(pip3 install:*)", "Bash(brew install:*)", "Read(**/.ssh/*)"] + }, + "model": "claude-sonnet-4-20250514", + "defaultMode": "plan" +} diff --git a/.github/workflows/claude-auto-code-review.yml b/.github/workflows/claude-auto-code-review.yml index 667dc3e..1c1c992 100644 --- a/.github/workflows/claude-auto-code-review.yml +++ b/.github/workflows/claude-auto-code-review.yml @@ -59,6 +59,9 @@ jobs: # Disabled: creates a mess to review. Inline suggestions are often broken # Use GitHub's suggestion format when proposing code changes. # Use inline comments to highlight specific areas of concern. + + # If PR was already reviewed by claude previously, validate latest changes made since your previous review against previous review result first. + # Make full PR review only if either no previous review of this PR by claude found, or if you validated that latest changes pushed to the PR have fixed all issues (of medium priority or higher) found in previous claude review in this PR. prompt: | Please review this PR #${{ github.event.pull_request.number }} with comprehensive analysis covering both general software engineering principles and OCI automation specifics: @@ -106,9 +109,10 @@ jobs: Be constructive, thorough, and provide specific actionable feedback. Provide severity ratings (Critical/High/Medium/Low) for any issues found. - - If PR was already reviewed by claude previously, validate latest changes made since your previous review against previous review result first. - Make full PR review only if either no previous review of this PR by claude found, or if you validated that latest changes pushed to the PR have fixed all issues (of medium priority or higher) found in previous claude review in this PR. + + Never read all PR comments at once. Always use pagination and filters. + If PR diff is too large, list changes in PR instead and review changes file by file. + + Your review result must be added to PR into sticky comment. + If PR has several comments by claude with review results, choose latest one as sticky, updating it with new results and either remove or hide other claude comments as outdated. After finishing your review, either approve PR or request fixes if there are issues of medium priority or higher. - Your review must be added to PR into sticky comment. - If PR has several comments by claude, choose latest one as sticky in order to update it and hide others as outdated. diff --git a/.github/workflows/claude-modes.yml b/.github/workflows/claude-modes.yml index 534a6fc..29b8476 100644 --- a/.github/workflows/claude-modes.yml +++ b/.github/workflows/claude-modes.yml @@ -1,3 +1,4 @@ +--- name: Claude Automatic Mode Detection on: @@ -20,12 +21,19 @@ on: jobs: interactive-mode: # if: | - # (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude') && !contains(github.event.comment.body, '@claude reviewer')) || - # (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || - # (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || - # (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) + # (github.event_name == 'issue_comment' && + # contains(github.event.comment.body, '@claude') && + # !contains(github.event.comment.body, '@claude reviewer')) || + # (github.event_name == 'pull_request_review_comment' && + # contains(github.event.comment.body, '@claude')) || + # (github.event_name == 'pull_request_review' && + # contains(github.event.review.body, '@claude')) || + # (github.event_name == 'issues' && + # (contains(github.event.issue.body, '@claude') || + # contains(github.event.issue.title, '@claude'))) if: | - ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' }} && + ${{ github.event_name != 'schedule' && + github.event_name != 'workflow_dispatch' }} && !contains(github.event.comment.body, '@claude reviewer') runs-on: ubuntu-latest permissions: @@ -46,7 +54,7 @@ jobs: # - Only acts when trigger phrase is found # - Creates tracking comments with progress checkboxes # - Perfect for: Interactive Q&A, on-demand code changes - + # Automation Mode - Activated automatically when prompt is provided automation-mode-scheduled-task: if: |