Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
371 changes: 371 additions & 0 deletions .agents/skills/resolve-coderabbit-feedback/SKILL.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .changeset/one-package.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ import { Aurora, ShaderScene } from '@camp-dev/shaders'

`@camp-dev/shaders/color` is unchanged. `@camp-dev/shaders-react/gamut` is now `@camp-dev/shaders/gamut`, and `@camp-dev/shaders-react/poster` is now `@camp-dev/shaders/poster`. Peer dependencies are `react ^19` and `three ^0.170`.

Components are no longer copied into your project. If you added one with `shaders-cli add`, delete the copied file and import the component from the package instead. The `shaders-cli` commands `init`, `add`, `list`, and `update` are retired in a following release; `poster` stays.
Components are no longer copied into your project. If you added one with `shaders-cli add`, delete the copied file and import the component from the package instead. The `shaders-cli` commands `init`, `add`, `list`, and `update` are retired in this release too; `poster` stays.
28 changes: 19 additions & 9 deletions .claude/skills/resolve-coderabbit-feedback/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,15 @@ git status --porcelain
If that prints anything, stash it. Let a failed stash stop the run instead of swallowing the error:

```bash
STASH_BEFORE=$(git stash list | head -1)
STASH_BEFORE=$(git rev-parse -q --verify refs/stash || true)
git stash push -m "resolve-coderabbit-feedback: stash before work" --include-untracked
STASH_AFTER=$(git stash list | head -1)
STASH_AFTER=$(git rev-parse -q --verify refs/stash || true)
[ "$STASH_BEFORE" != "$STASH_AFTER" ] && STASH_CREATED=true || STASH_CREATED=false
git status --porcelain
```

Compare the stash ref's object id, never the `git stash list` line. That line is `stash@{0}: On <branch>: <message>`, so a stash left by an earlier run on the same branch reads identically before and after, the flag stays false, and Step 10 then leaves the user's work hidden in the stash.

If `git stash push` exits non-zero, or the second `git status --porcelain` still prints anything, stop and tell the user. Never edit over a dirty tree.

Now get onto the PR branch. If `START_REF` already equals `HEAD_BRANCH`, run `git fetch origin` and compare the local branch against its remote. If the remote is ahead, ask whether to pull before proceeding, and leave `BRANCH_SWITCHED` false.
Expand Down Expand Up @@ -115,7 +117,7 @@ gh api graphql --paginate -f query='
id
isResolved
isOutdated
comments(first: 20) {
comments(first: 100) {
nodes {
databaseId
body
Expand All @@ -135,7 +137,7 @@ gh api graphql --paginate -f query='
' -f owner="$OWNER" -f name="$NAME" -F pr="$PR_NUMBER"
```

**Paginate this query.** `first: 100` counts resolved threads too, so on a PR that has been through several review rounds the unresolved findings can sit outside the first page. `--paginate` needs all three pieces above: the `$endCursor` variable, the `after:` argument, and the `pageInfo` fields. It walks one connection only, which is why `comments(first: 20)` stays unpaginated. That is fine here, because only the first comment in a thread is CodeRabbit's finding.
**Paginate this query.** `first: 100` counts resolved threads too, so on a PR that has been through several review rounds the unresolved findings can sit outside the first page. `--paginate` needs all three pieces above: the `$endCursor` variable, the `after:` argument, and the `pageInfo` fields. It walks one connection only, which is why `comments(first: 100)` stays unpaginated. 100 is GitHub's page maximum, and Step 10 reads that list for earlier replies, so keep it at the maximum rather than trimming it to the first comment.

Keep the threads whose first comment has an author login of `coderabbitai`, and drop every thread where `isResolved` is true.

Expand Down Expand Up @@ -262,13 +264,15 @@ Then run the checks that cover the change:
```bash
pnpm typecheck
pnpm lint
pnpm test --filter <touched package>
pnpm exec turbo run test --filter <touched package>
```

Call turbo directly for the scoped test. `pnpm test --filter <pkg>` happens to work at this root only because pnpm forwards the flag to the `turbo run test` script, and `pnpm --filter <pkg> test` runs the package's Vitest with no build first, which the dist trap below is about. The explicit turbo call keeps the build-before-test ordering.

Four repo traps apply here:

- If a fix changed source under `packages/shaders` or `packages/shaders-react`, run `pnpm --filter @camp-dev/shaders build`. The docs site consumes `dist`, so an unbuilt fix looks like no fix at all.
- If a fix changed a dependency in any `package.json`, commit the updated `pnpm-lock.yaml` with it, and check that the lockfile still pins `node@runtime` at `version: 22.22.2` with `hasBin: true`. Every pnpm resolution step rewrites that entry to `0.0.0`, and CI then dies at install in every job.
- If a fix changed source under `packages/shaders`, the dev servers pick it up as source, but the apps' Vitest runs resolve the package through `dist`. Run `pnpm --filter @camp-dev/shaders build` before trusting an app test result.
- If a fix changed a dependency in any `package.json`, commit the updated `pnpm-lock.yaml` with it, and check that the lockfile's `node@runtime:22.22.2` entry still names 22.22.2 and keeps its `variations` block. A pnpm resolution step can degrade that entry, and CI then dies at install in every job.
- Never run `pnpm snap` as part of this workflow. Ask first. It needs Docker and Node 22, it takes a long time, and it corrupts a running docs or editor dev server.
- If you ran Playwright or `pnpm snap` for any reason, tell the user to restart the dev server before trusting the browser. The procedure is in `AGENTS.md` under the environment gotchas.

Expand Down Expand Up @@ -339,14 +343,20 @@ gh api graphql -f query='

Findings from Source 2 have no thread to resolve, so cover them in the summary instead.

Restore the starting state if Step 2 changed it:
Restore the starting state if Step 2 changed it. Whether that is safe depends on the worktree, not on which step you reached, so check the tree first:

```bash
git status --porcelain
```

If that prints nothing, the tree is clean. That is the success path, a Step 6 cancel, and any failure that struck before Step 7 edited a file, or after Step 9 committed. Restore:

```bash
git checkout "$START_REF"
[ "$STASH_CREATED" = "true" ] && git stash pop
```

**On a failure before Step 9's commit, the run's own edits are still in the tree.** Checking out the same ref does not remove them, and the same-branch path checks nothing out at all. Never discard them on the user's behalf, and never hand over a command that rewrites the worktree wholesale. Report the three kinds of leftover separately, because each needs a different answer:
**If it prints anything, the run's own edits are still in the tree, so skip the checkout.** That is a failure between Step 7's first edit and Step 9's commit. Git refuses to switch branches when uncommitted edits touch files that differ between the two refs, which is the normal case here because the PR branch changed those files. A refused checkout leaves you on the PR branch while the report claims the start ref was restored. Stay on the PR branch, say plainly that it was not restored and why, and leave the stash alone, because popping it onto the PR branch would mix the user's work into the run's leftovers. Never discard the edits on the user's behalf, and never hand over a command that rewrites the worktree wholesale. Report the three kinds of leftover separately, because each needs a different answer:

```bash
git diff --stat "$WORK_BASE" # tracked edits since work began
Expand Down
Loading
Loading