Productivity & Workflow✨gemini🌐universal

A poor person's plan mode for the Gemini CLI

Plan, review, build, and implement modes for the Gemini CLI

Quick Start

Install this Skill

npx skills add mystilleef/gemini-cli-modes
# A poor person's plan mode for the Gemini CLI

![Read-only Mode Diagram](assets/readonly.png)

**If you don't like Gemini eagerly or randomly modifying, or even
deleting, files in your projects, look no further.**

This project provides a set of custom commands and skills to enforce a
structured, mode-based workflow for the Gemini CLI agent. These modes
guide the agent through the distinct phases of a software engineering
taskβ€”Perceive, Reason, Act, and Refine (`PRAR`)β€”ensuring a safe,
deliberate, and verifiable process.

**Important:** _Assuming you have hooks properly installed, all sessions
begin in `readonly` mode._

## Core concepts: Operational modes

Each custom command transitions the Gemini CLI agent into a specific
**operational mode**, each with its own set of permissions and
protocols. The system relies on the `.gemini_readonly` marker file,
which enforces a "Safe-Default" `readonly` state, preventing accidental
modifications.

- **Read-Only Modes (`/readonly`):** Assuming you have hooks properly
  installed, the agent starts all sessions in `readonly` mode. The mode
  serves as a perfect base for investigation, analysis, and planning.
  The system disables all file modification tools.
- **Write-Enabled Modes (`/writable`, `/build`, `/implement`):** Use
  these set of commands to disable `readonly` mode and enable file
  modification tools. These modes allow executing an approved plan. The
  agent removes the `.gemini_readonly` marker and enables file
  modification tools under strict protocols.

## Setup and installation

To use these custom modes, place the project files into your
`~/.gemini/` directory and configure your `settings.json` file.

### 1. Required directory structure

Place the files and directories from this project directly inside your
`~/.gemini/` directory. Your `~/.gemini/` folder should look like this:

```bash
~/.gemini/
β”œβ”€β”€ settings.json
β”œβ”€β”€ SYSTEM.md                              # Foundational operating principles
β”œβ”€β”€ GEMINI.md                              # Project-specific directives
β”œβ”€β”€ commands/
β”‚   β”œβ”€β”€ build.toml
β”‚   β”œβ”€β”€ implement.toml
β”‚   β”œβ”€β”€ plan.toml
β”‚   β”œβ”€β”€ readonly.toml
β”‚   β”œβ”€β”€ review.toml
β”‚   └── writable.toml
β”œβ”€β”€ hooks/                                  # Enforcement and behavior hooks
β”‚   β”œβ”€β”€ disable-readonly-sessionend.sh    # NEW: Clean session termination
β”‚   β”œβ”€β”€ enable-readonly-startup.sh
β”‚   β”œβ”€β”€ enforce-eprime.sh
β”‚   β”œβ”€β”€ enforce-readonly.sh
β”‚   └── remind-readonly-dynamic.sh
β”œβ”€β”€ kbase/                                  # CONSOLIDATED: Unified knowledge base
β”‚   β”œβ”€β”€ GEMINI.md
β”‚   β”œβ”€β”€ agent-protocols.md
β”‚   β”œβ”€β”€ cloud-patterns.md
β”‚   β”œβ”€β”€ data-science-workflow.md
β”‚   β”œβ”€β”€ e-prime-protocol.md
β”‚   β”œβ”€β”€ engineering-principles.md
β”‚   β”œβ”€β”€ gemini-prompt-engineering.md
β”‚   └── ui-ux-design.md
└── skills/                                 # NEW: Skills-based architecture
    β”œβ”€β”€ build-mode/
    β”‚   └── SKILL.md
    β”œβ”€β”€ implement-mode/
    β”‚   └── SKILL.md
    β”œβ”€β”€ plan-mode/
    β”‚   └── SKILL.md
    β”œβ”€β”€ readonly-mode/
    β”‚   β”œβ”€β”€ SKILL.md
    β”‚   β”œβ”€β”€ scripts/
    β”‚   └── tests/
    β”œβ”€β”€ review-mode/
    β”‚   └── SKILL.md
    └── write-mode/
        β”œβ”€β”€ SKILL.md
        β”œβ”€β”€ scripts/
        └── tests/
```

### 2. `settings.json` configuration

The `settings.json` file plays a crucial role for the Gemini CLI agent
to locate the `kbase` directory, enable the experimental skills feature,
configure hooks, and manage session lifecycle. Copy the settings in
`settings.json` from this project to your own in `~/.gemini/`. The file
includes:

- Experimental skills feature activation
- Tools hooks configuration (`enableHooks`)
- Context configuration for loading knowledge base
- Model configuration with custom aliases for temperature and output
  control
- Hooks configuration (`hooksConfig`) to enable hook system
- Hook definitions for read-only enforcement and session lifecycle

**Key hooks configured:**

- `SessionStart`: Creates `.gemini_readonly` marker when session begins
- `BeforeAgent`: Injects `readonly` reminders and enforces E-Prime
  communication protocol before agent execution
- `BeforeTool`: Blocks write operations (write, replace, shell commands,
  file operations, etc.) when `.gemini_readonly` marker exists
- `SessionEnd`: Removes `.gemini_readonly` marker when session
  terminates, ensuring clean exit state

The configuration follows this structure:

```json
{
  "experimental": {
    "skills": true
  },
  "tools": {
    "enableHooks": true
  },
  "context": {
    "loadMemoryFromIncludeDirectories": true,
    "includeDirectories": ["~/.gemini/kbase"]
  },
  "modelConfigs": {
    "customAliases": {
      "base": {
        "modelConfig": {
          "generateContentConfig": {
            "temperature": 0.1,
            "topP": 0.95
          }
        }
      },
      "chat-base": {
        "extends": "base",
        "modelConfig": {
          "generateContentConfig": {
            "temperature": 0.2,
            "topP": 0.9,
            "topK": 1
          }
        }
  

... (truncated)
Repository
8stars
1forks
View on GitHub
Details
DiscoveredJan 23, 2026
Last UpdatedJan 27, 2026
Quality Score
38/100