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:
TomlIntegration does not parse YAML frontmatter robustly.
- multiline descriptions using
| / > are not preserved semantically
TomlIntegration can include YAML frontmatter inside the generated TOML prompt.
- this is structurally wrong according to the Gemini CLI custom command format
- the legacy
CommandRegistrar.render_toml_command() path can emit invalid TOML for multiline description values.
- 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:
TomlIntegration YAML description extraction
TomlIntegration prompt body generation
- integration-level regression tests
Expected outcome:
- block scalar descriptions keep YAML semantics
- generated
prompt excludes YAML frontmatter
- real
specify init --ai gemini --offline output 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
description values 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.
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:
Gemini and Tabnine consume
.tomlcommand files instead. That conversion currently has multiple defects:TomlIntegrationdoes not parse YAML frontmatter robustly.|/>are not preserved semanticallyTomlIntegrationcan include YAML frontmatter inside the generated TOMLprompt.CommandRegistrar.render_toml_command()path can emit invalid TOML for multilinedescriptionvalues.Why split this work
The issues share a theme but belong to two different rendering paths:
specify init --ai gemini/tabnineSplitting 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 generationExpected outcome:
promptexcludes YAML frontmatterspecify init --ai gemini --offlineoutput matches Gemini CLI expectationsTracking PR:
Stage 2: Fix legacy multiline TOML description rendering
Scope:
CommandRegistrar.render_toml_command()Expected outcome:
descriptionvalues render as parseable TOMLtomllibTracking PR:
Stage 3: Optional follow-up cleanup
Scope:
Expected outcome:
Validation notes
The issue was verified in two ways:
specify init --ai gemini --offlineOne concrete reproduction from the main integration path was that generated
.gemini/commands/*.tomlfiles contained YAML frontmatter insideprompt, even thoughdescriptionhad already been extracted to a TOML top-level field.