Implement Claude PR BugScan workflow (Draft→Ready + push re-scan)#9
Implement Claude PR BugScan workflow (Draft→Ready + push re-scan)#9
Conversation
Strips the Python project template cruft and replaces it with a focused GitHub Actions setup for automated Claude PR code review: - .github/workflows/claude_pr_review.yml: reusable workflow_call that checks out both the target repo and this workflow repo, loads the Codex Code Review prompt, and runs anthropics/claude-code-action@v1 - .github/workflows/ai_pr_review.yml: caller workflow triggered on ready_for_review / synchronize / reopened, with draft guard and concurrency cancel-in-progress - prompts/codex_code_review_prompt.md: verbatim official Codex Code Review prompt from developers.openai.com cookbook - README.md: usage instructions, trigger table, versioning guidance - .gitignore: trimmed to repo-relevant patterns only https://claude.ai/code/session_018moumKtzZQiSiyGxVUFGdS
Add explicit "one-time tag setup" step, explain that target repos only need the two-line caller workflow (everything else runs in this repo), and note that updates here propagate automatically on next tag release. https://claude.ai/code/session_018moumKtzZQiSiyGxVUFGdS
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b6ceb2c1c4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - name: Checkout workflow repo (for prompt) | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: safurrier/python-collab-template |
There was a problem hiding this comment.
Pin prompt checkout to the workflow ref
This checkout pulls safurrier/python-collab-template from the default branch because no ref is set, so callers pinned to @v1 still read whatever prompt is currently on main. That makes the reusable workflow non-deterministic and can break existing consumers if prompts/codex_code_review_prompt.md is changed or moved later.
Useful? React with 👍 / 👎.
| run: | | ||
| if [ -n "${{ inputs.prompt_override }}" ]; then | ||
| echo "text<<EOF" >> "$GITHUB_OUTPUT" | ||
| printf "%s\n" "${{ inputs.prompt_override }}" >> "$GITHUB_OUTPUT" |
There was a problem hiding this comment.
Avoid unescaped shell interpolation of prompt_override
The step injects ${{ inputs.prompt_override }} directly into a quoted shell string, which can break parsing when the override contains double quotes or other shell-significant characters (a common case for prompt text). In that scenario the workflow fails before Claude runs, so prompt customization advertised in the README is unreliable.
Useful? React with 👍 / 👎.
Context files agent: - prompts/context_files_prompt.md — verbatim prompt for generating / updating AGENTS.md and CLAUDE.md; uses $ARGUMENTS substitution for mode (auto/quick-start/update/evaluate) and scope - .github/workflows/context_files_agent.yml — reusable workflow_call; accepts agent_args (mode+scope) and prompt_override; needs contents: write to commit context files back to PR branches - .github/workflows/context_files_pr.yml — caller workflow triggered on pull_request opened + ready_for_review MkDocs documentation site: - mkdocs.yml — Material theme, nav covering all pages - .github/workflows/docs.yml — build-check on PRs, gh-deploy on main - docs/index.md — overview and architecture diagram - docs/user-stories.md — solo dev, team lead, DevEx engineer stories - docs/using.md — step-by-step setup, trigger table, prompt override guide - docs/contributing.md — three-file pattern for adding a new agent - docs/agents/index.md — agent catalog and shared design principles - docs/agents/pr-review.md — review agent triggers, caller snippet, prompt - docs/agents/context-files.md — context agent modes, agent_args, permissions Repo context files (generated via context files prompt logic): - AGENTS.md — WHY/WHAT/HOW, repo map, validated commands, gotchas - CLAUDE.md — symlink to AGENTS.md (Claude Code auto-discovery) - .gitignore — remove CLAUDE.md exclusion so symlink is tracked https://claude.ai/code/session_018moumKtzZQiSiyGxVUFGdS
Replaces per-agent reusable workflows and flat prompts/ files with a single generic skill runner and structured SKILL.md files following the Claude Code skill convention. Skills (replaces prompts/): - skills/codex-code-review/SKILL.md — frontmatter + verbatim Codex body - skills/context-files/SKILL.md — frontmatter + full context files prompt Generic workflow (replaces claude_pr_review.yml + context_files_agent.yml): - .github/workflows/claude_pr_agent.yml — accepts skill: (name or path), args: ($ARGUMENTS substitution), prompt: (raw bypass); resolves bare names from central repo skills/ and paths from target repo checkout; strips YAML frontmatter via awk before sending body to Claude Skill resolution: "codex-code-review" → skills/codex-code-review/SKILL.md (central) ".claude/skills/my-skill" → .claude/skills/my-skill/SKILL.md (target repo) "./skills/my-skill" → skills/my-skill/SKILL.md (target repo) "./skills/my-skill.md" → flat file, no directory (target repo) Sequencing via needs:: caller workflows chain skills as separate jobs; each job calls claude_pr_agent.yml with a single skill; needs: enforces ordering without requiring dynamic steps. Updated callers: - ai_pr_review.yml → skill: "codex-code-review" - context_files_pr.yml → skill: "context-files", args: "auto ." Updated docs: - docs/agents/index.md — skills pattern and shared workflow explanation - docs/agents/pr-review.md — skill frontmatter, local skill path override, sequencing example with needs: - docs/agents/context-files.md — args: input, local skill path override - docs/contributing.md — two-file pattern (SKILL.md + doc page, no new workflow) - docs/using.md — skill: input, local skill paths, mixed central+local example https://claude.ai/code/session_018moumKtzZQiSiyGxVUFGdS
Strips the Python project template cruft and replaces it with a focused
GitHub Actions setup for automated Claude PR code review:
checks out both the target repo and this workflow repo, loads the
Codex Code Review prompt, and runs anthropics/claude-code-action@v1
ready_for_review / synchronize / reopened, with draft guard and
concurrency cancel-in-progress
Review prompt from developers.openai.com cookbook
https://claude.ai/code/session_018moumKtzZQiSiyGxVUFGdS