| name | oracle |
| description | Use when the user asks the oracle for an answer — "ask the oracle", "give me a fortune", "answer of the day", a yes/no or "should I…" wish, or 求签 / 抽一签 / 答案机 / 今日答案 — or runs /oracle:oracle. Draws one random, playful, encouraging line from a pre-written bilingual pool (Chinese / English); the draw is random and independent of the question asked. |
oracle 🔮 — Answer Oracle
Draw one random line as the user's "answer of the day." This is a fortune cookie:
the answer is picked at random from a pre-written pool and is independent of whatever
the user asked. The question (if any) is ritual only — never read it to craft the answer.
Inputs
The user may invoke it bare (/oracle), with a forced language (/oracle zh,
/oracle en), or with a question (/oracle should I quit?, /oracle 我该辞职吗).
Step 1 — Pick the bank (language)
Walk this ladder, stop at the first match:
- Forced: the argument is exactly
zh or en → use that bank (don't treat it as a question).
- Question language: there is a question argument → if it contains any Chinese
(CJK) character, use
zh; otherwise en.
- Conversation language: bare
/oracle → use the language this conversation has
been happening in.
- System fallback: still unsure (brand-new conversation, first thing typed) → run
case "$LANG" in zh*) echo zh ;; *) echo en ;; esac.
The language only chooses the bank. It never chooses the line.
Step 2 — Draw one line (truly random — do NOT pick yourself)
Run exactly one shell command. Set LANG_CODE to zh or en from Step 1:
d="${CLAUDE_PLUGIN_ROOT}/skills/oracle"
[ -f "$d/answers-en.txt" ] || d="$HOME/.claude/skills/oracle"
[ -f "$d/answers-en.txt" ] || d="$(pwd)/skills/oracle"
[ -f "$d/answers-en.txt" ] || d="$(pwd)"
shuf -n 1 "$d/answers-${LANG_CODE}.txt" 2>/dev/null \
|| awk -v seed="$RANDOM" 'BEGIN{srand(seed)} NF{a[++n]=$0} END{print a[int(rand()*n)+1]}' "$d/answers-${LANG_CODE}.txt"
The answer files ship beside this skill; ${CLAUDE_PLUGIN_ROOT} points at the installed
plugin root, and the fallbacks cover a manual copy or running from the repo. shuf is
preferred; the awk branch is the fallback when shuf is missing (common on macOS),
seeded with $RANDOM rather than the clock so draws in the same second don't repeat,
with the NF guard skipping blank lines. Use the command's output verbatim — never
substitute your own choice.
Step 3 — Present it
Open with the crystal ball, then the drawn line as a blockquote. If the user gave a
question, echo it first for ritual (but the answer is unrelated to it).
English:
🔮 You give the crystal ball a shake…
> <the drawn line>
Chinese:
🔮 你摇了摇水晶球…
> <抽到的那句>
Keep it to the opener + the line. No explaining, no "this means…", no choosing a
"better" line. The whole charm is that it's random.