config/ai/claude/claudecode/skills/zsh-writer/SKILL.md
Use when writing or modifying ZSH functions.
npx skillsauth add pixelastic/oroshi zsh-writerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Write ZSH code that is consistent with my conventions.
Goal: Correct path and name.
Exit criterion: File exists at correct path with correct name.
config/term/zsh/functions/autoload/{domain}/{subdomain?}/{name}scripts/bin/{domain}/{subdomain?}/{name}{domain}-{subdomain?}-{action} — e.g. git-branch-list, json-lint-raw suffix → machine-readable ▮-separated output, consumed by other scriptsGoal: Code follows all patterns.
Exit criterion: Checklist passes.
Write code that follows the following patterns:
| Pattern | Rule |
|---|---|
| Headers | Top of the file: what the script does, how to call it and error protection |
| Args Parsing | Use zmodload zsh/zutil + zparseopts -E -D to parse args |
| Variables | local myVar="$(myCommand)" on one line |
| Modifiers | Prefer zsh modifiers (${filepath:t}) over commands ($(basename "$filepath")) |
| Splitting | Use ▮ as separator and ${(@ps/▮/)line} to split |
| Loops | Use for rawLine in ${(f)rawOutput} instead of while read and IFS |
| Conditions | [[ simpleCondition ]] && state=value. No nested if/else, return early, no -z/-n |
| Calling Commands | Use existing helpers (git-branch-current), not raw calls. Use --long-form, not -l. |
# Show changed files with syntax-aware coloring
# Usage:
# $ git-diff-colorize # Unstaged changes
# $ git-diff-colorize --staged # Staged only
# $ git-diff-colorize --ext ts # Filter by extension
setopt local_options errexit
MAX_RESULTS=50
zmodload zsh/zutil
zparseopts -E -D \
s=flagStaged \
-staged=flagStaged \
e:=flagExt \
-ext:=flagExt
local isStaged=${#flagStaged}
local extFilter=${flagExt[2]}
local helperArgs=()
[[ $isStaged == 1 ]] && helperArgs+=(--staged)
[[ "$extFilter" != "" ]] && helperArgs+=(--ext "$extFilter")
local rawFiles="$(git-diff-list-raw "${helperArgs[@]}")"
# Nothing to display if working tree is clean
[[ "$rawFiles" == "" ]] && return 0
local output=""
for rawLine in ${(f)rawFiles}; do
local fields=(${(@ps/▮/)rawLine})
local name=$fields[1]
local dir=$fields[2]
local ext=$fields[3]
local parentDir="${dir:t}" # zsh modifier: last path component
local color=$COLOR_DEFAULT
[[ "$ext" == "ts" ]] && color=$COLOR_FILE_TS
[[ "$ext" == "zsh" ]] && color=$COLOR_FILE_ZSH
output+="$(colorize "$name" $color)▮$parentDir▮$ext\n"
done
table $output
Run zshlint <file> on the file and fix any actionable violation.
If a .bats test file exists for this script, run bats <test-file>. All tests must pass.
zshlintandbatsare both in PATH — call them directly, no full path needed.
| Rationalization | Reality |
|---|---|
| "local exits 0, I need it on its own line | No, I want local myVar="$(myCommand)" even if myCommand could fail |
| "while read is fine for simple cases" | Never. ${(f)var} always. |
| "It's only two levels of if/else, it's ok." | No it's not. Return early, always. |
zparseopts for all flag parsinglocal; script constants UPPER_CASE without localwhile read — only ${(f)var} or "${(@f)var}"git-branch-list-raw not git branch)tools
Turn the current conversation context into a PRD and publish it to the project issue tracker. Use when user wants to create a PRD from the current context.
tools
Break a plan, spec, or PRD into independently-grabbable issues using tracer-bullet vertical slices. Use when user wants to convert a plan into issues, create implementation tickets, or break down work into issues.
documentation
Use when user says "sidequest" or "handoff" — compact conversation context into a document for a fresh agent to pick up.
development
Use when the user wants to nail down domain terms, resolve terminology ambiguities, or build a shared language for a module or repo. Drills vocabulary one question at a time and writes to the project GLOSSARY.md.