Gemini Framework · diff
git:20260207.88c1f6e to git:20260209.1d311b4
64 added, 173 removed. Audit A to A.
---
name: Gemini Framework
- description: Knowledge of Google Gemini CLI integration, capabilities, and usage patterns.
+ description: Reference knowledge for Google Gemini CLI compatibility. Describes how Gemini discovers context and configuration so Forge can interoperate. DO NOT create files from this skill — it is reference material only.
---
- Gemini CLI's equivalent of Claude Code's `CLAUDE.md + rules + skills` is: **hierarchical `GEMINI.md` context files**, optional **`.gemini/settings.json`** for behavior, and (if you want hard "firmware" rules) an optional **system-prompt override** via `GEMINI_SYSTEM_MD` pointing at `.gemini/system.md`. [developers.openai](https://developers.openai.com/codex/guides/agents-md/)
-
- ## What Gemini CLI supports (Feb 5, 2026)
- - Gemini CLI loads instructional context by concatenating `GEMINI.md` files from (1) `~/.gemini/GEMINI.md`, (2) your current directory and its parents up to the project root (identified by `.git`), and (3) subdirectories under your CWD, while respecting `.gitignore` and `.geminiignore`. [developers.openai](https://developers.openai.com/codex/guides/agents-md/)
- - You can modularize a `GEMINI.md` using `@file.md` imports (relative or absolute paths). [developers.openai](https://developers.openai.com/codex/guides/agents-md/)
- - You can manage/reload this hierarchical memory with `/memory` commands including `show`, `refresh`, and `add <text>` (adds to `~/.gemini/GEMINI.md`). [developers.openai](https://developers.openai.com/codex/guides/agents-md/)
- - For stricter control, `GEMINI_SYSTEM_MD` can fully replace the built-in system prompt with a markdown file (project default: `./.gemini/system.md`), and this is a **full replacement**, not a merge.
-
- ## Repo layout (copy exactly)
- This gives you: (1) “always-on strategy” via `GEMINI.md`, (2) modular “rules/playbooks” via imports, and (3) optional “firmware” via `.gemini/system.md`. [developers.openai](https://developers.openai.com/codex/guides/agents-md/)
-
- ```txt
- your-repo/
- .gemini/
- settings.json
- .env
- system.md
- .geminiignore
- rules/
- 00-operating-system.md
- 10-ui-ux-dx.md
- 20-3d-spatial.md
- playbooks/
- ux-brief.md
- 3d-ui-prototyper.md
- spatial-ux-critic.md
- dx-component-architect.md
- motion-microinteractions.md
- a11y-gate.md
- GEMINI.md
- src/
- scene/
- GEMINI.md # optional, local/module context
- ```
-
- ## Copy-paste artifacts
-
- ### `GEMINI.md` (project root)
- Gemini CLI will discover `GEMINI.md` up the directory tree to the `.git` project root and also scan subdirectories, so keeping a root file as the “single source of truth” works well. [developers.openai](https://developers.openai.com/codex/guides/agents-md/)
- Imports with `@...` are supported (relative or absolute), so we treat `.gemini/rules/*` and `.gemini/playbooks/*` as composable modules. [developers.openai](https://developers.openai.com/codex/guides/agents-md/)
-
- ```md
- # GEMINI.md — Future Interface Architect (UI/UX/DX + 3D)
-
- ## Role
- You are the Future Interface Architect: UI/UX designer + UX engineer + DX architect.
- You design shippable UI systems and prototypes (2D + 3D/spatial) with clarity, performance, accessibility, and developer ergonomics.
+ # Gemini CLI — Reference Knowledge
- ## Prime directive
- - Prefer small, testable increments that can land today.
- - If ambiguous, ask 1–3 targeted questions OR propose 2–3 options with trade-offs and pick a default.
+ > **IMPORTANT:** This skill is REFERENCE ONLY. Do NOT create `GEMINI.md`, `.gemini/` directories, playbooks, or rules files in the user's project unless the user explicitly asks to add Gemini CLI support. NXTG-Forge provides all agent functionality through the Claude Code plugin system.
- ## Output contract (always)
- When doing UI/UX/3D work, respond in this order:
- 1) Intent & user job-to-be-done (1–2 lines)
- 2) IA / navigation map (bullets)
- 3) Interaction spec (states + transitions + gestures)
- 4) Component/scene architecture (what lives where)
- 5) Perf + a11y constraints (budgets + fallbacks)
- 6) Implementation plan (steps)
- 7) Code (only after plan is clear)
+ ## How Gemini CLI Discovers Context
- ## Always-on rules (imports)
- @.gemini/rules/00-operating-system.md
- @.gemini/rules/10-ui-ux-dx.md
- @.gemini/rules/20-3d-spatial.md
+ Gemini CLI loads instructional context by concatenating `GEMINI.md` files from:
+ 1. `~/.gemini/GEMINI.md` — global user instructions
+ 2. Current directory and parents up to `.git` root — project instructions
+ 3. Subdirectories under CWD — module-specific instructions
- ## “Skills” equivalent (playbooks you can include on demand)
- When the user asks for one of these, include the file via @ and follow it:
- - @.gemini/playbooks/ux-brief.md
- - @.gemini/playbooks/3d-ui-prototyper.md
- - @.gemini/playbooks/spatial-ux-critic.md
- - @.gemini/playbooks/dx-component-architect.md
- - @.gemini/playbooks/motion-microinteractions.md
- - @.gemini/playbooks/a11y-gate.md
- ```
+ It respects `.gitignore` and `.geminiignore` for filtering.
- ### `.gemini/rules/20-3d-spatial.md`
- ```md
- # 3D / spatial rules
+ ### Modular Imports
- - 3D is not decoration: each 3D element must encode meaning or affordance.
- - Always provide a 2D fallback (“flat mode”) for essential actions and content.
- - Layered architecture: HUD (2D) + Scene (3D) + Inspector (2D) + Debug toggles.
- - Do not bury critical actions in 3D-only gestures; mirror in standard controls.
- - Comfort: avoid forced camera swings; provide reset/home; respect reduced motion.
- - Performance: instancing for many objects; memoize materials/geometries; no per-frame UI state updates.
- ```
+ `GEMINI.md` supports `@file.md` imports (relative or absolute paths), enabling:
+ - `@.gemini/rules/coding-standards.md` — always-on rules
+ - `@.gemini/playbooks/feature-planning.md` — on-demand skill equivalents
- ### `.gemini/playbooks/3d-ui-prototyper.md` (Gemini “skill” surrogate)
- These “playbooks” aren’t a special Gemini filetype—Gemini CLI simply supports importing markdown into context using `@file.md`, which makes this a reliable, tool-agnostic substitute for slash-command skills. [developers.openai](https://developers.openai.com/codex/guides/agents-md/)
+ ### Memory Commands
- ```md
- # Playbook: 3D UI Prototyper
+ - `/memory show` — inspect loaded context
+ - `/memory refresh` — rescan after edits
+ - `/memory add <text>` — append to `~/.gemini/GEMINI.md`
- Use when: spatial data (systems, topology, timelines, pipelines) or “future UI”.
+ ## Gemini CLI Configuration
- Workflow:
- 1) Clarify primary interaction: select / inspect / manipulate / navigate.
- 2) Choose representation: nodes+edges, cards-in-space, layered panels, volumetric HUD.
- 3) Define camera model + constraints: orbit/fly/rail; bounds; reset/home.
- 4) Define input model: keyboard+mouse first; gestures optional.
- 5) Architecture: HUD (2D), Scene (3D), Inspector (2D), Debug (dev-only).
- 6) MVP slice: hover+select, focus/isolate, reset view, flat-mode toggle.
- 7) Perf guardrails: instancing; memoize materials; avoid per-frame React state.
+ ### `.gemini/settings.json`
- Deliverables:
- - Scene graph (bullets)
- - Interaction states + transitions
- - Implementation steps
- - Code skeleton (components/hooks)
- - Perf + fallback notes
+ Project-level settings (also supports `~/.gemini/settings.json` for global):
+ ```json
+ {
+ "general": { "vimMode": true },
+ "ui": { "showCitations": true },
+ "tools": { "approvalMode": "default" },
+ "context": { "fileName": ["GEMINI.md"] }
+ }
```
- ### Optional: module-level `src/scene/GEMINI.md`
- Gemini CLI scans subdirectories for `GEMINI.md` and uses them as more specific context for that part of the codebase (subject to `.gitignore` and `.geminiignore`). [developers.openai](https://developers.openai.com/codex/guides/agents-md/)
+ ### System Prompt Override (`.gemini/system.md`)
- ```md
- # src/scene GEMINI.md — 3D subsystem
+ Setting `GEMINI_SYSTEM_MD=1` in `.gemini/.env` makes Gemini CLI fully replace its built-in system prompt with `.gemini/system.md`. This is a **full replacement**, not a merge.
- - Treat this folder as a performance-critical boundary.
- - Prefer instancing and batching; avoid allocations in hot paths.
- - Keep “flat mode” parity: anything essential must exist without 3D.
- ```
+ Supports variable substitution: `${AvailableTools}`, `${AgentSkills}`.
- ### `.gemini/.geminiignore`
- Gemini CLI respects `.geminiignore` when searching for memory/context, so use it to block heavy/noisy dirs. [openai](https://openai.com/index/introducing-codex/)
+ ## Gemini CLI Directory Structure
- ```gitignore
- node_modules/
- dist/
- build/
- .next/
- coverage/
- **/*.log
- **/*.png
- **/*.jpg
- **/*.mp4
+ When a project supports Gemini CLI, the typical layout is:
```
-
- ## Settings + strict mode (“firmware”)
-
- ### `.gemini/settings.json` (project config)
- Gemini CLI supports a project settings file at `.gemini/settings.json` and a user settings file at `~/.gemini/settings.json`, with clear precedence ordering. [openai](https://openai.com/index/introducing-codex/)
- You can also set `context.fileName` to change which context files it loads (default is `GEMINI.md`, but you can allow multiple). [openai](https://openai.com/index/introducing-codex/)
-
- ```json
- {
- "general": {
- "vimMode": true
- },
- "ui": {
- "showCitations": true,
- "showLineNumbers": true
- },
- "tools": {
- "approvalMode": "default"
- },
- "context": {
- "fileName": ["GEMINI.md"]
- }
- }
+ project/
+ ├── .gemini/
+ │ ├── settings.json # CLI configuration
+ │ ├── .env # GEMINI_SYSTEM_MD toggle
+ │ ├── system.md # Optional system prompt override
+ │ ├── .geminiignore # Context exclusions
+ │ ├── rules/ # Always-on imported rules
+ │ └── playbooks/ # On-demand skill equivalents
+ ├── GEMINI.md # Main context file (like CLAUDE.md)
+ └── src/
+ └── module/
+ └── GEMINI.md # Module-specific context (optional)
```
- ### `.gemini/system.md` (optional, heavy hammer)
- `GEMINI_SYSTEM_MD` replaces Gemini CLI’s built-in system prompt with your markdown file, and it’s a **full replacement**, so only do this if you’re disciplined about maintaining it.
- The system override supports variable substitution like `${AvailableTools}` and `${AgentSkills}`, and you can export the current built-in system prompt to a file using `GEMINI_WRITE_SYSTEM_MD=1 gemini`.
-
- ```md
- # system.md — Next.Gen.AI “Firmware” (Gemini CLI)
-
- You are a senior UI/UX/DX + 3D interface architect.
+ ## Forge ↔ Gemini Interoperability
- Hard rules:
- - Prefer minimal diffs and shippable vertical slices.
- - Ask clarifying questions when requirements are ambiguous.
- - Never assume destructive commands are allowed; request confirmation.
- - Always produce: intent → IA → interaction spec → architecture → perf/a11y → plan → code.
+ When a project needs to support BOTH Claude Code (via Forge) and Gemini CLI:
- Enabled tools (for awareness):
- ${AvailableTools}
+ 1. **Forge handles Claude Code** — via plugin (commands, agents, skills, hooks)
+ 2. **Gemini reads its own files** — `GEMINI.md`, `.gemini/` directory
+ 3. **Shared state** — both can read `.claude/governance.json` for project context
+ 4. **No duplication** — keep agent instructions separate per platform
- Available skills (if any are enabled in this CLI build):
- ${AgentSkills}
- ```
+ Gemini CLI does NOT have a plugin system or slash-command skills. The reliable cross-version pattern is `GEMINI.md` + `@imports` (playbooks) + optional system prompt override.
- ### `.gemini/.env` (turn on system override)
- Setting `GEMINI_SYSTEM_MD=1` makes Gemini CLI read `./.gemini/system.md` (project default path), and you can also point it to an arbitrary path.
+ ## Key Differences: Claude Code vs Gemini CLI
- ```bash
- GEMINI_SYSTEM_MD=1
- ```
+ | Aspect | Claude Code (Forge) | Gemini CLI |
+ |--------|-------------------|------------|
+ | Config file | `CLAUDE.md` | `GEMINI.md` |
+ | Hierarchical | Not natively | Yes (scans parent dirs to `.git` root) |
+ | Imports | Not supported | `@file.md` syntax |
+ | Skills | Plugin `skills/*/SKILL.md` | Playbooks via `@import` |
+ | Plugin system | Yes (marketplace) | No |
+ | System prompt | Fixed (extend via CLAUDE.md) | Full replacement via `system.md` |
+ | Hooks | Pre/PostToolUse, Stop, etc. | None documented |
- ## How you’ll actually use it (TUI + scripting)
- - Inspect exactly what Gemini will send as memory: `/memory show`, and force a rescan after edits with `/memory refresh`. [developers.openai](https://developers.openai.com/codex/guides/agents-md/)
- - For CLI scripting/non-interactive runs, Gemini CLI supports passing a prompt directly (e.g., `--prompt`) and choosing output format (`text` or `json`) via settings or flags. [openai](https://openai.com/index/introducing-codex/)
+ ## Sources
- Brutal reality-check: Gemini CLI doesn’t (from the docs above) expose a Claude-style “project `/skills` folder with `SKILL.md` and guaranteed slash commands”; the reliable cross-version pattern is **GEMINI.md + imports** (playbooks) plus optional `.gemini/system.md` for enforcement. [developers.openai](https://developers.openai.com/codex/guides/agents-md/)
+ - Google Gemini CLI documentation on `GEMINI.md` discovery and hierarchical context
+ - Gemini CLI documentation on settings, system prompt override, and memory commands
- If you tell me whether you want **strict firmware mode** (system prompt override ON) or “lightweight strategy only” (GEMINI.md only), I’ll tune the artifact for maximum reliability with minimal token drag.