gemini-plan
Generate Claude-executable implementation plans using Gemini's reasoning
What this skill does
# Gemini Plan Command
Generate structured implementation plans using Gemini CLI. Plans are formatted for Claude to execute, with clear task breakdowns, file modifications, and sequence ordering.
## Usage
```text
/google-ecosystem:gemini-plan <task-description> [options]
```
## Arguments
- `$ARGUMENTS` (required): Description of what you want to implement
- `--context <glob>` (optional): File patterns to include as context (e.g., `src/**/*.ts`)
- `--output <path>` (optional): Output path for plan (default: `docs/ai-artifacts/plans/`)
- `--pro` (optional): Use Gemini Pro for complex planning (default: Flash)
## Examples
- `/google-ecosystem:gemini-plan "Add user authentication with JWT"`
- `/google-ecosystem:gemini-plan "Refactor database layer to use repository pattern" --context "src/db/**"`
- `/google-ecosystem:gemini-plan "Implement dark mode toggle" --output ./plans/`
- `/google-ecosystem:gemini-plan "Migrate from REST to GraphQL" --pro`
## When to Use
Use this command when:
- Planning complex multi-file changes
- Want a "second brain" perspective on implementation approach
- Need to break down a large feature into actionable steps
- Validating your own implementation plan
- Getting alternative approaches to consider
## Philosophy: "Claude Orchestrates, Gemini Plans"
Gemini's different reasoning approach often provides:
- Alternative architectural perspectives
- Edge cases Claude might miss
- Different sequencing of implementation steps
- Fresh eyes on potential issues
## Execution
### Step 1: Parse Arguments
```bash
task_description="$ARGUMENTS"
context_pattern=""
output_dir="docs/ai-artifacts/plans"
model="gemini-2.5-flash"
# Parse optional flags
while [[ $# -gt 0 ]]; do
case $1 in
--context)
context_pattern="$2"
shift 2
;;
--output)
output_dir="$2"
shift 2
;;
--pro)
model="gemini-2.5-pro"
shift
;;
*)
shift
;;
esac
done
```
### Step 2: Gather Context
```bash
# Read CLAUDE.md for project conventions
claude_context=""
if [ -f "CLAUDE.md" ]; then
claude_context=$(cat CLAUDE.md)
fi
# Gather specified context files
file_context=""
if [ -n "$context_pattern" ]; then
file_context=$(find . -path "$context_pattern" -type f | xargs cat 2>/dev/null | head -c 500000)
fi
```
### Step 3: Build Planning Prompt
```bash
prompt="PLANNING MODE: Generate an implementation plan for Claude Code to execute.
## Task
$task_description
## Project Context (from CLAUDE.md)
$claude_context
## Relevant Code Context
$file_context
## Instructions
Generate a detailed implementation plan with the following structure:
### 1. Summary
Brief description of the approach (2-3 sentences)
### 2. Prerequisites
- Dependencies to install
- Configuration changes needed
- Files to read/understand first
### 3. Implementation Tasks
Numbered list of specific, actionable tasks:
1. [FILE: path/to/file.ts] Description of change
2. [FILE: path/to/another.ts] Description of change
...
### 4. File Modifications
Table format:
| File | Action | Description |
| --- | --- | --- |
| path/to/file.ts | CREATE/MODIFY/DELETE | What changes |
### 5. Sequence Order
Which tasks depend on others, what order to execute
### 6. Testing Strategy
How to verify the implementation works
### 7. Potential Risks
- Risk 1: Mitigation
- Risk 2: Mitigation
### 8. Recommendations for Claude
Specific guidance for Claude when executing this plan
Format the output as structured markdown that another AI agent can parse and execute."
```
### Step 4: Execute Planning
```bash
result=$(echo "$prompt" | gemini "$(cat)" --output-format json -m "$model")
```
### Step 5: Parse Results
```bash
response=$(echo "$result" | jq -r '.response // "Planning failed"')
total_tokens=$(echo "$result" | jq '.stats.models | to_entries | map(.value.tokens.total) | add // 0')
model_used=$(echo "$result" | jq -r '.stats.models | keys[0] // "unknown"')
```
### Step 6: Generate Plan Document
Create structured markdown plan:
````markdown
---
generated-by: gemini-cli
model: {model_used}
timestamp: {ISO8601}
tokens: {total_tokens}
task: "{task_description}"
---
# Implementation Plan
## Machine-Readable Summary
```json
{
"type": "plan",
"task": "{task_description}",
"tokens_used": {total_tokens},
"model": "{model_used}",
"files_to_modify": [
"path/to/file1.ts",
"path/to/file2.ts"
],
"estimated_complexity": "low|medium|high"
}
```
{response}
---
*Generated by Gemini CLI via `/gemini-plan` command*
*Review and validate before execution*
````
### Step 7: Save Plan
```bash
mkdir -p "$output_dir"
timestamp=$(date -u +"%Y-%m-%dT%H-%M-%SZ")
# Create slug from task description
slug=$(echo "$task_description" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | head -c 50)
output_file="$output_dir/plan-${slug}-${timestamp}.md"
echo "$plan" > "$output_file"
echo "Plan saved to: $output_file"
```
## Output Format
Plans include YAML frontmatter for machine parsing:
- **generated-by**: Always "gemini-cli"
- **model**: Which Gemini model was used
- **timestamp**: ISO 8601 format
- **tokens**: Total tokens consumed
- **task**: Original task description
## Integration with Claude
After generating a plan:
1. **Review**: Claude reads the plan from `docs/ai-artifacts/plans/`
2. **Validate**: Claude checks plan against project conventions
3. **Execute**: Claude implements tasks in sequence
4. **Verify**: Claude runs tests per the testing strategy
## Plan Quality Checklist
Good plans should have:
- [ ] Clear, atomic task descriptions
- [ ] Specific file paths (not "the component file")
- [ ] Logical sequence with dependencies noted
- [ ] Testing strategy for verification
- [ ] Risk assessment with mitigations
## Notes
- Uses Flash model by default (Pro for `--pro` flag)
- Includes CLAUDE.md context automatically
- Plans are saved to `docs/ai-artifacts/plans/` (git-tracked)
- Review plans before having Claude execute them
- Plans are suggestions - Claude should validate against project conventions
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.