diff --git a/.changeset/wise-koalas-climb.md b/.changeset/wise-koalas-climb.md new file mode 100644 index 000000000..1514c507e --- /dev/null +++ b/.changeset/wise-koalas-climb.md @@ -0,0 +1,5 @@ +--- +type: Fixed +pr: 3435 +--- +**`/gsd-debug` command metadata now parses as valid YAML** — external YAML tooling and command-contract validation no longer fail on the unquoted argument hint. diff --git a/commands/gsd/debug.md b/commands/gsd/debug.md index 1fefac827..0aa94b3cf 100644 --- a/commands/gsd/debug.md +++ b/commands/gsd/debug.md @@ -1,7 +1,7 @@ --- name: gsd:debug description: Systematic debugging with persistent state across context resets -argument-hint: [list | status | continue | --diagnose] [issue description] +argument-hint: "[list | status | continue | --diagnose] [issue description]" allowed-tools: - Read - Write diff --git a/tests/bug-3431-debug-command-yaml.test.cjs b/tests/bug-3431-debug-command-yaml.test.cjs new file mode 100644 index 000000000..66f59e4f8 --- /dev/null +++ b/tests/bug-3431-debug-command-yaml.test.cjs @@ -0,0 +1,28 @@ +// allow-test-rule: source-text-is-the-product +// Command markdown frontmatter is the deployed contract; this regression test +// verifies the real YAML surface that external parsers consume. + +'use strict'; + +const { test } = require('node:test'); +const assert = require('node:assert/strict'); +const fs = require('node:fs'); +const path = require('node:path'); +const { parseFrontmatter } = require('./helpers.cjs'); + +const DEBUG_COMMAND_PATH = path.join(__dirname, '..', 'commands', 'gsd', 'debug.md'); + +function readFrontmatter(filePath) { + return parseFrontmatter(fs.readFileSync(filePath, 'utf8')); +} + +test('#3431: commands/gsd/debug.md frontmatter parses as YAML and preserves argument-hint', () => { + const frontmatter = readFrontmatter(DEBUG_COMMAND_PATH); + + assert.equal(frontmatter.name, 'gsd:debug'); + assert.equal( + frontmatter['argument-hint'], + '[list | status | continue | --diagnose] [issue description]', + 'argument-hint should remain user-visible text after YAML parsing' + ); +});