Skip to content

Commit 1b7d164

Browse files
authored
chore: extract common skill conventions into CLAUDE.md (#1928)
1 parent 7a59a68 commit 1b7d164

2 files changed

Lines changed: 48 additions & 36 deletions

File tree

.claude/skills/playwright-roll/SKILL.md

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -164,39 +164,3 @@ When you've identified a hanging test:
164164
1. Run it in isolation: `mvn -f playwright/pom.xml test -Dtest='TestClass#testMethod'`. If it passes alone, it's a parallel-load flake — note it but move on.
165165
2. If it still hangs in isolation, look for a recent fix in the upstream repo for the *same* test name. Use `git log --oneline tests/library/<spec>.spec.ts` in `~/playwright`. Upstream fixes for client-side hangs are often small and portable (e.g. `about:blank``server.EMPTY_PAGE` from microsoft/playwright#39840 fixed `route-web-socket.spec.ts` arraybuffer hangs — apparently some browser changed the WebSocket origin policy on `about:blank`).
166166
3. When porting an upstream fix, mirror the helper signature change rather than hard-coding workarounds. E.g. if upstream added a `server` parameter to `setupWS`, do the same in Java by injecting `Server server` via the JUnit fixture (`@FixtureTest` already wires up `ServerLifecycle`, so adding `Server server` to the test method signature is enough — no class-level boilerplate). Watch for local-variable shadowing when you add a `Server server` parameter to a method that already has a `WebSocketRoute server` local; rename the local.
167-
168-
## Commit Convention
169-
170-
Semantic commit messages: `label(scope): description`
171-
172-
Labels: `fix`, `feat`, `chore`, `docs`, `test`, `devops`
173-
174-
```bash
175-
git checkout -b fix-39562
176-
# ... make changes ...
177-
git add <changed-files>
178-
git commit -m "$(cat <<'EOF'
179-
fix(proxy): handle SOCKS proxy authentication
180-
181-
Fixes: https://github.com/microsoft/playwright-java/issues/39562
182-
EOF
183-
)"
184-
git push origin fix-39562
185-
gh pr create --repo microsoft/playwright-java --head username:fix-39562 \
186-
--title "fix(proxy): handle SOCKS proxy authentication" \
187-
--body "$(cat <<'EOF'
188-
## Summary
189-
- <describe the change very! briefly>
190-
191-
Fixes https://github.com/microsoft/playwright-java/issues/39562
192-
EOF
193-
)"
194-
```
195-
196-
Never add Co-Authored-By agents in commit message.
197-
Never add "Generated with" in commit message.
198-
Branch naming for issue fixes: `fix-<issue-number>`
199-
200-
## Tips & Tricks
201-
- Project checkouts are in the parent directory (`../`).
202-
- use the "gh" cli to interact with GitHub

CLAUDE.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Playwright Java
2+
3+
The Java client is a port of the JavaScript client in `../playwright/packages/playwright-core/src/client/`. When implementing or changing a method, read the corresponding JS file first and mirror its logic.
4+
5+
Project checkouts (including the upstream `playwright` repo) live in the parent directory (`../`). Use the `gh` cli to interact with GitHub.
6+
7+
## Commit Convention
8+
9+
Semantic commit messages: `label(scope): description`
10+
11+
Labels: `fix`, `feat`, `chore`, `docs`, `test`, `devops`
12+
13+
```bash
14+
git checkout -b fix-39562
15+
# ... make changes ...
16+
git add <changed-files>
17+
git commit -m "$(cat <<'EOF'
18+
fix(proxy): handle SOCKS proxy authentication
19+
20+
Fixes: https://github.com/microsoft/playwright-java/issues/39562
21+
EOF
22+
)"
23+
# **Never `git push` without an explicit instruction to push.**
24+
git push origin fix-39562
25+
gh pr create --repo microsoft/playwright-java --head <user>:fix-39562 \
26+
--title "fix(proxy): handle SOCKS proxy authentication" \
27+
--body "$(cat <<'EOF'
28+
## Summary
29+
- <describe the change very! briefly>
30+
31+
Fixes https://github.com/microsoft/playwright-java/issues/39562
32+
EOF
33+
)"
34+
```
35+
36+
Never add Co-Authored-By agents in commit message.
37+
Never add "Generated with" in commit message.
38+
Never add test plan to PR description. Keep PR description short — a few bullet points at most.
39+
Branch naming for issue fixes: `fix-<issue-number>`.
40+
41+
**Never amend commits.** Always create a new commit for follow-up changes, even when iterating on an open PR. Amending rewrites history and forces a force-push, losing the incremental review trail. Only amend if the user explicitly says so.
42+
43+
**Never `git push` without an explicit instruction to push.** Applies even when a PR is already open for the branch — additional commits are immediately visible to reviewers. Commit locally, report what was committed, and wait. Only push when the user's message contains "push", "upload", "create PR", "ship it", or equivalent.
44+
45+
## Skills
46+
47+
- **playwright-roll** (`.claude/skills/playwright-roll/SKILL.md`) — roll Playwright Java to a new upstream version: bump the driver, regenerate the API, and port relevant upstream changes.
48+
- **playwright-java-release** (`.claude/skills/playwright-java-release/SKILL.md`) — prepare a release after the rolling PR merges: cut the release branch, mark the Maven version, and draft the GitHub release.

0 commit comments

Comments
 (0)