Gemini CLI Playbook

Use Gemini as a parallel teammate for research, validation, and orchestration. This page shows how to connect the toolkit to the Gemini CLI.

Provision Gemini for the toolkit

  1. Install Gemini CLI using the official quickstart (or the bundled terminal guide) and authenticate with your API key.
  2. Clone (or symlink) AI-toolkit/ into the project root so relative paths work in every command.
  3. Export helper env vars in your shell profile:
    export GEMINI_TOOLKIT=$PWD/AI-toolkit
    export GEMINI_OUTPUT_DIR=$PWD/.gemini
    mkdir -p "$GEMINI_OUTPUT_DIR"
  4. Copy the Gemini briefing template from the toolkit docs bundle into the repo root and skim it before every large engagement to refresh context.
  5. Smoke test with gemini chat "ready for the toolkit" and verify the CLI reads files from $GEMINI_TOOLKIT.
Keep a dedicated virtualenv or uv project for Gemini tooling so dependencies (markdown parsing, jq, yq) are isolated from application code.

Start a new project with Gemini

  1. Run gemini prompt --file $GEMINI_TOOLKIT/prompts/create_brief.md < brief.txt to generate a north-star summary and share it with Claude.
  2. Call gemini agent --file $GEMINI_TOOLKIT/agents/orchestration/tech-lead-orchestrator.md with your story description to obtain a cross-tool execution plan.
  3. Populate a research log (for example notes/research.md) by piping web results through general-research-agent.md.
  4. Before shipping code, run gemini prompt --file $GEMINI_TOOLKIT/prompts/code_review.md --input git.diff so Gemini highlights risky chunks you should verify in Claude.
  5. Finish the cycle with gemini prompt --file $GEMINI_TOOLKIT/prompts/write_docs.md and paste the bundle into /project:session-end.

Recover context on a legacy project

High-leverage Gemini agents

ScenarioAgent commandOutput to expect
Backend/API deep divegemini agent --file $GEMINI_TOOLKIT/agents/frameworks/django/django-api-developer.md --input context.mdEndpoint scaffolds, serializer advice, integration checklist.
Security or compliance reviewgemini agent --file $GEMINI_TOOLKIT/agents/quality/security-auditor.md --files src/Severity-ranked findings with remediation steps.
Frontend alignmentgemini agent --file $GEMINI_TOOLKIT/agents/frameworks/react/react-component-architect.md --input component-spec.mdComponent breakdown, state strategy, accessibility cues.
Performance troubleshootinggemini agent --file $GEMINI_TOOLKIT/agents/quality/performance-optimizer.md --input flamegraph.txtHotspot analysis and next profiling actions.
Team workflow guardrailsgemini agent --file $GEMINI_TOOLKIT/agents/root/reliability-commander.md --input readiness.mdGo/no-go checklist and process gaps.

Capture agent output to $GEMINI_OUTPUT_DIR/<timestamp>-agent.md so you can attach the evidence to tickets or pull requests.

Run multi-agent chains with Gemini

  1. Generate the orchestration: gemini agent --file $GEMINI_TOOLKIT/agents/orchestration/tech-lead-orchestrator.md --input epic.md to produce a phase map that lists downstream agents and expected artefacts.
  2. Plan the team topology: Feed the orchestrator output into team-configurator.md so you know which agent hands over to whom and what evidence is required.
  3. Execute sequentially: For each phase, pipe the previous agent’s summary into the next command, e.g. gemini agent --file $GEMINI_TOOLKIT/agents/frameworks/django/django-api-developer.md --input plan-phase1.md.
  4. Agent-controlled automation: When Gemini recommends calling another agent, capture its instructions with session-closer.md or a custom handoff template, then feed that file to the next command.
  5. Audit the chain: After the specialists, run reliability-commander.md and testing-expert.md to validate readiness, then append their output to the Claude session log for shared visibility.
Store each agent’s output in $GEMINI_OUTPUT_DIR/chain/<step>.md. You can replay or resume the sequence by reusing those artefacts as inputs.

Sample scenario: incident response research

  1. Prompt & brief: Start with gemini prompt --file $GEMINI_TOOLKIT/prompts/create_brief.md --input incident.md to capture severity, affected services, and stakeholders. Share the brief within Claude.
  2. Agent orchestration: Use tech-lead-orchestrator.md to lay out the chain (project-analyst → reliability-commander → testing-expert) and run team-configurator.md to document roles.
  3. Deep dives: Pipe log extracts into project-analyst.md, run reliability-commander.md for mitigation checklists, then let testing-expert.md design regression tests. Save outputs to $GEMINI_OUTPUT_DIR.
  4. Session syncing: Tail the Claude log, feed it into gemini chat --input ... for a summary, and append new findings back via /project:session-update.
  5. Docs & wrap-up: Generate a post-incident report with gemini prompt --file $GEMINI_TOOLKIT/prompts/write_docs.md --input summary.md, then mirror the report to the session log and ticketing system.
Keep every agent output referenced by filename inside the session log so responders can audit how Gemini assisted during the incident.

Generative modes & creation catalogue

Text & code generation

Image generation & editing

Video & audio snippets

Data & spreadsheet helpers

Set GEMINI_MODEL in your environment to swap defaults quickly (e.g. export GEMINI_MODEL=gemini-pro-vision for multimodal prompts).

Prompt workflows in the terminal

PromptCommand patternBest practice
@plan_feature.mdprintf "%s" "$STORY" | gemini prompt --file $GEMINI_TOOLKIT/prompts/plan_feature.mdPipe the story via stdin; archive the plan in your shared engineering notes.
@code_review.mdgit diff main...HEAD > /tmp/diff.patch && gemini prompt --file $GEMINI_TOOLKIT/prompts/code_review.md --input /tmp/diff.patchRequest severity tags and ask Gemini to list manual test ideas.
@write_docs.mdgemini prompt --file $GEMINI_TOOLKIT/prompts/write_docs.md --input release-context.mdProvide plan, review, and deployment notes so docs are audit-ready.
@create_brief.mdgemini prompt --file $GEMINI_TOOLKIT/prompts/create_brief.md --input kickoff.mdSave the output as a shared brief and circulate it inside Claude.

Keep sessions in sync

Pull the latest Claude log

tail -n 120 .claude/sessions/current.log > $GEMINI_OUTPUT_DIR/current-session.txt

Analyze with Gemini

gemini chat --input $GEMINI_OUTPUT_DIR/current-session.txt --system "Summarise blockers, decisions, next steps."

Round-trip the learnings

Paste the summary back into /project:session-update and attach as evidence in your ticket tracker.

Store every Gemini summary in a searchable session insights archive so new contributors can replay historical research.

How Gemini accelerates different disciplines

Integrations and supporting tools

Best practices for maximizing Gemini