Skip to content

Label Humanization

Requirements

  • MUST convert a kebab-case string to Title Case by splitting on -, capitalizing the first letter of each word, and joining with a space
  • MUST handle single-word inputs (no hyphens) by capitalizing the first letter
  • MUST handle empty strings by returning an empty string
  • Result MUST be used as the sole human-visible display label wherever a kebab-case name would otherwise appear

Title Override

Requirement: Title override takes precedence over humanization

When a title field is available on a Change or CapabilitySpec, it MUST be used verbatim as the display label in place of humanizeLabel(name). The override is not further processed.

Change title override used in sidebar
  • WHEN a change has title: "OpenAPI v3 Migration" in .openspec.yaml
  • AND generateOpenSpecSidebar() is called
  • THEN the sidebar item text is 'OpenAPI v3 Migration'
Change title override used in page heading
  • WHEN a change has title: "OpenAPI v3 Migration" in .openspec.yaml
  • AND generateChangeIndexPage() is called
  • THEN the page H1 heading is # OpenAPI v3 Migration
Spec title override used in sidebar
  • WHEN a spec's spec.md has frontmatter title: "REST API Docs"
  • AND generateOpenSpecSidebar() is called
  • THEN the sidebar item text is 'REST API Docs'
Spec title override used in page heading
  • WHEN a spec's spec.md has frontmatter title: "REST API Docs"
  • AND generateSpecPage() is called
  • THEN the page H1 heading is # REST API Docs
Falls back to humanizeLabel when no title provided
  • WHEN no title is set in .openspec.yaml or spec frontmatter
  • THEN humanizeLabel(name) is used as the display label