Avoid trunk() in jj skills to prevent permission prompts
Claude Code's shell parser treats parentheses as subshell syntax
even when quoted, triggering permission prompts. Use main@origin
(the typical resolved value) directly instead.
Assisted-by: Claude Opus 4.6 (1M context) via Claude Code
diff --git a/ai/skills/jj/SKILL.md b/ai/skills/jj/SKILL.md
index f1aa5743..761a9c04 100644
--- a/ai/skills/jj/SKILL.md
+++ b/ai/skills/jj/SKILL.md
@@ -72,14 +72,19 @@ jj restore --from kn --into kn FILE # restore file in a specific revision
## Common Pitfalls
-**Quote revsets containing parentheses.** Bash interprets `()` as subshell
-syntax:
+**Avoid revset functions with parentheses.** Claude Code's shell
+command parser treats `()` as subshell syntax even when quoted, which
+triggers permission prompts. Use the underlying value directly:
```bash
-jj log -r 'trunk()' # correct
-jj log -r trunk() # WRONG — bash syntax error
+jj log -r main@origin # correct — no parens
+jj log -r 'trunk()' # WRONG — triggers permission prompt
```
+`trunk()` usually resolves to `main@origin` but depends on the repo's
+config. Check `jj config get revset-aliases."trunk()"` if unsure.
+Prefer the resolved value (e.g., `main@origin`) everywhere.
+
**`jj show` does not accept path arguments.** It takes an optional revision
but cannot be scoped to a path. Use `jj diff` instead:
diff --git a/ai/skills/pr/SKILL.md b/ai/skills/pr/SKILL.md
index b04cc9d5..1d34e3f0 100644
--- a/ai/skills/pr/SKILL.md
+++ b/ai/skills/pr/SKILL.md
@@ -23,8 +23,8 @@ Revision must be provided (bookmark, change ID, revset, or commit hash). The rev
1. Gather context for the PR:
- Run `jj log -r '<revision>' --no-graph` to check for existing bookmarks
- - Run `jj log -r 'trunk()..<revision>'` to list commits between trunk and the revision
- - Run `jj diff --from trunk() --to <revision> --stat` to review all changes
+ - Run `jj log -r 'main@origin..<revision>'` to list commits between trunk and the revision
+ - Run `jj diff --from main@origin --to <revision> --stat` to review all changes
2. Push revision and get bookmark name:
- If revision has a remote-tracked bookmark: `jj git push --bookmark <name>`
- If revision has a local-only bookmark (no `@origin`): push with
@@ -77,7 +77,7 @@ Revision must be provided (bookmark, change ID, revset, or commit hash). The rev
- Follow repository conventions
9. **Code review**: Dispatch the `superpowers:code-reviewer` subagent to review
the changes. Tell the reviewer to run
- `jj diff --from trunk() --to <revision>` to get the actual commit diff—do
+ `jj diff --from main@origin --to <revision>` to get the actual commit diff—do
not let it grep or read the working directory, which may be on a different
revision. Provide a brief description of what was implemented. Address
Critical and Important issues before proceeding; Minor issues can be noted