{"skill":{"slug":"oracle","displayName":"Oracle","summary":"Use the @steipete/oracle CLI to bundle a prompt plus the right files and get a second-model review (API or browser) for debugging, refactors, design checks, or cross-validation.","description":"---\nname: oracle\ndescription: Use the @steipete/oracle CLI to bundle a prompt plus the right files and get a second-model review (API or browser) for debugging, refactors, design checks, or cross-validation.\n---\n\n# Oracle (CLI) — best use\n\nOracle bundles your prompt + selected files into one “one-shot” request so another model can answer with real repo context (API or browser automation). Treat outputs as advisory: verify against the codebase + tests.\n\n## Main use case (browser, GPT‑5.2 Pro)\n\nDefault workflow here: `--engine browser` with GPT‑5.2 Pro in ChatGPT. This is the “human in the loop” path: it can take ~10 minutes to ~1 hour; expect a stored session you can reattach to.\n\nRecommended defaults:\n- Engine: browser (`--engine browser`)\n- Model: GPT‑5.2 Pro (either `--model gpt-5.2-pro` or a ChatGPT picker label like `--model \"5.2 Pro\"`)\n- Attachments: directories/globs + excludes; avoid secrets.\n\n## Golden path (fast + reliable)\n\n1. Pick a tight file set (fewest files that still contain the truth).\n2. Preview what you’re about to send (`--dry-run` + `--files-report` when needed).\n3. Run in browser mode for the usual GPT‑5.2 Pro ChatGPT workflow; use API only when you explicitly want it.\n4. If the run detaches/timeouts: reattach to the stored session (don’t re-run).\n\n## Commands (preferred)\n\n- Show help (once/session):\n  - `npx -y @steipete/oracle --help`\n\n- Preview (no tokens):\n  - `npx -y @steipete/oracle --dry-run summary -p \"<task>\" --file \"src/**\" --file \"!**/*.test.*\"`\n  - `npx -y @steipete/oracle --dry-run full -p \"<task>\" --file \"src/**\"`\n\n- Token/cost sanity:\n  - `npx -y @steipete/oracle --dry-run summary --files-report -p \"<task>\" --file \"src/**\"`\n\n- Browser run (main path; long-running is normal):\n  - `npx -y @steipete/oracle --engine browser --model gpt-5.2-pro -p \"<task>\" --file \"src/**\"`\n\n- Manual paste fallback (assemble bundle, copy to clipboard):\n  - `npx -y @steipete/oracle --render --copy -p \"<task>\" --file \"src/**\"`\n  - Note: `--copy` is a hidden alias for `--copy-markdown`.\n\n## Attaching files (`--file`)\n\n`--file` accepts files, directories, and globs. You can pass it multiple times; entries can be comma-separated.\n\n- Include:\n  - `--file \"src/**\"` (directory glob)\n  - `--file src/index.ts` (literal file)\n  - `--file docs --file README.md` (literal directory + file)\n\n- Exclude (prefix with `!`):\n  - `--file \"src/**\" --file \"!src/**/*.test.ts\" --file \"!**/*.snap\"`\n\n- Defaults (important behavior from the implementation):\n  - Default-ignored dirs: `node_modules`, `dist`, `coverage`, `.git`, `.turbo`, `.next`, `build`, `tmp` (skipped unless you explicitly pass them as literal dirs/files).\n  - Honors `.gitignore` when expanding globs.\n  - Does not follow symlinks (glob expansion uses `followSymbolicLinks: false`).\n  - Dotfiles are filtered unless you explicitly opt in with a pattern that includes a dot-segment (e.g. `--file \".github/**\"`).\n  - Hard cap: files > 1 MB are rejected (split files or narrow the match).\n\n## Budget + observability\n\n- Target: keep total input under ~196k tokens.\n- Use `--files-report` (and/or `--dry-run json`) to spot the token hogs before spending.\n- If you need hidden/advanced knobs: `npx -y @steipete/oracle --help --verbose`.\n\n## Engines (API vs browser)\n\n- Auto-pick: uses `api` when `OPENAI_API_KEY` is set, otherwise `browser`.\n- Browser engine supports GPT + Gemini only; use `--engine api` for Claude/Grok/Codex or multi-model runs.\n- **API runs require explicit user consent** before starting because they incur usage costs.\n- Browser attachments:\n  - `--browser-attachments auto|never|always` (auto pastes inline up to ~60k chars then uploads).\n- Remote browser host (signed-in machine runs automation):\n  - Host: `oracle serve --host 0.0.0.0 --port 9473 --token <secret>`\n  - Client: `oracle --engine browser --remote-host <host:port> --remote-token <secret> -p \"<task>\" --file \"src/**\"`\n\n## Sessions + slugs (don’t lose work)\n\n- Stored under `~/.oracle/sessions` (override with `ORACLE_HOME_DIR`).\n- Runs may detach or take a long time (browser + GPT‑5.2 Pro often does). If the CLI times out: don’t re-run; reattach.\n  - List: `oracle status --hours 72`\n  - Attach: `oracle session <id> --render`\n- Use `--slug \"<3-5 words>\"` to keep session IDs readable.\n- Duplicate prompt guard exists; use `--force` only when you truly want a fresh run.\n\n## Prompt template (high signal)\n\nOracle starts with **zero** project knowledge. Assume the model cannot infer your stack, build tooling, conventions, or “obvious” paths. Include:\n- Project briefing (stack + build/test commands + platform constraints).\n- “Where things live” (key directories, entrypoints, config files, dependency boundaries).\n- Exact question + what you tried + the error text (verbatim).\n- Constraints (“don’t change X”, “must keep public API”, “perf budget”, etc).\n- Desired output (“return patch plan + tests”, “list risky assumptions”, “give 3 options with tradeoffs”).\n\n### “Exhaustive prompt” pattern (for later restoration)\n\nWhen you know this will be a long investigation, write a prompt that can stand alone later:\n- Top: 6–30 sentence project briefing + current goal.\n- Middle: concrete repro steps + exact errors + what you already tried.\n- Bottom: attach *all* context files needed so a fresh model can fully understand (entrypoints, configs, key modules, docs).\n\nIf you need to reproduce the same context later, re-run with the same prompt + `--file …` set (Oracle runs are one-shot; the model doesn’t remember prior runs).\n\n## Safety\n\n- Don’t attach secrets by default (`.env`, key files, auth tokens). Redact aggressively; share only what’s required.\n- Prefer “just enough context”: fewer files + better prompt beats whole-repo dumps.\n","tags":{"latest":"1.0.1"},"stats":{"comments":0,"downloads":18017,"installsAllTime":1161,"installsCurrent":1157,"stars":16,"versions":2},"createdAt":1767545370678,"updatedAt":1779137311659},"latestVersion":{"version":"1.0.1","createdAt":1767652013275,"changelog":"","license":null},"metadata":null,"owner":{"handle":"steipete","userId":"s179zksw999xz8ms4cy7pb2fr183m5jq","displayName":"Peter Steinberger","image":"https://avatars.githubusercontent.com/u/58493?v=4"},"moderation":null}