feat(agents): claude agents and commands for git operations, QA test coverage, and bug-fix pipeline#636
feat(agents): claude agents and commands for git operations, QA test coverage, and bug-fix pipeline#636bhabalan wants to merge 4 commits intowebex:nextfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 65a922672e
ℹ️ 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".
|
|
||
| **Remove:** | ||
| ```bash | ||
| git worktree remove /tmp/claude-widgets/{TICKET_ID} |
There was a problem hiding this comment.
Use --force after confirming dirty worktree removal
This workflow asks for extra confirmation when a worktree has uncommitted changes, but the removal command is still git worktree remove /tmp/claude-widgets/{TICKET_ID} without -f; Git's own usage is git worktree remove [-f] <worktree>, so dirty worktrees will not be removed even after the user confirms and cleanup will silently fail for the main warned-about case.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in d741fcf — added --force flag to git worktree remove after user confirmation.
.claude/agents/qa-test-coverage.md
Outdated
|
|
||
| # Persistent Agent Memory | ||
|
|
||
| You have a persistent Persistent Agent Memory directory at `/Users/bhabalan/dev/widgets/.claude/agent-memory/qa-test-coverage/`. Its contents persist across conversations. |
There was a problem hiding this comment.
Replace machine-specific memory path with workspace path
The persistent memory directory is hardcoded to /Users/bhabalan/dev/widgets/.claude/agent-memory/qa-test-coverage/, which is specific to one local machine and will not exist in other developer or CI environments; this breaks the instructed memory read/write behavior and undermines the agent's cross-session state for most users.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 0e24318 — replaced hardcoded /Users/bhabalan/dev/widgets/ path with workspace-relative .claude/agent-memory/qa-test-coverage/.
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
… ticket management
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c75cbdff86
ℹ️ 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".
.claude/commands/fix.md
Outdated
| gh pr list --head {TICKET_ID} --repo webex/widgets --json number,title,state,reviews,reviewRequests | ||
| ``` | ||
|
|
||
| - **If PR exists and is open:** Enter review-polling mode (Step 7) | ||
| - **If PR exists and is merged:** Skip ticket, inform user it's already done |
There was a problem hiding this comment.
Include merged PRs when checking existing ticket branches
gh pr list defaults to open PRs (--state default is open), so this check cannot identify already-merged ticket PRs even though the next step branches on that outcome. In practice, merged tickets will be treated as “no PR” and can be reprocessed unnecessarily, including redundant worktree creation and attempted new implementation; add --state all (or an explicit merged query) before making the open/merged/no-PR decision.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in d741fcf — added --state all to gh pr list so merged PRs are detected and skipped.
.claude/commands/fix.md
Outdated
| cd /tmp/claude-widgets/{TICKET_ID} | ||
| gh pr view {PR_NUMBER} --json reviews,reviewRequests,state |
There was a problem hiding this comment.
Remove hard dependency on local worktree for review polling
Step 2 sends tickets with an existing open PR straight to review polling, but this step starts by cd-ing into /tmp/claude-widgets/{TICKET_ID} before querying GitHub. If that worktree was already cleaned up, polling fails immediately and the command cannot inspect reviews for the PR it just detected; make polling independent of local worktree existence or recreate/validate the worktree first.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in d741fcf — removed the cd into the worktree for the initial PR status check (not needed for gh pr view), and added a worktree existence check before the "changes requested" section where local files are actually needed.
.claude/agents/git-pr.md
Outdated
| git status | ||
|
|
||
| # Verify tests pass before proceeding | ||
| yarn workspace @webex/{SCOPE} test:unit |
There was a problem hiding this comment.
Resolve scope before running workspace unit tests
The agent marks SCOPE as optional, but this verification step immediately runs yarn workspace @webex/{SCOPE} test:unit before the later metadata-derivation step can infer a missing scope. When SCOPE is not passed by the caller, test verification fails on an invalid workspace target and the workflow aborts prematurely; derive/detect scope first (or use a fallback test command).
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in d741fcf — reordered the workflow so SCOPE is derived from ticket info and diff (Step 1) before tests are run (Step 2).
- Add --force flag to worktree removal after user confirmation - Add --state all to gh pr list to detect merged PRs - Remove unnecessary cd into worktree for review polling - Add worktree existence check before addressing review feedback - Reorder git-pr agent to derive SCOPE before running tests
…a-test-coverage agent
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0e2431826b
ℹ️ 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".
| **If worktree already exists:** | ||
| - Use `AskUserQuestion`: "Worktree for {TICKET_ID} already exists. Reuse or recreate?" | ||
| - **Reuse**: use existing worktree | ||
| - **Recreate**: `git worktree remove /tmp/claude-widgets/{TICKET_ID} && git branch -D {TICKET_ID}` then create fresh |
There was a problem hiding this comment.
Use --force when recreating an existing worktree
The recreate path asks users to replace an existing worktree, but it runs git worktree remove /tmp/claude-widgets/{TICKET_ID} without --force; per git worktree remove [-f] <worktree>, removal fails when that worktree is dirty or locked, so the command cannot complete the user-selected “recreate” flow in the most common stale-worktree scenario.
Useful? React with 👍 / 👎.
| **If worktree already exists at that path:** | ||
| - Use `AskUserQuestion` to ask: "Worktree for {TICKET_ID} already exists. Reuse existing worktree, or recreate it?" | ||
| - **Reuse**: skip creation, use existing worktree as-is | ||
| - **Recreate**: `git worktree remove /tmp/claude-widgets/{TICKET_ID} && git branch -D {TICKET_ID}` then create fresh |
There was a problem hiding this comment.
Force-remove dirty worktrees in /fix-tickets recreate flow
This recreate command has the same failure mode as above: git worktree remove is used without --force, so any uncommitted changes in /tmp/claude-widgets/{TICKET_ID} will block removal and prevent recreation; Git’s help explicitly documents -f as required for dirty/locked worktrees.
Useful? React with 👍 / 👎.
| test -d /tmp/claude-widgets/{TICKET_ID} || echo "NOT_FOUND" | ||
|
|
||
| # Check for staged changes | ||
| cd /tmp/claude-widgets/{TICKET_ID} | ||
| git diff --cached --stat |
There was a problem hiding this comment.
Abort submit flow when worktree path is missing
The validation step only echoes NOT_FOUND but then immediately runs cd /tmp/claude-widgets/{TICKET_ID} and git diff --cached --stat; in shell execution without set -e, a failed cd does not stop subsequent commands, so later git operations can run in the wrong repository and potentially commit/push unrelated staged changes. Add an explicit early exit/return after the missing-path check and guard cd with failure handling.
Useful? React with 👍 / 👎.
COMPLETES #N/A (internal tooling)
This pull request addresses
Setting up Claude Code autonomous agents and slash commands for the widgets monorepo, enabling AI-assisted git operations, QA test coverage, and a three-stage bug-fix pipeline (scrub → triage → fix).
by making the following changes
Agents (
.claude/agents/)fixer.md— Implements bug fixes in isolated worktrees using systematic debugging and TDDscrubber.md— Evaluates bug tickets for completeness and AI-readiness, classifies as prioritize/followup/dolatertriager.md— Deep-dives into prioritized bugs, performs root cause analysis, and proposes fix plansgit-pr.md— Updated agent for git PR operationsticket-worker.md— Updated agent for ticket processing workflowsqa-test-coverage.md— Agent for QA test coverage analysisCommands (
.claude/commands/)fix.md— Implements triaged bug fixes, creates worktree, runs tests, commits, pushes, and creates draft PRscrub.md— Runs the scrubber agent on bug tickets to classify readinesstriage.md— Runs the triager agent to root-cause prioritized bugsfix-tickets.md— Updated orchestrator for the full bug-fix pipelinesubmit-pr.md— Command for submitting PRs with FedRAMP-compliant templatescleanup-worktrees.md— Command to clean up stale git worktreesChange Type
The following scenarios were tested
The GAI Coding Policy And Copyright Annotation Best Practices
Checklist before merging
Make sure to have followed the contributing guidelines before submitting.