Gemini CLI port of /thrift — cost-conscious long-session optimisation. Patches ~/.gemini/settings.json hooks (BeforeTool/AfterTool/SessionStart) with thrift telemetry + Vertex prompt-cache priming (minimum-token gated, storage-time aware) + gemini-flash summariser advisory. See plugins/harness-thrift/skills/thrift/SKILL.md for source-of-truth.
How this skill is triggered — by the user, by Claude, or both
Slash command
/harness-thrift-gemini:thrift-geminiThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Bootstraps cost-conscious patterns in the current project for the **Gemini
lib/config-loader.mjslib/cost-estimator.mjslib/settings-patcher.mjslib/vertex-cache-eval.mjsphases/0-preflight.mdphases/1-config.mdphases/2-instrument.mdphases/3-summariser.mdphases/4-cache-prime.mdphases/5-audit.mdreferences/porting-notes.mdtemplates/audit-report.md.hbstemplates/hooks/thrift-aftertool-summariser-trigger.mjs.hbstemplates/hooks/thrift-beforetool-bash-telemetry.mjs.hbstemplates/hooks/thrift-beforetool-read-coerce.mjs.hbstemplates/hooks/thrift-sessionstart-cache-prime.mjs.hbstemplates/thrift.config.json.hbsBootstraps cost-conscious patterns in the current project for the Gemini
CLI. Reads .thrift.json (or seeds it), patches
~/.gemini/settings.json with BeforeTool / AfterTool / SessionStart
hook arrays, and starts a Vertex cache-prime + AfterTool summariser-trigger
loop.
/thrift-gemini # one-time setup; idempotent
/thrift-gemini summarise # manual summariser trigger
/thrift-gemini audit # write audit report now
/thrift-gemini --force # re-seed .thrift.json
--force — overwrite existing .thrift.json.--no-instrument — skip the settings.json patch (just seed config).--dry-run — print what would be patched; don't write.| Phase | File | Purpose |
|---|---|---|
| 0 | phases/0-preflight.md | detect context-mode-gemini + Gemini CLI + BeforeTool surface + Vertex tier |
| 1 | phases/1-config.md | seed/load .thrift.json + compute thresholds (incl. Vertex min-token) |
| 2 | phases/2-instrument.md | patch ~/.gemini/settings.json (append-only to hook arrays) |
| 3 | phases/3-summariser.md | summarise current window via gemini-flash (manual OR auto) |
| 4 | phases/4-cache-prime.md | Vertex context caching, ROI-gated by minTokenThreshold + tier |
| 5 | phases/5-audit.md | write end-of-session audit (Vertex rates + storage-time cost) |
~/.gemini/settings.json hooks.{BeforeTool,AfterTool,SessionStart}.
Use thrift- command-path sentinel for safe revert..thrift.json cache.enabled = true.cache.vertex.tier === "free" the ROI gate
refuses to prime regardless of cache.enabled. Free-tier rate limits
make priming counterproductive./compress (Gemini's compact equivalent). v2 will be programmatic
once Gemini exposes a compact API.SessionEnd; we infer end via next SessionStart or via
/thrift-gemini audit manual invocation).lib/config-loader.mjs — loadConfig(path) → {ok, config | errors, warning?}. Same shape as CC version + cache.vertex block.lib/cost-estimator.mjs — estimate({...}) with Vertex/Gemini rate table; cache-read + cache-write + storage-time terms.lib/settings-patcher.mjs — patches ~/.gemini/settings.json (nested JSON hooks.<event>[] arrays). Append-only, sentinel-revert.lib/vertex-cache-eval.mjs — Vertex-specific ROI gate (minTokenThreshold check + storageTime payback period + free-tier short-circuit)..thrift.json invalid → abort with field-level errors..thrift-state.json; user can retry.Print:
Thrift audit: <duration> session, <turns> turns, $<actual> actual vs $<baseline> baseline (saved <%>).
Vertex storage spend: $<storage> ({{storageHours}}h)
Report: <output-path>
| Action | Gemini |
|---|---|
| Hook event names | BeforeTool / AfterTool / SessionStart (no SessionEnd) |
| Hook file | ~/.gemini/settings.json (single JSON, not per-event TOML/YAML) |
| Compact equivalent | /compress slash command |
| Summariser model | gemini-flash (cheapest Gemini family) |
| Cache surface | Vertex context caching — min-token gated, storage-time billed |
| Tier check | gemini auth list (future) OR cache.vertex.tier config (v1) |
references/porting-notes.md — phase-by-phase deltas vs CCplugins/harness-thrift/skills/thrift/SKILL.md — source-of-truthdocs/superpowers/specs/2026-05-18-harness-thrift-per-platform-decomposition.md — Gemini sectionProvides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
npx claudepluginhub kim-song-jun/agent-skill --plugin harness-thrift-gemini