PRFlow
Use atlas prflow as the authoritative interface for direct Bitbucket
pull-request and pipeline work.
Tool Boundary
- PRFlow owns Bitbucket PR metadata, diffs, changed lines, comments, approvals,
merge readiness, PR mutations, pipelines, failed logs, and Renovate actions.
twg owns Jira, Confluence, people, ownership, goals, projects, and
cross-product company context.
- Local
git, rg, and repository-native build tools own local source changes,
branches, and verification.
Use TWG to discover linked requirements or decisions, then return to PRFlow for
the Bitbucket action.
Never persist private repository metadata, PR content, comments, pipeline logs,
tokens, or downloaded artifacts in this skill source repository. Use the active
project's ignored runtime directory or an explicit temporary directory.
CLI And Authentication
- Print the installed CLI version with
atlas prflow version. Do not use
atlas prflow --version.
- Use
atlas prflow <command> --help before guessing current flags or a mutation
contract.
- Use the configured authentication mode for routine work.
- Never provide a raw token through
--token, command output, or chat.
- Do not run token setup, authentication switching, config changes, cache
clearing, plugin installation, or credential repair unless the user asks.
- For requested authentication diagnosis, use
auth mode, auth check, or the
read-only auth smoke command before changing configuration.
Target The Repository
Prefer these target forms:
- A full PR or pipeline URL, which identifies workspace, repository, and ID.
--repo-name <name> for a configured named repository.
--repo <workspace/repo> or an unambiguous configured repository slug.
- The configured default only when it clearly matches the active task.
A numeric PR ID requires repository context. Never guess a repository, workspace,
PR ID, branch, build number, or merge strategy.
Read And Mutation Boundary
- Listing, reviewing, checking, diagnosing, monitoring, and fetching logs are
read-only.
- A request to review a PR does not authorize comments, approvals, commits,
pushes, merges, retargeting, pipeline reruns, or other mutations.
- When the user explicitly requests a specific PR action, inspect current state
and execute it without an extra confirmation.
- For broad, bulk, destructive, or ambiguous actions, first list or dry-run the
exact candidate set. Execute directly only when the user's request clearly
authorizes that set.
- Verify mutations with a follow-up PR or pipeline read and report the result.
PR Read And Review Workflow
- Resolve the PR URL or ID and repository.
- Start with
pr review-bundle for metadata, readiness, checks, comments,
changed files, and diff statistics in one read.
- Use
pr review-lines when exact destination line numbers are needed for
findings or inline comments.
- Use
pr status for the concise merge-readiness view and pr checks for
individual commit and compliance checks.
- Use
comment list --threads --unresolved-only or --actionable for current
review work. Historical comments alone are not blockers.
- Use
agent diagnose or pr doctor when the user wants an agent-friendly
diagnosis spanning checks, comments, pipeline state, and failed excerpts.
- Hand code analysis to
review-code, adding kotlin-code-reviewer for Kotlin.
Use JSON only when structured output materially reduces parsing or ambiguity.
Do not collect the same PR state repeatedly through overlapping commands.
PR Actions
Use the narrow command and inspect its live help:
| Requested action |
Command family |
| Add, reply to, close, or resolve a comment |
comment |
| Approve or remove approval |
approve or unapprove |
| Merge |
merge |
| Update title or description |
update-title or update-description |
| Change destination branch |
retarget |
| Sync with destination |
sync |
| Create, draft, ready, or decline |
pr |
| Enroll for merge when ready |
mogin |
Before approving or merging, read pr status and pr checks. Surface failed or
missing checks, open tasks, unresolved actionable threads, stale state, and
destination-branch ambiguity. Do not bypass them unless the user explicitly
requests the available override.
For comments:
- Use the top-level
comment form for new workflows.
- Use the parent thread ID for replies and resolution.
- Anchor inline comments with
pr review-lines.
- A listed historical or bot summary comment is not necessarily unresolved.
Treat
pr status, pr checks, and unresolved thread filters as authoritative
for blockers.
- A response that a thread is already resolved is a successful final state.
Pipelines And Checks
Keep these surfaces distinct:
pr checks is the source of truth for PR merge-blocking commit statuses.
pipeline --pr-id <id> --repo <repo> --commit-statuses inspects PR
merge-readiness.
pipeline ... --pr-pipeline selects pull-request pipelines.
pipeline ... --branch-pipeline selects branch or default pipelines for the
PR source branch.
pipeline --build <number> --repo <repo> identifies an exact pipeline run.
trigger-pipeline starts an explicitly requested default or named custom
pipeline on a branch.
Never pass a bare numeric target to pipeline. Use --pr-id for a pull request,
--build for a build, or supply a full URL.
Use --follow-ws to wait for terminal state. It uses Bitbucket events and falls
back to polling. Do not build sleep loops or JSON polling wrappers when the
built-in follower is sufficient.
Starting, rerunning, pushing to retrigger, or starting a manual pipeline step is
a mutation and requires an explicit request.
Failed Logs And Fix Loops
When a build fails:
- Record the exact failed build number and intended pipeline surface.
- Fetch that build with
logs --build <number> --failed-only --summary.
- Write logs to an explicit temporary or workspace runtime directory, never to
the installed skill directory.
- Inspect the actual failing step before proposing or making a code change.
- Treat zero-duration pipelines with empty logs as selector, YAML, image, or
setup failures until evidence points to application code.
When the user asks to fix until green:
- Follow the current run with
--follow-ws.
- Fetch exact failed logs.
- Apply the smallest justified change through
write-code.
- Run focused local verification.
- Commit and push only as authorized by the request.
- Follow the newly triggered run and repeat until green or genuinely blocked.
Stop after five consecutive code-fix cycles without convergence and report the
repeated failure and evidence. Do not discard local or remote work to resolve a
push rejection.
Renovate
- Use
renovate list for read-only inventory and triage.
- For bulk approve, sync, decline, or repair requests, inspect the candidate set
and current checks first.
- Treat conflicts, stale branches, failed checks, and dependency-specific code
failures as separate conditions.
- Fix one failing dependency PR at a time unless the user explicitly requests
parallel execution.
- After a fix, verify locally, push only when authorized, and follow PR checks
until terminal.
Use live renovate <command> --help for the installed options. Do not preserve a
static catalog of dependency-specific fixes in this skill.
Failure Handling
- Keep authentication, authorization, Bitbucket API, Git transport, PR state,
and pipeline failures distinct.
- Retry only when the error is plausibly transient or the command contract was
corrected.
- Stop after the same non-transient failure occurs twice and report the exact
command family, target, error, and remediation.
- Never claim a PR is ready from a passing branch pipeline alone. Confirm PR
checks and current commit state.
1---2name: prflow3description: Use for direct Bitbucket pull-request and CI operations through atlas prflow, including PR discovery and review context, comments, approvals, merges, descriptions, retargeting, checks, pipeline status and logs, custom pipelines, and Renovate workflows. Use live command help for current flags.4---56# PRFlow78Use `atlas prflow` as the authoritative interface for direct Bitbucket9pull-request and pipeline work.1011## Tool Boundary1213- PRFlow owns Bitbucket PR metadata, diffs, changed lines, comments, approvals,14 merge readiness, PR mutations, pipelines, failed logs, and Renovate actions.15- `twg` owns Jira, Confluence, people, ownership, goals, projects, and16 cross-product company context.17- Local `git`, `rg`, and repository-native build tools own local source changes,18 branches, and verification.1920Use TWG to discover linked requirements or decisions, then return to PRFlow for21the Bitbucket action.2223Never persist private repository metadata, PR content, comments, pipeline logs,24tokens, or downloaded artifacts in this skill source repository. Use the active25project's ignored runtime directory or an explicit temporary directory.2627## CLI And Authentication2829- Print the installed CLI version with `atlas prflow version`. Do not use30 `atlas prflow --version`.31- Use `atlas prflow <command> --help` before guessing current flags or a mutation32 contract.33- Use the configured authentication mode for routine work.34- Never provide a raw token through `--token`, command output, or chat.35- Do not run token setup, authentication switching, config changes, cache36 clearing, plugin installation, or credential repair unless the user asks.37- For requested authentication diagnosis, use `auth mode`, `auth check`, or the38 read-only `auth smoke` command before changing configuration.3940## Target The Repository4142Prefer these target forms:43441. A full PR or pipeline URL, which identifies workspace, repository, and ID.452. `--repo-name <name>` for a configured named repository.463. `--repo <workspace/repo>` or an unambiguous configured repository slug.474. The configured default only when it clearly matches the active task.4849A numeric PR ID requires repository context. Never guess a repository, workspace,50PR ID, branch, build number, or merge strategy.5152## Read And Mutation Boundary5354- Listing, reviewing, checking, diagnosing, monitoring, and fetching logs are55 read-only.56- A request to review a PR does not authorize comments, approvals, commits,57 pushes, merges, retargeting, pipeline reruns, or other mutations.58- When the user explicitly requests a specific PR action, inspect current state59 and execute it without an extra confirmation.60- For broad, bulk, destructive, or ambiguous actions, first list or dry-run the61 exact candidate set. Execute directly only when the user's request clearly62 authorizes that set.63- Verify mutations with a follow-up PR or pipeline read and report the result.6465## PR Read And Review Workflow66671. Resolve the PR URL or ID and repository.682. Start with `pr review-bundle` for metadata, readiness, checks, comments,69 changed files, and diff statistics in one read.703. Use `pr review-lines` when exact destination line numbers are needed for71 findings or inline comments.724. Use `pr status` for the concise merge-readiness view and `pr checks` for73 individual commit and compliance checks.745. Use `comment list --threads --unresolved-only` or `--actionable` for current75 review work. Historical comments alone are not blockers.766. Use `agent diagnose` or `pr doctor` when the user wants an agent-friendly77 diagnosis spanning checks, comments, pipeline state, and failed excerpts.787. Hand code analysis to `review-code`, adding `kotlin-code-reviewer` for Kotlin.7980Use JSON only when structured output materially reduces parsing or ambiguity.81Do not collect the same PR state repeatedly through overlapping commands.8283## PR Actions8485Use the narrow command and inspect its live help:8687| Requested action | Command family |88| --- | --- |89| Add, reply to, close, or resolve a comment | `comment` |90| Approve or remove approval | `approve` or `unapprove` |91| Merge | `merge` |92| Update title or description | `update-title` or `update-description` |93| Change destination branch | `retarget` |94| Sync with destination | `sync` |95| Create, draft, ready, or decline | `pr` |96| Enroll for merge when ready | `mogin` |9798Before approving or merging, read `pr status` and `pr checks`. Surface failed or99missing checks, open tasks, unresolved actionable threads, stale state, and100destination-branch ambiguity. Do not bypass them unless the user explicitly101requests the available override.102103For comments:104105- Use the top-level `comment` form for new workflows.106- Use the parent thread ID for replies and resolution.107- Anchor inline comments with `pr review-lines`.108- A listed historical or bot summary comment is not necessarily unresolved.109 Treat `pr status`, `pr checks`, and unresolved thread filters as authoritative110 for blockers.111- A response that a thread is already resolved is a successful final state.112113## Pipelines And Checks114115Keep these surfaces distinct:116117- `pr checks` is the source of truth for PR merge-blocking commit statuses.118- `pipeline --pr-id <id> --repo <repo> --commit-statuses` inspects PR119 merge-readiness.120- `pipeline ... --pr-pipeline` selects pull-request pipelines.121- `pipeline ... --branch-pipeline` selects branch or default pipelines for the122 PR source branch.123- `pipeline --build <number> --repo <repo>` identifies an exact pipeline run.124- `trigger-pipeline` starts an explicitly requested default or named custom125 pipeline on a branch.126127Never pass a bare numeric target to `pipeline`. Use `--pr-id` for a pull request,128`--build` for a build, or supply a full URL.129130Use `--follow-ws` to wait for terminal state. It uses Bitbucket events and falls131back to polling. Do not build sleep loops or JSON polling wrappers when the132built-in follower is sufficient.133134Starting, rerunning, pushing to retrigger, or starting a manual pipeline step is135a mutation and requires an explicit request.136137## Failed Logs And Fix Loops138139When a build fails:1401411. Record the exact failed build number and intended pipeline surface.1422. Fetch that build with `logs --build <number> --failed-only --summary`.1433. Write logs to an explicit temporary or workspace runtime directory, never to144 the installed skill directory.1454. Inspect the actual failing step before proposing or making a code change.1465. Treat zero-duration pipelines with empty logs as selector, YAML, image, or147 setup failures until evidence points to application code.148149When the user asks to fix until green:1501511. Follow the current run with `--follow-ws`.1522. Fetch exact failed logs.1533. Apply the smallest justified change through `write-code`.1544. Run focused local verification.1555. Commit and push only as authorized by the request.1566. Follow the newly triggered run and repeat until green or genuinely blocked.157158Stop after five consecutive code-fix cycles without convergence and report the159repeated failure and evidence. Do not discard local or remote work to resolve a160push rejection.161162## Renovate163164- Use `renovate list` for read-only inventory and triage.165- For bulk approve, sync, decline, or repair requests, inspect the candidate set166 and current checks first.167- Treat conflicts, stale branches, failed checks, and dependency-specific code168 failures as separate conditions.169- Fix one failing dependency PR at a time unless the user explicitly requests170 parallel execution.171- After a fix, verify locally, push only when authorized, and follow PR checks172 until terminal.173174Use live `renovate <command> --help` for the installed options. Do not preserve a175static catalog of dependency-specific fixes in this skill.176177## Failure Handling178179- Keep authentication, authorization, Bitbucket API, Git transport, PR state,180 and pipeline failures distinct.181- Retry only when the error is plausibly transient or the command contract was182 corrected.183- Stop after the same non-transient failure occurs twice and report the exact184 command family, target, error, and remediation.185- Never claim a PR is ready from a passing branch pipeline alone. Confirm PR186 checks and current commit state.