oh-my-customcode 0.65.1 → 0.66.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,6 +21,16 @@ if command -v codex >/dev/null 2>&1; then
21
21
  fi
22
22
  fi
23
23
 
24
+ # Check Gemini CLI availability
25
+ GEMINI_STATUS="unavailable"
26
+ if command -v gemini >/dev/null 2>&1; then
27
+ if [ -n "${GOOGLE_API_KEY:-}" ] || [ -n "${GEMINI_API_KEY:-}" ]; then
28
+ GEMINI_STATUS="available (authenticated)"
29
+ else
30
+ GEMINI_STATUS="installed (gcloud auth may be available)"
31
+ fi
32
+ fi
33
+
24
34
  # Check Agent Teams availability
25
35
  AGENT_TEAMS_STATUS="disabled"
26
36
  if [ "${CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS:-0}" = "1" ]; then
@@ -134,6 +144,7 @@ fi
134
144
  STATUS_FILE="/tmp/.claude-env-status-${PPID}"
135
145
  cat > "$STATUS_FILE" << ENVEOF
136
146
  codex=${CODEX_STATUS}
147
+ gemini=${GEMINI_STATUS}
137
148
  agent_teams=${AGENT_TEAMS_STATUS}
138
149
  git_branch=${CURRENT_BRANCH}
139
150
  claude_version=${CLAUDE_VERSION}
@@ -144,6 +155,7 @@ ENVEOF
144
155
 
145
156
  # Report to stderr (visible in conversation)
146
157
  echo " codex CLI: ${CODEX_STATUS}" >&2
158
+ echo " gemini CLI: ${GEMINI_STATUS}" >&2
147
159
  echo " Agent Teams: ${AGENT_TEAMS_STATUS}" >&2
148
160
  echo " Claude Code: v${CLAUDE_VERSION} (${COMPAT_STATUS})" >&2
149
161
  if [ "$COMPAT_STATUS" = "outdated" ]; then
@@ -64,12 +64,16 @@ Check if Agent Teams is available (`CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` or T
64
64
  ### Step 2: Codex-Exec Hybrid (Code Generation)
65
65
  For **new pipeline code**, **DAG scaffolding**, or **SQL model generation**:
66
66
 
67
- 1. Check `/tmp/.claude-env-status-*` for codex availability
67
+ 1. Check `/tmp/.claude-env-status-*` for codex and gemini availability
68
68
  2. If codex available AND task involves new file creation → automatically delegate to `/codex-exec` for scaffolding:
69
69
  - Display: `[Codex Hybrid] Delegating to codex-exec...`
70
70
  - codex-exec generates initial code (strength: fast generation)
71
71
  - Selected DE expert reviews and refines codex output (strength: reasoning, quality)
72
- 3. If codex unavailable display `[Codex] Unavailable proceeding with {expert} directly` and use DE expert directly
72
+ 3. If codex unavailable but gemini available delegate to `/gemini-exec` for scaffolding:
73
+ - Display: `[Gemini Hybrid] Delegating to gemini-exec...`
74
+ - gemini-exec generates initial code
75
+ - Selected DE expert reviews and refines output
76
+ 4. If neither available → display `[External CLI] Unavailable — proceeding with {expert} directly` and use DE expert directly
73
77
 
74
78
  **Suitable**: New DAG files, dbt model scaffolding, SQL template generation
75
79
  **Unsuitable**: Existing pipeline modification, architecture decisions, data quality analysis
@@ -99,12 +99,16 @@ Check if Agent Teams is available (`CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` or T
99
99
  ### Step 2: Codex-Exec Hybrid (Implementation Tasks)
100
100
  For **new file creation**, **boilerplate**, or **test code generation**:
101
101
 
102
- 1. Check `/tmp/.claude-env-status-*` for codex availability
102
+ 1. Check `/tmp/.claude-env-status-*` for codex and gemini availability
103
103
  2. If codex available AND task involves new file creation → automatically delegate to `/codex-exec` for scaffolding:
104
104
  - Display: `[Codex Hybrid] Delegating to codex-exec...`
105
105
  - codex-exec generates initial code (strength: fast generation)
106
106
  - Selected Claude expert reviews and refines codex output (strength: reasoning, quality)
107
- 3. If codex unavailable display `[Codex] Unavailable proceeding with {expert} directly` and use Claude expert directly
107
+ 3. If codex unavailable but gemini available delegate to `/gemini-exec` for scaffolding:
108
+ - Display: `[Gemini Hybrid] Delegating to gemini-exec...`
109
+ - gemini-exec generates initial code
110
+ - Selected Claude expert reviews and refines output
111
+ 4. If neither available → display `[External CLI] Unavailable — proceeding with {expert} directly` and use Claude expert directly
108
112
 
109
113
  **Suitable**: New file creation, boilerplate, scaffolding, test code
110
114
  **Unsuitable**: Existing code modification, architecture decisions, bug fixes
@@ -0,0 +1,215 @@
1
+ ---
2
+ name: gemini-exec
3
+ description: Execute Gemini CLI prompts and return results
4
+ scope: core
5
+ argument-hint: "<prompt> [--json] [--stream-json] [--output <path>] [--model <name>] [--timeout <ms>] [--sandbox] [--plan]"
6
+ user-invocable: true
7
+ ---
8
+
9
+ # Gemini Exec Skill
10
+
11
+ Execute Google Gemini CLI prompts in non-interactive mode and return structured results. Enables Claude + Gemini hybrid workflows.
12
+
13
+ ## Options
14
+
15
+ ```
16
+ <prompt> Required. The prompt to send to Gemini CLI
17
+ --json Return structured JSON output (-o json)
18
+ --stream-json Return streaming JSON events (-o stream-json)
19
+ --output <path> Save response to file
20
+ --model <name> Model override (default: Gemini CLI default)
21
+ --timeout <ms> Execution timeout (default: 120000, max: 600000)
22
+ --yolo Enable auto-approval mode (gemini -y)
23
+ --sandbox Run in sandbox mode (gemini -s)
24
+ --plan Use plan approval mode (--approval-mode plan)
25
+ --working-dir Working directory for Gemini execution
26
+ ```
27
+
28
+ ## Workflow
29
+
30
+ ```
31
+ 1. Pre-checks
32
+ - Verify `gemini` binary is installed (which gemini)
33
+ - Verify authentication (GOOGLE_API_KEY, GEMINI_API_KEY, or gcloud auth)
34
+ 2. Build command
35
+ - Base: gemini -p "<prompt>"
36
+ - Apply options: -o json, -m <model>, -y, -s, --approval-mode plan
37
+ 3. Execute
38
+ - Run via Bash tool with timeout (default 2min, max 10min)
39
+ - Or use helper script: node .claude/skills/gemini-exec/scripts/gemini-wrapper.cjs
40
+ 4. Parse output
41
+ - Text mode: return raw stdout
42
+ - JSON mode: parse single JSON object, extract response field
43
+ - Stream-JSON mode: parse event stream, extract final assistant message
44
+ 5. Report results
45
+ - Format output with execution metadata
46
+ ```
47
+
48
+ ## Safety Defaults
49
+
50
+ - `-p` flag: Non-interactive prompt mode (no session persistence)
51
+ - Default mode: Normal approval (Gemini prompts for confirmation)
52
+ - Override with `--yolo` only when explicitly requested
53
+ - Sandbox mode (`-s`) available for isolated execution
54
+
55
+ ## Output Format
56
+
57
+ ### Success (Text Mode)
58
+ ```
59
+ [Gemini Exec] Completed
60
+
61
+ Model: (default)
62
+ Duration: 23.4s
63
+ Working Dir: /path/to/project
64
+
65
+ --- Output ---
66
+ {gemini response text}
67
+ ```
68
+
69
+ ### Success (JSON Mode)
70
+ ```
71
+ [Gemini Exec] Completed (JSON)
72
+
73
+ Model: (default)
74
+ Duration: 23.4s
75
+
76
+ --- Response ---
77
+ {extracted response from JSON}
78
+
79
+ --- Stats ---
80
+ {token usage and other stats}
81
+ ```
82
+
83
+ ### Success (Stream-JSON Mode)
84
+ ```
85
+ [Gemini Exec] Completed (Stream-JSON)
86
+
87
+ Model: (default)
88
+ Duration: 23.4s
89
+ Events: 12
90
+
91
+ --- Final Message ---
92
+ {extracted final assistant message}
93
+ ```
94
+
95
+ ### Failure
96
+ ```
97
+ [Gemini Exec] Failed
98
+
99
+ Error: {error_message}
100
+ Exit Code: {code}
101
+ Suggested Fix: {suggestion}
102
+ ```
103
+
104
+ ## Helper Script
105
+
106
+ For complex executions, use the wrapper script:
107
+ ```bash
108
+ node .claude/skills/gemini-exec/scripts/gemini-wrapper.cjs --prompt "your prompt" [options]
109
+ ```
110
+
111
+ The wrapper provides:
112
+ - Environment validation (binary + auth checks)
113
+ - Safe command construction
114
+ - JSON and stream-JSON parsing with response extraction
115
+ - Structured JSON output
116
+ - Timeout handling with graceful termination
117
+
118
+ ## Examples
119
+
120
+ ```bash
121
+ # Simple text prompt
122
+ gemini-exec "explain what this project does"
123
+
124
+ # JSON output with model override
125
+ gemini-exec "list all TODO items" --json --model gemini-2.5-pro
126
+
127
+ # Stream-JSON for detailed event tracking
128
+ gemini-exec "analyze the codebase" --stream-json
129
+
130
+ # Save output to file
131
+ gemini-exec "generate a README" --output ./README.md
132
+
133
+ # Sandbox mode with auto-approval
134
+ gemini-exec "fix the failing tests" --yolo --sandbox
135
+
136
+ # Plan mode for careful execution
137
+ gemini-exec "refactor the auth module" --plan
138
+
139
+ # Specify working directory
140
+ gemini-exec "analyze the codebase" --working-dir /path/to/project
141
+ ```
142
+
143
+ ## Integration
144
+
145
+ Works with the orchestrator pattern:
146
+ - Main conversation delegates Gemini execution via this skill
147
+ - Results are returned to the main conversation for further processing
148
+ - Can be chained with other skills (e.g., dev-review after Gemini generates code)
149
+
150
+ ## Availability Check
151
+
152
+ gemini-exec requires the Gemini CLI binary to be installed and authenticated. The skill is only usable when:
153
+
154
+ 1. `gemini` binary is found in PATH (`which gemini` succeeds)
155
+ 2. Authentication is valid (GOOGLE_API_KEY, GEMINI_API_KEY set, or gcloud auth active)
156
+
157
+ If either check fails, this skill cannot be used. Fall back to Claude agents for the task.
158
+
159
+ > **Note**: This skill is invoked via `/gemini-exec` command, delegated by the orchestrator, or suggested by routing skills when gemini is available. The intent-detection system can trigger it for research and code generation hybrid workflows.
160
+
161
+ ## Agent Teams Integration
162
+
163
+ When used within Agent Teams (requires explicit invocation):
164
+
165
+ 1. **As delegated task**: orchestrator explicitly delegates gemini-exec for code generation
166
+ 2. **Hybrid workflow**: Claude team member analyzes → orchestrator invokes gemini-exec → Claude reviews
167
+ 3. **Iteration**: Team messaging enables review-fix cycles between Claude and Gemini outputs
168
+
169
+ ```
170
+ Orchestrator delegates generation task
171
+ → /gemini-exec invoked explicitly
172
+ → Output returned to orchestrator
173
+ → Reviewer validates quality
174
+ → Iterate if needed
175
+ ```
176
+
177
+ ## Research Workflow
178
+
179
+ When the orchestrator or intent-detection detects a research request:
180
+
181
+ 1. **Check Gemini availability**: Verify `gemini` binary and auth
182
+ 2. **If available**: Execute prompt for research
183
+ 3. **If unavailable**: Fall back to Claude's WebFetch/WebSearch
184
+
185
+ ### Research Command Pattern
186
+ ```
187
+ /gemini-exec "Research and analyze: {topic}. Provide structured findings with sources." --json
188
+ ```
189
+
190
+ ## Code Generation Workflow
191
+
192
+ When routing skills detect a code generation task and gemini is available:
193
+
194
+ 1. **Check availability**: Verify gemini CLI via `/tmp/.claude-env-status-*`
195
+ 2. **If available + new file creation**: Suggest hybrid workflow
196
+ 3. **Hybrid pattern**:
197
+ - gemini-exec generates initial code (fast, broad generation)
198
+ - Claude expert reviews for quality, patterns, best practices
199
+ - Iterate if needed
200
+
201
+ ### Suitable Tasks
202
+ - New file scaffolding
203
+ - Boilerplate generation
204
+ - Test stub creation
205
+ - Documentation generation
206
+
207
+ ### Unsuitable Tasks
208
+ - Modifying existing code (Claude expert better at understanding context)
209
+ - Architecture decisions (requires reasoning, not generation)
210
+ - Bug fixes (requires deep code understanding)
211
+
212
+ ### Code Generation Command Pattern
213
+ ```
214
+ /gemini-exec "Generate {description} following {framework} best practices" --yolo
215
+ ```