Tasks
1. Extend humanizeLabel in src/utils.ts
- [x] 1.1 Add the acronym dictionary as a module-level
constmapping lowercase tokens to canonical display strings (api→API, rest→REST, graphql→GraphQL, grpc→gRPC, openapi→OpenAPI, oauth→OAuth, oauth2→OAuth2, http→HTTP, https→HTTPS, url→URL, uri→URI, sdk→SDK, ui→UI, ux→UX, id→ID, db→DB, sql→SQL, css→CSS, html→HTML, json→JSON, yaml→YAML, xml→XML, jwt→JWT, ci→CI, cd→CD) - [x] 1.2 Update
humanizeLabel()algorithm: for each token, check version pattern/^v\d+$/first (keep as-is), then dictionary lookup, then fallback to capitalize-first-letter
2. Add title to data types in src/types.ts
- [x] 2.1 Add
title?: stringto theChangeinterface - [x] 2.2 Add
title?: stringto theCapabilitySpecinterface
3. Read title in readOpenSpecFolder() in src/utils.ts
- [x] 3.1 When building a
Changeobject, readtitlefrom the parsed.openspec.yamlmetadata (already available asmeta.title) and pass it through - [x] 3.2 Add a
parseFrontmatterTitle(content: string): string | undefinedhelper that extractstitle:from a YAML frontmatter block using a simple regex (no extra package needed) - [x] 3.3 When building a
CapabilitySpecobject, callparseFrontmatterTitleon the spec content and settitleon the object
4. Apply title ?? humanizeLabel(name) at all display sites
- [x] 4.1 In
generateSpecPage: usespec.title ?? humanizeLabel(spec.name)for the H1 - [x] 4.2 In
generateChangeIndexPage: usechange.title ?? humanizeLabel(change.name)for the H1 - [x] 4.3 In
generateSpecsIndexPage: usespec.title ?? humanizeLabel(spec.name)for link text - [x] 4.4 In
generateChangesIndexPage: usechange.title ?? humanizeLabel(change.name)for link text (active and archived) - [x] 4.5 In
generateOpenSpecSidebar: usespec.title ?? humanizeLabel(spec.name)for spec items andchange.title ?? humanizeLabel(change.name)for change group text
5. Update tests
- [x] 5.1 Add unit tests for the extended
humanizeLabelcovering: known acronym (rest-api→REST API), version token (openapi-v3→OpenAPI v3), unknown word fallback, empty string - [x] 5.2 Add a fixture spec with frontmatter
title:and assert it is used as the display label ingenerateSpecPageand sidebar - [x] 5.3 Add a fixture change with
title:in.openspec.yamland assert it is used ingenerateChangeIndexPageand sidebar