extracts amber.review from github workflow for reuse#707
extracts amber.review from github workflow for reuse#707markturansky wants to merge 5 commits intoambient-code:mainfrom
Conversation
|
test |
Amber Code ReviewSummaryThis PR extracts the inline amber-auto-review prompt into a reusable slash command at .claude/commands/amber.review.md, enabling the review to be invoked both from CI and interactively from the Claude Code CLI. The command file is well-structured and comprehensive. The primary concern is that the two-step invocation pattern in the new workflow prompt introduces ambiguity that could cause double-execution. Issues by SeverityBlocker IssuesNone. Critical IssuesNone. Major Issues[1] Potential double-execution from step 1 + step 2 coupling File: .github/workflows/amber-auto-review.yml, new prompt block (lines 81-83) The new workflow prompt instructs Claude to (1) read the command file, then (2) invoke amber.review by name. If the Skill tool is available in the CI runner -- the --allowedTools constraint only restricts specific Bash subcommands, not the Skill tool -- Claude may treat amber.review as a discrete slash command invocation after already absorbing the full instructions from step 1. This re-expands the same command file and runs the review a second time, potentially posting two gh pr comment entries on every PR. The original approach was unambiguous: all instructions were inline, one clear execution path. Suggested fix -- pick one model, not both: Option A -- pure skill invocation (simpler): Option B -- read-then-follow, no skill invocation: Minor Issues[1] Argument format inconsistency between workflow and command file File: .github/workflows/amber-auto-review.yml line 82 The canonical invocation (including this review run) passes arguments as REPO: ambient-code/platform PR NUMBER: 707. The workflow now generates PR 707 in ambient-code/platform. Claude will parse either form, but aligning with the documented convention avoids edge-case ambiguity. [2] No evidence of end-to-end workflow validation The PR modifies the active CI review pipeline with no indication the new invocation pattern was tested against a real PR run. A silent failure here would disable automated code reviews with no immediate alert. Consider triggering a dry-run on a test PR, or noting in the PR description that this was manually validated. Positive Highlights
Recommendations
Review performed by Amber (.claude/commands/amber.review.md) against repository standards in .claude/context/ and .claude/patterns/. |
Amber Code ReviewSummaryPR #707 extracts the inline amber review prompt from the GitHub Actions workflow into a reusable slash command at Issues by SeverityBlocker Issues
The PR replaces the working GitHub Actions context variable interpolation with literal placeholder strings: # AFTER (broken)
Arguments: REPO: github-repo PR NUMBER: pr-number
# BEFORE (working)
REPO: ${{ github.repository }}
PR NUMBER: ${{ github.event.pull_request.number }}When this workflow runs, Claude will receive Fix: prompt: |
Read .claude/commands/amber.review.md and follow its instructions exactly.
Arguments: REPO: ${{ github.repository }} PR NUMBER: ${{ github.event.pull_request.number }}
After completing the review, use gh pr comment to post your findings.Critical IssuesNone. Major Issues
The new slash command defines the output format as: But two downstream workflow steps still look for the old heading: // Line 46 — minimize old comments
'.body | startswith("# Claude Code Review")'
// Line 107 — add transparency link
c.body.startsWith('# Claude Code Review')Neither step will match
Both fail silently ( Fix: Either update the command output heading to keep Minor Issues
The command file uses the Claude Code slash command This works in practice but is fragile — it depends on Claude interpreting ambiguous instructions rather than deterministic substitution. Consider documenting this dual-use pattern in a comment in the workflow. Positive Highlights
Recommendations
|
|
@markturansky how will https://github.com/ambient-code/platform/actions/workflows/amber-auto-review.yml remain working? |
|
@jeremyeder the command is inlined in the git workflow:
|
Amber Code ReviewSummaryThis PR refactors the Issues by SeverityBlocker Issues1. Comment header mismatch breaks minimization and transparency link
Critical Issues2. Prompt injection risk introduced by reading command file from PR-head checkout
Major Issues3.
Minor Issues4. No guard comment documenting the header coupling
5. Slash command omits guidance on CI vs interactive usage
Positive Highlights
Recommendations
|
This comment has been minimized.
This comment has been minimized.
Claude Code Review — PR #707SummaryExtracts the inline review prompt from Issues by SeverityBlocker IssuesNone Critical IssuesNone Major Issues1. Fork PR detection relies on prompt-level instruction, not workflow enforcement — The fork detection ( Suggested hardening: Use a workflow-level conditional to set the command file path deterministically: - name: Determine review command source
id: review-source
run: < /dev/null |
if [ "${{ github.event.pull_request.head.repo.full_name }}" \!= "${{ github.repository }}" ]; then
echo "cmd_path=base-ref/.claude/commands/amber.review.md" >> "$GITHUB_OUTPUT"
else
echo "cmd_path=.claude/commands/amber.review.md" >> "$GITHUB_OUTPUT"
fi
# Then in the prompt:
# Read and follow ${{ steps.review-source.outputs.cmd_path }} exactly.This removes the decision from Claude and makes it a workflow-enforced path. 2. Trailing whitespace on line 89 — Line 89 ( Minor Issues1. The Minor overhead. Consider adding a condition: 2. Command file frontmatter The description says "Perform a comprehensive code review..." but doesn't mention this is also the source-of-truth for the CI workflow. Could help future maintainers understand the dual use. Positive Highlights
Recommendations
|
Claude Code ReviewSummaryThis PR extracts the Issues by SeverityBlocker IssuesNone. Critical IssuesNone. Major IssuesNone. Minor Issues1. Direct expression interpolation in shell script
Using GitHub context expressions directly inside 2. Double space in generated prompt
There are two consecutive spaces between the repo value and 3. ARGUMENTS template variable is undocumented in the command file
The ARGUMENTS placeholder in the User Input section is a Claude slash-command template substitution, but this is not obvious to contributors reading the raw file. A brief note in the frontmatter description would aid discoverability. Positive Highlights
Recommendations
Review generated by amber.review 🔍 View AI decision process (logs available for 90 days) 📋 View memory system files loaded (click to expand)What Amber Loaded for Code ReviewAmber automatically loaded these repository standards from the memory system:
Impact: This review used your repository's specific code quality standards, security patterns, and best practices from the memory system (PRs #359, #360) - not just generic code review guidelines. |
No description provided.