Skip to content

Track 3-stage fix for Gemini/Tabnine TOML command generation #2095

@RbBtSn0w

Description

@RbBtSn0w

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:

  1. TomlIntegration does not parse YAML frontmatter robustly.
    • multiline descriptions using | / > are not preserved semantically
  2. TomlIntegration can include YAML frontmatter inside the generated TOML prompt.
    • this is structurally wrong according to the Gemini CLI custom command format
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions