loop-bb-prlisted
Install: claude install-skill restarter/lets-workflow
# loop-bb-pr
Compose a `/loop` that periodically polls a Bitbucket PR via the `bb-api` wrapper and surfaces changes (new comments, review state, merge, decline).
The skill **never invokes `/loop` itself** at initial start — Claude Code's `/loop` is a UI command. It composes the prompt and presents for paste; once active, the autonomous run uses `ScheduleWakeup` directly per tick (that part is model-callable).
> **IMPORTANT:** If the spec below invokes any deferred tool (e.g. `AskUserQuestion`), you MUST load and call it as specified.
## Step 1: Resolve PR URL
Parse `args` parameter for URL. If not provided, AskUserQuestion:
```
AskUserQuestion(
questions=[{
question: "Bitbucket PR URL to watch?",
header: "PR URL",
options: [
{ label: "I'll paste it", description: "Send the bitbucket.org/.../pull-requests/N URL in your next message" },
{ label: "Cancel", description: "Abort composition" }
],
multiSelect: false
}]
)
```
If user picks "I'll paste it", wait for URL in their next message.
**Normalize then validate** — real BB URLs often have query strings (`?at=branch&type=...`) or trailing slashes. Strip before regex match:
```bash
URL="<from input>"
URL="${URL%%\?*}" # strip query string (everything from ? onward)
URL="${URL%#*}" # strip fragment (everything from # onward)
URL="${URL%/}" # strip trailing slash
```
Then **strict validation** — normalized URL must match exactly:
```
^https://bitbucket\.org/[a-zA-Z0-9_-]+/[a