Tasks
1. Extract description from spec content
- [x] 1.1 Add
extractSpecDescription(content: string): string | undefinedinsrc/utils.tsthat finds the first### Requirement:heading, takes the paragraph text immediately following it, extracts the first sentence (up to.,?, or!), trims it, and caps at 160 characters at word boundary with… - [x] 1.2 Return
undefinedif no### Requirement:heading is found
2. Strip delta section markers
- [x] 2.1 Add
stripDeltaMarkers(content: string): stringthat removes lines matching/^## (ADDED|MODIFIED|REMOVED) Requirements\s*$/and collapses resulting consecutive blank lines to a single blank line
3. Transform scenario blocks to VitePress detail containers
- [x] 3.1 Add
transformScenarios(content: string): stringthat replaces#### Scenario: <title>lines with:::details <title>and inserts a closing:::before the next heading of any level (/^#{1,6} /) or at end of content — handling back-to-back scenarios correctly
4. Update generateSpecPage to apply all three transformations
- [x] 4.1 Call
extractSpecDescription(spec.content)and prepend---\ndescription: "..."\n---\n\nwhen a description is found - [x] 4.2 Apply
stripDeltaMarkers()tospec.contentbefore rendering - [x] 4.3 Apply
transformScenarios()afterstripDeltaMarkers()
5. Update tests
- [x] 5.1 Add unit tests for
extractSpecDescription: with requirement, without requirement, long sentence (truncation), sentence with special characters - [x] 5.2 Add unit tests for
stripDeltaMarkers: ADDED/MODIFIED/REMOVED headers removed, content preserved, plain specs unaffected, consecutive blank lines collapsed - [x] 5.3 Add unit tests for
transformScenarios: single scenario, back-to-back scenarios, scenario at EOF, no scenarios (passthrough) - [x] 5.4 Update
generateSpecPagetests: assert frontmatter present when description extractable, assert no## ADDED Requirementsin output, assert:::detailscontainers present