-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Track 3-stage fix for Gemini/Tabnine TOML command generation #2095
Description
Summary
This issue tracks a 3-stage cleanup of Spec Kit's TOML command generation for Gemini/Tabnine.
The core problem is that Markdown command templates are not being transformed into TOML commands correctly in all paths. The failures are related but not identical, so the work is intentionally split into separate stages to keep review scope tight.
Background
Spec Kit command templates are authored as Markdown files with YAML frontmatter, for example:
---
description: ...
scripts:
sh: ...
ps: ...
---
Command body...Gemini and Tabnine consume .toml command files instead. That conversion currently has multiple defects:
TomlIntegrationdoes not parse YAML frontmatter robustly.- multiline descriptions using
|/>are not preserved semantically
- multiline descriptions using
TomlIntegrationcan include YAML frontmatter inside the generated TOMLprompt.- this is structurally wrong according to the Gemini CLI custom command format
- the legacy
CommandRegistrar.render_toml_command()path can emit invalid TOML for multilinedescriptionvalues.- this affects preset/extension registration rather than the main integration path
Why split this work
The issues share a theme but belong to two different rendering paths:
- the current integration path used by
specify init --ai gemini/tabnine - the legacy TOML renderer still used for preset/extension registration
Splitting them keeps each PR focused and reduces the chance of conflating behavior changes across unrelated code paths.
Stages
Stage 1: Fix TOML integration frontmatter handling
Scope:
TomlIntegrationYAML description extractionTomlIntegrationprompt body generation- integration-level regression tests
Expected outcome:
- block scalar descriptions keep YAML semantics
- generated
promptexcludes YAML frontmatter - real
specify init --ai gemini --offlineoutput matches Gemini CLI expectations
Tracking PR:
Stage 2: Fix legacy multiline TOML description rendering
Scope:
CommandRegistrar.render_toml_command()- extension/preset TOML regression tests
Expected outcome:
- multiline
descriptionvalues render as parseable TOML - legacy TOML output round-trips cleanly through
tomllib
Tracking PR:
Stage 3: Optional follow-up cleanup
Scope:
- only if still useful after stages 1 and 2
- deduplicate small TOML string rendering helpers or normalize tests
Expected outcome:
- no functional behavior change
- reduced duplication if warranted
Validation notes
The issue was verified in two ways:
- direct unit/integration tests
- real output inspection using
specify init --ai gemini --offline
One concrete reproduction from the main integration path was that generated .gemini/commands/*.toml files contained YAML frontmatter inside prompt, even though description had already been extracted to a TOML top-level field.