GC-201a · Module 1

Writing Effective GEMINI.md Instructions

4 min read

A GEMINI.md file is a prompt that persists across every session. The quality of your instructions directly determines the quality of Gemini's output. Vague instructions produce vague results. Specific, structured instructions produce consistent, predictable behavior. The best GEMINI.md files read like operational manuals — not wishlists.

Start with the /init command to generate a baseline. Gemini CLI scans your codebase, identifies the tech stack, maps the project structure, and produces a starter GEMINI.md. This gets you 70-80% of the way. The remaining 20% — the part that makes Gemini truly productive for your team — requires manual refinement. Add your architecture decisions, naming conventions, testing requirements, and deployment procedures. The goal is that a new developer (or a new AI session) can read this file and understand how to work in your codebase correctly.

# Project: Acme Dashboard

## Architecture
- React 19 + TypeScript strict mode
- Zustand for state management (NOT Redux)
- Tailwind CSS 4 — no CSS modules, no styled-components
- All API calls through src/api/client.ts

## Commands
- `npm run dev` — Vite dev server
- `npm run test` — Vitest (run before every commit)
- `npm run lint` — ESLint + Prettier

## Conventions
- Functional components only. No class components.
- All props interfaces named `{Component}Props`
- Error boundaries on every route-level component
- Tests co-located: MyComponent.test.tsx next to MyComponent.tsx

## Do NOT
- Install new dependencies without asking first
- Modify the auth module — it is audited and locked
- Use any/unknown types — strict TypeScript always

Do This

  • Write GEMINI.md like an operational manual — architecture, commands, conventions, exclusions
  • Use /init to bootstrap, then refine manually with team-specific rules
  • Include explicit "Do NOT" sections to prevent common AI overreach

Avoid This

  • Write vague instructions like "write good code" or "follow best practices"
  • Skip /init and write everything from scratch — you will miss obvious context
  • Assume Gemini knows your constraints without being told explicitly