Skip to content

Rules & Workflows

Fresh

Rules

Rules are manually defined constraints that guide agent behavior. They can be set at two levels:

LevelLocationScope
Global~/.gemini/GEMINI.mdApplies to all workspaces
Workspace.agents/rules/Applies to the current workspace only

Activation Modes

ModeBehavior
ManualOnly applied when the user explicitly @ mentions the rule in a conversation.
Always OnApplied to every agent conversation automatically.
Model DecisionThe agent decides whether the rule is relevant to the current task.
Glob PatternActivated when the agent touches files matching the specified glob pattern.

Rule Features

  • Character limit: 12,000 characters per rule
  • File references: Use @ mentions to reference specific files within rules
  • Rules can reference project files to provide context

Workflows

Workflows are series of steps for repetitive tasks. They are saved as markdown files and invoked via /workflow-name in the agent conversation.

Key Features

  • Chaining: Workflows can invoke other workflows
  • Character limit: 12,000 characters per workflow
  • Auto-generation: The agent can automatically generate workflows from conversation history

TIP

If you find yourself giving the agent the same instructions repeatedly, ask it to create a workflow from your conversation history. Invoke it next time with /workflow-name.

SOP Documentation Site