11---
22name : clownfish-cloud-pr
3- description : Use when launching Clownfish in GitHub Actions to create or update one guarded GitHub implementation PR from issue/PR refs, a ClawSweeper report, or a custom maintainer prompt.
3+ description : Use when launching Clownfish in GitHub Actions to create or update one guarded GitHub implementation PR from issue/PR refs, a ClawSweeper report, a custom maintainer prompt, or to opt an existing Clownfish PR into ClawSweeper-reviewed cloud automerge .
44---
55
66# Clownfish Cloud PR
77
88Use this skill when the user wants Codex to ask Clownfish to create a PR in the
99cloud from issue/PR refs plus a custom prompt.
1010
11- ## Create One Job
11+ ## Start
1212
1313``` bash
1414cd ~ /Projects/clownfish
1515git status --short --branch
16+ gh variable list --repo openclaw/clownfish --json name,value \
17+ --jq ' map(select(.name|test("^CLOWNFISH_"))) | sort_by(.name) | .[] | {name,value}'
18+ ```
19+
20+ Keep merge gated unless Peter explicitly opens it. Execute/fix gates are closed
21+ unless the repo variables are literally ` 1 ` ; normal fix-PR work needs an
22+ intentional execution window:
23+
24+ ``` bash
25+ gh variable set CLOWNFISH_ALLOW_EXECUTE --repo openclaw/clownfish --body 1
26+ gh variable set CLOWNFISH_ALLOW_FIX_PR --repo openclaw/clownfish --body 1
27+ gh variable set CLOWNFISH_ALLOW_MERGE --repo openclaw/clownfish --body 0
28+ gh variable set CLOWNFISH_ALLOW_AUTOMERGE --repo openclaw/clownfish --body 0
29+ ```
30+
31+ Reset ` CLOWNFISH_ALLOW_EXECUTE=0 ` and ` CLOWNFISH_ALLOW_FIX_PR=0 ` after the
32+ window. If those vars are absent or not ` 1 ` , execute/autonomous workflow runs
33+ stay plan-only/no-mutation.
34+
35+ ## Create One Job
36+
37+ From refs and a custom prompt:
38+
39+ ``` bash
1640npm run create-job -- \
1741 --repo openclaw/openclaw \
1842 --refs 123,456 \
@@ -28,7 +52,28 @@ npm run create-job -- \
2852
2953The script checks for an existing open PR/body match and remote branch named
3054` clownfish/<cluster-id> ` before writing a duplicate job. Use ` --dry-run ` to
31- inspect the exact job body.
55+ inspect the exact job body and ` --force ` only after deciding the duplicate check
56+ is stale.
57+
58+ ## Ask For A Replacement PR
59+
60+ The skill can trigger replacement PR writing through the normal ` create-job `
61+ and ` dispatch ` path. Put the maintainer decision in the prompt:
62+
63+ ``` md
64+ Treat #123 as useful source work. If the source branch cannot be safely updated
65+ because it is uneditable, stale, draft-only, unmergeable, or unsafe, create a
66+ narrow Clownfish replacement PR instead of waiting. Preserve the source PR
67+ author as co-author, credit the source PR in the replacement PR body, and close
68+ only that source PR after the replacement PR is opened.
69+ ```
70+
71+ The worker should emit ` repair_strategy=replace_uneditable_branch ` and list the
72+ source PR URL in ` source_prs ` . The deterministic executor opens or updates
73+ ` clownfish/<cluster-id> ` , adds non-bot source PR authors as ` Co-authored-by `
74+ trailers, and closes the superseded source PR only after the replacement PR
75+ exists. New replacement PRs are blocked when the touched area already has
76+ ` CLOWNFISH_MAX_ACTIVE_PRS_PER_AREA ` open Clownfish PRs.
3277
3378## Validate And Dispatch
3479
@@ -46,13 +91,81 @@ npm run dispatch -- jobs/openclaw/inbox/clawsweeper-openclaw-openclaw-123.md \
4691```
4792
4893Do not use ` --dispatch ` until the job is committed and pushed; the workflow
49- reads the job path from GitHub. Keep ` CLOWNFISH_ALLOW_MERGE=0 ` unless Peter
50- explicitly opens the merge gate.
94+ reads the job path from GitHub.
95+
96+ ## Maintainer Comment Commands
97+
98+ Clownfish can also be asked from target repo comments, but only by maintainers.
99+ Use ` /clownfish ... ` or ` @openclaw-clownfish ... ` ; do not use ` @clownfish `
100+ because that is a separate GitHub user.
101+
102+ Supported commands:
103+
104+ ``` text
105+ /clownfish status
106+ /clownfish fix ci
107+ /clownfish address review
108+ /clownfish rebase
109+ /clownfish automerge
110+ /clownfish explain
111+ /clownfish stop
112+ @openclaw-clownfish fix ci
113+ ```
114+
115+ The router accepts ` OWNER ` , ` MEMBER ` , and ` COLLABORATOR ` comments by default.
116+ Contributor comments are ignored without a reply. Repair commands dispatch
117+ ` cluster-worker.yml ` only for existing Clownfish PRs with the ` clownfish ` label
118+ or ` clownfish/* ` branch.
119+
120+ ``` bash
121+ npm run comment-router -- --repo openclaw/openclaw --lookback-minutes 180
122+ npm run comment-router -- --repo openclaw/openclaw --execute --wait-for-capacity
123+ ```
124+
125+ Scheduled routing stays dry until ` CLOWNFISH_COMMENT_ROUTER_EXECUTE=1 ` is set in
126+ ` openclaw/clownfish ` repo variables.
127+
128+ ## Bounded ClawSweeper-Reviewed Automerge
129+
130+ Use this only for an existing Clownfish PR that maps back to a ` clownfish/* `
131+ branch and job file:
132+
133+ ``` text
134+ /clownfish automerge
135+ ```
136+
137+ The router verifies the commenter is a maintainer, adds
138+ ` clownfish:automerge ` , dispatches ClawSweeper for the current PR head, and
139+ waits for trusted ClawSweeper markers. ` needs-changes ` / ` fix-required `
140+ dispatches the normal repair worker. ` pass ` , ` approved ` , or ` no-changes ` may
141+ merge only when the marker SHA matches the current PR head, checks are green,
142+ GitHub says the PR is mergeable, no ` clownfish:human-review ` label is present,
143+ and both merge gates are open:
144+
145+ ``` bash
146+ gh variable set CLOWNFISH_ALLOW_MERGE --repo openclaw/clownfish --body 1
147+ gh variable set CLOWNFISH_ALLOW_AUTOMERGE --repo openclaw/clownfish --body 1
148+ ```
149+
150+ The actual merge command is pinned with GitHub's head-match guard, so a branch
151+ push after ClawSweeper reviewed cannot merge an unreviewed head. If either
152+ merge gate is closed when ClawSweeper passes, Clownfish labels the PR
153+ ` clownfish:merge-ready ` only after readiness checks have passed; failing checks,
154+ stale heads, conflicts, draft state, or human-review labels must not get that
155+ label. Pause with ` /clownfish stop ` , which adds ` clownfish:human-review ` .
156+
157+ The repair loop is capped by ` CLOWNFISH_CLAWSWEEPER_MAX_REPAIRS_PER_PR `
158+ (default ` 5 ` ) and ` CLOWNFISH_CLAWSWEEPER_MAX_REPAIRS_PER_HEAD ` (default ` 1 ` ).
51159
52160## Guardrails
53161
54162- One cluster, one branch, one PR: ` clownfish/<cluster-id> ` .
55163- No security-sensitive work.
164+ - New replacement PRs are capped per touched area by
165+ ` CLOWNFISH_MAX_ACTIVE_PRS_PER_AREA ` .
166+ - Do not merge from Clownfish unless Peter explicitly asks.
167+ - Do not open ` CLOWNFISH_ALLOW_AUTOMERGE ` unless Peter explicitly asks for an
168+ automerge window.
56169- Do not close duplicates before the fix PR path exists, lands, or is proven
57170 unnecessary.
58171- Codex workers do not get GitHub tokens; deterministic scripts own writes.
0 commit comments