Skip to content

openspec config template mixes sequence and mapping under rules.apply (invalid YAML) #1007

Description

@juansacdev

📝 Bug Description

internal/assets/skills/_shared/openspec-convention.md documents the openspec/config.yaml shape used by SDD phases. The rules.apply example mixes a block sequence with mapping keys under the same YAML node:

rules:
  apply:
    - Follow existing code patterns
    tdd: false           # Set to true to enable RED-GREEN-REFACTOR
    test_command: ""

A YAML node cannot be both a sequence and a mapping — this is invalid YAML, not just a style nit. Any strict YAML parser rejects it, so a project that copies this exact snippet into its own openspec/config.yaml (which is exactly what sdd-init guidance and the shared convention doc tell agents to do) ends up with a config file that fails to parse.

🔄 Steps to Reproduce

  1. Copy the rules.apply block from internal/assets/skills/_shared/openspec-convention.md (lines ~100-103) into a YAML file.
  2. Parse it with a strict YAML loader, e.g.:
    python3 -c "import yaml; yaml.safe_load(open('f.yaml'))"
    or run yamllint on it.

✅ Expected Behavior

The documented openspec/config.yaml template should be valid YAML that parses cleanly, since sdd-init and other SDD phases are instructed to create real project config files from it.

❌ Actual Behavior

The parser raises a YAML error because rules.apply mixes a - sequence item with sibling mapping keys (tdd, test_command) under the same node.

Notes

  • Confirmed via rg -n "apply:" --type md --type go across the repo that this specific mixing bug appears only in this one file — the analogous block in docs/openspec-config.md and the repo's own openspec/config.yaml keep apply: as a pure sequence, so they don't hit the bug.
  • Confirmed via rg -n "test_command|strict_tdd|rules" --type go that no Go code parses openspec/config.yaml's rules section — it's prompt/documentation-consumed only, so the fix is a documentation-shape change with no parser coupling to worry about.
  • Happy to open a PR with the minimal fix (nesting the guideline bullets under a guidelines: key, keeping tdd/test_command as siblings) once this is approved.

🖥️ Environment

Gentle AI Version: N/A — found via static inspection of the template file, not a runtime gga behavior.
Operating System: macOS
AI Agent / Client: N/A (documentation/template bug, not agent-specific)

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:approvedApproved for implementation — PRs can now be opened

    Type

    No type

    Fields

    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