Skip to content

Commit d97c0af

Browse files
committed
Merge tag 'v2026.2.9'
2 parents c31e881 + 33c75cb commit d97c0af

File tree

844 files changed

+29801
-8650
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

844 files changed

+29801
-8650
lines changed

.agents/skills/PR_WORKFLOW.md

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# PR Review Instructions
2+
3+
Please read this in full and do not skip sections.
4+
5+
## Working rule
6+
7+
Skills execute workflow, maintainers provide judgment.
8+
Always pause between skills to evaluate technical direction, not just command success.
9+
10+
These three skills must be used in order:
11+
12+
1. `review-pr`
13+
2. `prepare-pr`
14+
3. `merge-pr`
15+
16+
They are necessary, but not sufficient. Maintainers must steer between steps and understand the code before moving forward.
17+
18+
Treat PRs as reports first, code second.
19+
If submitted code is low quality, ignore it and implement the best solution for the problem.
20+
21+
Do not continue if you cannot verify the problem is real or test the fix.
22+
23+
## PR quality bar
24+
25+
- Do not trust PR code by default.
26+
- Do not merge changes you cannot validate with a reproducible problem and a tested fix.
27+
- Keep types strict. Do not use `any` in implementation code.
28+
- Keep external-input boundaries typed and validated, including CLI input, environment variables, network payloads, and tool output.
29+
- Keep implementations properly scoped. Fix root causes, not local symptoms.
30+
- Identify and reuse canonical sources of truth so behavior does not drift across the codebase.
31+
- Harden changes. Always evaluate security impact and abuse paths.
32+
- Understand the system before changing it. Never make the codebase messier just to clear a PR queue.
33+
34+
## Unified workflow
35+
36+
Entry criteria:
37+
38+
- PR URL/number is known.
39+
- Problem statement is clear enough to attempt reproduction.
40+
- A realistic verification path exists (tests, integration checks, or explicit manual validation).
41+
42+
### 1) `review-pr`
43+
44+
Purpose:
45+
46+
- Review only: correctness, value, security risk, tests, docs, and changelog impact.
47+
- Produce structured findings and a recommendation.
48+
49+
Expected output:
50+
51+
- Recommendation: ready, needs work, needs discussion, or close.
52+
- `.local/review.md` with actionable findings.
53+
54+
Maintainer checkpoint before `prepare-pr`:
55+
56+
```
57+
What problem are they trying to solve?
58+
What is the most optimal implementation?
59+
Is the code properly scoped?
60+
Can we fix up everything?
61+
Do we have any questions?
62+
```
63+
64+
Stop and escalate instead of continuing if:
65+
66+
- The problem cannot be reproduced or confirmed.
67+
- The proposed PR scope does not match the stated problem.
68+
- The design introduces unresolved security or trust-boundary concerns.
69+
70+
### 2) `prepare-pr`
71+
72+
Purpose:
73+
74+
- Make the PR merge-ready on its head branch.
75+
- Rebase onto current `main`, fix blocker/important findings, and run gates.
76+
77+
Expected output:
78+
79+
- Updated code and tests on the PR head branch.
80+
- `.local/prep.md` with changes, verification, and current HEAD SHA.
81+
- Final status: `PR is ready for /mergepr`.
82+
83+
Maintainer checkpoint before `merge-pr`:
84+
85+
```
86+
Is this the most optimal implementation?
87+
Is the code properly scoped?
88+
Is the code properly typed?
89+
Is the code hardened?
90+
Do we have enough tests?
91+
Are tests using fake timers where relevant? (e.g., debounce/throttle, retry backoff, timeout branches, delayed callbacks, polling loops)
92+
Do not add performative tests, ensure tests are real and there are no regressions.
93+
Take your time, fix it properly, refactor if necessary.
94+
Do you see any follow-up refactors we should do?
95+
Did any changes introduce any potential security vulnerabilities?
96+
```
97+
98+
Stop and escalate instead of continuing if:
99+
100+
- You cannot verify behavior changes with meaningful tests or validation.
101+
- Fixing findings requires broad architecture changes outside safe PR scope.
102+
- Security hardening requirements remain unresolved.
103+
104+
### 3) `merge-pr`
105+
106+
Purpose:
107+
108+
- Merge only after review and prep artifacts are present and checks are green.
109+
- Use squash merge flow and verify the PR ends in `MERGED` state.
110+
111+
Go or no-go checklist before merge:
112+
113+
- All BLOCKER and IMPORTANT findings are resolved.
114+
- Verification is meaningful and regression risk is acceptably low.
115+
- Docs and changelog are updated when required.
116+
- Required CI checks are green and the branch is not behind `main`.
117+
118+
Expected output:
119+
120+
- Successful merge commit and recorded merge SHA.
121+
- Worktree cleanup after successful merge.
122+
123+
Maintainer checkpoint after merge:
124+
125+
- Were any refactors intentionally deferred and now need follow-up issue(s)?
126+
- Did this reveal broader architecture or test gaps we should address?

.agents/skills/merge-pr/SKILL.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Merge a prepared PR via `gh pr merge --squash` and clean up the worktree after s
2828

2929
## Known Footguns
3030

31-
- If you see "fatal: not a git repository", you are in the wrong directory. Use `~/Development/openclaw`, not `~/openclaw`.
31+
- If you see "fatal: not a git repository", you are in the wrong directory. Use `~/dev/openclaw` if available; otherwise ask user.
3232
- Read `.local/review.md` and `.local/prep.md` in the worktree. Do not skip.
3333
- Clean up the real worktree directory `.worktrees/pr-<PR>` only after a successful merge.
3434
- Expect cleanup to remove `.local/` artifacts.
@@ -49,7 +49,7 @@ Create a checklist of all merge steps, print it, then continue and execute the c
4949
Use an isolated worktree for all merge work.
5050

5151
```sh
52-
cd ~/Development/openclaw
52+
cd ~/dev/openclaw
5353
# Sanity: confirm you are in the repo
5454
git rev-parse --show-toplevel
5555

@@ -104,6 +104,8 @@ Stop if any are true:
104104
- Required checks are failing.
105105
- Branch is behind main.
106106

107+
If `.local/prep.md` contains `Docs-only change detected with high confidence; skipping pnpm test.`, that local test skip is allowed. CI checks still must be green.
108+
107109
```sh
108110
# Checks
109111
gh pr checks <PR>
@@ -167,7 +169,7 @@ gh pr view <PR> --json state --jq .state
167169
Run cleanup only if step 6 returned `MERGED`.
168170

169171
```sh
170-
cd ~/Development/openclaw
172+
cd ~/dev/openclaw
171173

172174
git worktree remove ".worktrees/pr-<PR>" --force
173175

.agents/skills/prepare-pr/SKILL.md

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ Prepare a PR branch for merge with review fixes, green gates, and an updated hea
3030

3131
## Known Footguns
3232

33-
- If you see "fatal: not a git repository", you are in the wrong directory. Use `~/openclaw`.
33+
- If you see "fatal: not a git repository", you are in the wrong directory. Use `~/dev/openclaw` if available; otherwise ask user.
3434
- Do not run `git clean -fdx`.
3535
- Do not run `git add -A` or `git add .`.
3636

3737
## Completion Criteria
3838

3939
- Rebase PR commits onto `origin/main`.
4040
- Fix all BLOCKER and IMPORTANT items from `.local/review.md`.
41-
- Run gates and pass.
41+
- Run required gates and pass (docs-only PRs may skip `pnpm test` when high-confidence docs-only criteria are met and documented).
4242
- Commit prep changes.
4343
- Push the updated HEAD back to the PR head branch.
4444
- Write `.local/prep.md` with a prep summary.
@@ -163,17 +163,46 @@ If `committer` is not found:
163163
git commit -m "fix: <summary> (#<PR>) (thanks @$contrib)"
164164
```
165165

166-
8. Run full gates before pushing
166+
8. Decide verification mode and run required gates before pushing
167+
168+
If you are highly confident the change is docs-only, you may skip `pnpm test`.
169+
170+
High-confidence docs-only criteria (all must be true):
171+
172+
- Every changed file is documentation-only (`docs/**`, `README*.md`, `CHANGELOG.md`, `*.md`, `*.mdx`, `mintlify.json`, `docs.json`).
173+
- No code, runtime, test, dependency, or build config files changed (`src/**`, `extensions/**`, `apps/**`, `package.json`, lockfiles, TS/JS config, test files, scripts).
174+
- `.local/review.md` does not call for non-doc behavior fixes.
175+
176+
Suggested check:
177+
178+
```sh
179+
changed_files=$(git diff --name-only origin/main...HEAD)
180+
non_docs=$(printf "%s\n" "$changed_files" | grep -Ev '^(docs/|README.*\.md$|CHANGELOG\.md$|.*\.md$|.*\.mdx$|mintlify\.json$|docs\.json$)' || true)
181+
182+
docs_only=false
183+
if [ -n "$changed_files" ] && [ -z "$non_docs" ]; then
184+
docs_only=true
185+
fi
186+
187+
echo "docs_only=$docs_only"
188+
```
189+
190+
Run required gates:
167191

168192
```sh
169193
pnpm install
170194
pnpm build
171195
pnpm ui:build
172196
pnpm check
173-
pnpm test
197+
198+
if [ "$docs_only" = "true" ]; then
199+
echo "Docs-only change detected with high confidence; skipping pnpm test." | tee -a .local/prep.md
200+
else
201+
pnpm test
202+
fi
174203
```
175204

176-
Require all to pass. If something fails, fix, commit, and rerun. Allow at most 3 fix and rerun cycles. If gates still fail after 3 attempts, stop and report the failures. Do not loop indefinitely.
205+
Require all required gates to pass. If something fails, fix, commit, and rerun. Allow at most 3 fix and rerun cycles. If gates still fail after 3 attempts, stop and report the failures. Do not loop indefinitely.
177206

178207
9. Push updates back to the PR head branch
179208

@@ -245,4 +274,4 @@ Otherwise, list remaining failures and stop.
245274
- Do not delete the worktree on success. `/mergepr` may reuse it.
246275
- Do not run `gh pr merge`.
247276
- Never push to main. Only push to the PR head branch.
248-
- Run and pass all gates before pushing.
277+
- Run and pass all required gates before pushing. `pnpm test` may be skipped only for high-confidence docs-only changes, and the skip must be explicitly recorded in `.local/prep.md`.

.agents/skills/review-pr/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Perform a thorough review-only PR assessment and return a structured recommendat
2828

2929
## Known Failure Modes
3030

31-
- If you see "fatal: not a git repository", you are in the wrong directory. Use `~/openclaw`.
31+
- If you see "fatal: not a git repository", you are in the wrong directory. Use `~/dev/openclaw` if available; otherwise ask user.
3232
- Do not stop after printing the checklist. That is not completion.
3333

3434
## Writing Style for Output
@@ -51,7 +51,7 @@ Create a checklist of all review steps, print it, then continue and execute the
5151
Use an isolated worktree for all review work.
5252

5353
```sh
54-
cd ~/Development/openclaw
54+
cd ~/dev/openclaw
5555
# Sanity: confirm you are in the repo
5656
git rev-parse --show-toplevel
5757

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Detect docs-only changes
2+
description: >
3+
Outputs docs_only=true when all changed files are under docs/ or are
4+
markdown (.md/.mdx). Fail-safe: if detection fails, outputs false (run
5+
everything). Uses git diff — no API calls, no extra permissions needed.
6+
7+
outputs:
8+
docs_only:
9+
description: "'true' if all changes are docs/markdown, 'false' otherwise"
10+
value: ${{ steps.check.outputs.docs_only }}
11+
12+
runs:
13+
using: composite
14+
steps:
15+
- name: Detect docs-only changes
16+
id: check
17+
shell: bash
18+
run: |
19+
if [ "${{ github.event_name }}" = "push" ]; then
20+
BASE="${{ github.event.before }}"
21+
else
22+
# Use the exact base SHA from the event payload — stable regardless
23+
# of base branch movement (avoids origin/<ref> drift).
24+
BASE="${{ github.event.pull_request.base.sha }}"
25+
fi
26+
27+
# Fail-safe: if we can't diff, assume non-docs (run everything)
28+
CHANGED=$(git diff --name-only "$BASE" HEAD 2>/dev/null || echo "UNKNOWN")
29+
if [ "$CHANGED" = "UNKNOWN" ] || [ -z "$CHANGED" ]; then
30+
echo "docs_only=false" >> "$GITHUB_OUTPUT"
31+
exit 0
32+
fi
33+
34+
# Check if all changed files are docs or markdown
35+
NON_DOCS=$(echo "$CHANGED" | grep -vE '^docs/|\.md$|\.mdx$' || true)
36+
if [ -z "$NON_DOCS" ]; then
37+
echo "docs_only=true" >> "$GITHUB_OUTPUT"
38+
echo "Docs-only change detected — skipping heavy jobs"
39+
else
40+
echo "docs_only=false" >> "$GITHUB_OUTPUT"
41+
fi
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Setup pnpm + store cache
2+
description: Prepare pnpm via corepack and restore pnpm store cache.
3+
inputs:
4+
pnpm-version:
5+
description: pnpm version to activate via corepack.
6+
required: false
7+
default: "10.23.0"
8+
cache-key-suffix:
9+
description: Suffix appended to the cache key.
10+
required: false
11+
default: "node22"
12+
runs:
13+
using: composite
14+
steps:
15+
- name: Setup pnpm (corepack retry)
16+
shell: bash
17+
run: |
18+
set -euo pipefail
19+
corepack enable
20+
for attempt in 1 2 3; do
21+
if corepack prepare "pnpm@${{ inputs.pnpm-version }}" --activate; then
22+
pnpm -v
23+
exit 0
24+
fi
25+
echo "corepack prepare failed (attempt $attempt/3). Retrying..."
26+
sleep $((attempt * 10))
27+
done
28+
exit 1
29+
30+
- name: Resolve pnpm store path
31+
id: pnpm-store
32+
shell: bash
33+
run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
34+
35+
- name: Restore pnpm store cache
36+
uses: actions/cache@v4
37+
with:
38+
path: ${{ steps.pnpm-store.outputs.path }}
39+
key: ${{ runner.os }}-pnpm-store-${{ inputs.cache-key-suffix }}-${{ hashFiles('pnpm-lock.yaml') }}
40+
restore-keys: |
41+
${{ runner.os }}-pnpm-store-${{ inputs.cache-key-suffix }}-

0 commit comments

Comments
 (0)