Autonomous Agents Agentic Workflow
RCA + Fix + PR — Autonomous Agents Agentic Workflow
Investigate bug, trace root cause, implement fix, create PR
sidebutton install agents The combined investigate-and-resolve chain for bug tickets. The agent first reproduces the failure, traces it to its true root cause, then implements the minimum change required to fix it without introducing adjacent refactors. Local tests are run before any commit, and a PR is opened against the default branch with a clear description that explains the cause and the fix separately.
Use this for bugs where the fix is in-scope for one agent and does not require design input. For tickets where the cause is ambiguous or where a design review must precede the fix, run the investigation-only RCA workflow first.
Steps
- 1. Open a terminal
- title
- Agent: SE RCA+Fix
- cwd
- {{entry_path}}
terminal.open - 2. Run a terminal command
- cmd
- |
terminal.run
Workflow definition
schema_version: 1
id: agent_se_rca_fix
title: "RCA + Fix + PR"
description: "Investigate bug, trace root cause, implement fix, create PR"
overview: |
The combined investigate-and-resolve chain for bug tickets. The agent first reproduces the failure, traces it to its true root cause, then implements the minimum change required to fix it without introducing adjacent refactors. Local tests are run before any commit, and a PR is opened against the default branch with a clear description that explains the cause and the fix separately.
Use this for bugs where the fix is in-scope for one agent and does not require design input. For tickets where the cause is ambiguous or where a design review must precede the fix, run the investigation-only RCA workflow first.
category:
level: pipeline
domain: engineering
metadata:
agent: true
role: se
# Gate-verdict vocabulary for portal playbook steps (PLAYBOOKS.md §5) — matched from the
# step's ticket comment; declaring it here is what makes this workflow content-routable.
verdicts: [PR_OPEN, BLOCKED]
params:
agentic_app:
type: string
default: "cc"
description: "Agent-app slug selecting the per-run env file ~/.agent-env.d/<slug> (AAP-C); 'cc'/subscription clears provider vars"
ticket_url:
type: string
description: "Jira ticket URL"
hint:
type: string
default: ""
description: "Optional extra instructions for the agent"
entry_path:
type: string
default: "~/workspace"
description: "Working directory for the agent"
steps:
- type: terminal.open
title: "Agent: SE RCA+Fix"
cwd: "{{entry_path}}"
- type: terminal.run
cmd: |
source ~/.agent-env
# AAP-C (SCRUM-1506) + AAP-17 (SCRUM-1653): clear EVERY provider var an agent-app can deliver so
# none hijacks/poisons a subscription run. A stray global ANTHROPIC_MODEL / ANTHROPIC_SMALL_FAST_MODEL
# needs no CLAUDE_CODE_USE_* flag, so the old ${!CLAUDE_CODE_USE_@} glob never caught it — it survived
# into the run and 404-ed aux/small-fast calls against api.anthropic.com. This explicit list mirrors
# AGENT_APP_ENV_KEYS 1:1 (the-assistant website/src/lib/cloud/agent-app-env.ts — the single source of
# truth; a parity test in each repo guards the two from drifting). Explicit over a glob: the union has
# non-ANTHROPIC_ members (AWS_REGION, AWS_PROFILE, CLOUD_ML_REGION, CLAUDE_CODE_MAX_OUTPUT_TOKENS) and
# a ${!AWS_@} glob would over-clear unrelated creds. Then source the per-run app env by slug when it
# exists; no file => subscription/default. base/19-secrets stages ~/.agent-env.d/<slug>.
unset \
ANTHROPIC_API_KEY ANTHROPIC_BASE_URL ANTHROPIC_AUTH_TOKEN \
CLAUDE_CODE_USE_BEDROCK AWS_REGION AWS_PROFILE ANTHROPIC_MODEL \
ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION ANTHROPIC_SMALL_FAST_MODEL CLAUDE_CODE_MAX_OUTPUT_TOKENS \
CLAUDE_CODE_USE_VERTEX CLOUD_ML_REGION ANTHROPIC_VERTEX_PROJECT_ID ANTHROPIC_VERTEX_BASE_URL \
CLAUDE_CODE_USE_FOUNDRY ANTHROPIC_FOUNDRY_RESOURCE ANTHROPIC_FOUNDRY_BASE_URL \
ANTHROPIC_DEFAULT_OPUS_MODEL ANTHROPIC_DEFAULT_SONNET_MODEL ANTHROPIC_DEFAULT_HAIKU_MODEL
if [ -f "$HOME/.agent-env.d/{{agentic_app}}" ]; then
source "$HOME/.agent-env.d/{{agentic_app}}"
fi
claude --dangerously-skip-permissions "$(cat <<'SB_PROMPT'
read ticket with attachments and all comments - {{ticket_url}}. if it fails, stop and report the error.
learn how to SE relevant parts. reproduce the issue, trace root cause, implement a focused fix.
create PR to target repo or repos.
{{hint}}
if you produced a mock, diagram, screenshot, or report as evidence, publish it via the publish_artifact tool and cite the returned download link in your comment; if the tool is unavailable, save under ~/workspace/artifacts/ for post-run collection.
write one comment to the ticket with: root cause (file:line refs), what was changed, PR link(s), and how to verify.
SB_PROMPT
)"