fix(gemini): strip skills key and hooks comments from agent frontmatter#999
Open
gridworks wants to merge 1 commit intogsd-build:mainfrom
Open
fix(gemini): strip skills key and hooks comments from agent frontmatter#999gridworks wants to merge 1 commit intogsd-build:mainfrom
gridworks wants to merge 1 commit intogsd-build:mainfrom
Conversation
- Strip skills: frontmatter key — Claude Code-specific, rejected by Gemini CLI schema - Strip # hooks: comment blocks from inside frontmatter — Gemini CLI YAML parser rejects comment lines between --- delimiters even when commented out - Both bugs combined caused all 12 GSD agents to fail loading on every launch - Verified fix brings agent load count from 0/12 to 12/12 on macOS Gemini CLI v0.32.x Fixes #[issue number if one exists]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey TÂCHES,
First — GSD is genuinely impressive work. The context engineering approach is exactly what the AI dev tooling space needed, and building and maintaining it solo is no small feat.
I'm submitting a fix for two compounding bugs that cause all 12 GSD agents to fail loading in Gemini CLI on every launch. I discovered these through hands-on debugging and verified the fix brings the agent load count from 0/12 to 12/12 on macOS with Gemini CLI v0.32.x.
THE TWO BUGS
Bug 1 —
skills:frontmatter key (affects all 12 agents)Validation failed: Agent Definition:
: Unrecognized key(s) in object: 'skills'
Gemini CLI's agent schema rejects the
skills:key entirely. Every agent file fails to load.Bug 2 — Commented
# hooks:block inside frontmatter (affects 8 agents)The installer correctly comments out the hooks: block for Gemini, but leaves the commented lines INSIDE the YAML frontmatter (between the --- delimiters). Gemini CLI's YAML parser rejects comment lines inside frontmatter, causing silent loading failures — no error message, the agent just doesn't appear.
Together these two bugs mean zero GSD agents load on a fresh Gemini install.
THE FIX
Two filter passes added to
convertClaudeToGeminiAgent()in bin/install.js, right beforenewFrontmatteris assembled fromnewLines:// Bug 1: Strip skills: key
const filteredLines = newLines.filter(line => {
const trimmed = line.trim();
return !trimmed.startsWith('skills:') && !trimmed.match(/^-\s+gsd-.*-workflow$/);
});
// Bug 2: Strip # hooks: comment block
const withoutHooks = filteredLines.filter(line => !line.match(/^#/));
const newFrontmatter = withoutHooks.join('\n').trim();
That's it — 8 lines replacing 1. No other changes.
Note: replace, web_fetch, and google_web_search are all valid Gemini CLI tool names and are correctly preserved by the existing convertGeminiToolName() mapping. No tool name changes needed.
VERIFIED
Tested on macOS Sonoma, Gemini CLI v0.32.x, GSD v1.22.4 local install.
Result: 0/12 agents loading → 12/12 agents loading, zero errors on launch.
I know PR #965 is already in review for a related fix — happy for you to fold this into that PR rather than merge separately if that's cleaner.
Thanks for everything you've built.
Best,
Ali
ADDITIONAL NOTE — Claude references in agent prompt bodies
The agent .md files contain references to "Claude" throughout the prompt body
text (e.g. "Claude = builder", "Claude's Discretion", "Claude execution time").
These are not bugs — Gemini correctly interprets these as self-referential
instructions and executes them as intended.
What would be an actual problem (and is not present):
This is an accepted limitation of GSD's write-once architecture. A future
improvement could be a runtime token substitution pass that replaces "Claude"
with the target runtime name (e.g. "Gemini") in agent body text during install,
similar to how tool names are already mapped via claudeToGeminiTools.