| name | core-commands |
|---|---|
| description | Core command guidelines - prohibited commands and temp file patterns. ALWAYS load this skill at session start. |
This skill defines prohibited commands and the temp file pattern for multi-line content.
Check if the command starts with a prohibited prefix:
- Does it start with
git? → Find jj equivalent in table below - Does it start with
jj log? → Usejj statusinstead - Does it start with
jj op? → Not allowed, ask user - Does it start with
jj abandon? → Usejj newinstead - Does it start with
jj edit? → Not allowed, usejj newinstead - Does it start with
jj prevorjj next? → Ask user first - Does it have
-iflag? → Not allowed (interactive) - Does
jj newhave any arguments? → Not allowed, use plainjj newonly
NEVER use git commands. This repo uses jj exclusively.
Prohibition is prefix-based: Commands matching the start of a prohibited pattern are forbidden (e.g., jj log -r 'all()' matches jj log*).
jj abandon*- Do not abandon changesjj describebefore changes are ready and reviewedjj edit*- Moves working copy unexpectedly, usejj newinsteadjj git pushwithout explicit user confirmationjj log*- Produces incoherent outputjj newwith any arguments - Only plainjj newallowedjj op*- Operations commands not allowedjj prev*/jj next*- Navigation requires user confirmationjj rebase*- Can break change dependenciesjj squash*- Violates atomic commit historyjj split*- Breaks atomicity- Interactive commands with
-iflag
- Update git config
- Run destructive commands without explicit request
- Skip hooks without explicit request
- Commit without explicit request
- Push without explicit confirmation
- Commit secrets or credentials
- Expose or log secrets
| Prohibited Pattern | Why | Use Instead |
|---|---|---|
jj log* |
Incoherent output | jj status or jj op log |
jj op* |
Not allowed | jj status or ask user |
jj abandon* |
Destructive | Create new change with jj new |
jj prev* / jj next* |
Needs confirmation | Ask user first |
git status |
Wrong VCS | jj status |
git branch* |
Wrong VCS | jj bookmark list |
git checkout* |
Wrong VCS | jj new |
git commit* |
Wrong VCS | jj describe |
git push* |
Wrong VCS | jj git push (with confirmation) |
git pull* |
Wrong VCS | jj git fetch |
git merge* |
Wrong VCS | jj merge or rebase approach |
git rebase* |
Wrong VCS | Use jj's automatic rebasing |
NEVER use heredocs (cat <<'EOF') or echo for multi-line content.
These patterns have escaping issues and produce unreliable output.
ALWAYS use the mktemp + Write tool pattern:
Each Bash tool invocation runs in an independent shell environment. Variables set in one command do NOT persist to subsequent commands. Therefore:
-
Get temp file path - Run
mktemp -p "$PWD"without variable assignment:mktemp -p "$PWD"The tool returns a path like
/path/to/repo/tmp.XXXXXX. -
Write content - Use the Write tool with the path from step 1 as a literal string.
-
Pass file to command - Use the same path as a literal string:
<command> --option "/path/to/repo/tmp.XXXXXX"
-
Clean up - Remove the file when done:
rm "/path/to/repo/tmp.XXXXXX"
Key insight: The temp file path must be captured from the tool output and used as a literal string in all subsequent commands. Do NOT use shell variables.
Creating GitHub issue:
mktemp -p "$PWD"
# Tool returns: /path/to/repo/tmp.XXXXXX
# Use Write tool to write issue description to /path/to/repo/tmp.XXXXXX
gh issue new -t 'Issue title' -F "/path/to/repo/tmp.XXXXXX"
rm "/path/to/repo/tmp.XXXXXX"Describing commit with complex message:
mktemp -p "$PWD"
# Tool returns: /path/to/repo/tmp.XXXXXX
# Use Write tool to write commit message to /path/to/repo/tmp.XXXXXX
jj describe --stdin < "/path/to/repo/tmp.XXXXXX"
rm "/path/to/repo/tmp.XXXXXX"Creating PR:
mktemp -p "$PWD"
# Tool returns: /path/to/repo/tmp.XXXXXX
# Use Write tool to write PR description to /path/to/repo/tmp.XXXXXX
gh pr create --draft --base main --head username/issue-123 --title "PR title" -F "/path/to/repo/tmp.XXXXXX"
rm "/path/to/repo/tmp.XXXXXX"- Heredocs fail when content contains special characters, variables, or nested quotes
- echo fails with backslashes and special characters
- Write tool handles all escaping correctly and consistently