1. Types
- [x] 1.1 Add
collapsed?: booleantoSidebarIteminterface insrc/types.ts - [x] 1.2 Add
NavItemtype ({ text: string, link: string }) tosrc/types.ts - [x] 1.3 Update
OpenSpecPluginOptionsto accept optionaltextfield for nav label override
2. Tag-Grouped Sidebar
- [x] 2.1 In
src/utils.ts, creategroupEndpointsByTag(endpoints: ParsedEndpoint[])that groups endpoints by their first tag (fallback:"Other") and sorts groups alphabetically - [x] 2.2 Update
generateSidebarFromSpec()to callgroupEndpointsByTag()and return{ text, collapsed: false, items }[]instead of a flat array - [x] 2.3 Write/update tests in
src/__tests__/utils.test.tsto assert grouped sidebar output shape
3. Index Page Summary Table
- [x] 3.1 Update
generateIndexMarkdown()insrc/utils.tsto append a| Method | Path | Summary |table after the existing heading and links - [x] 3.2 Sort table rows by tag (alphabetical) then path (alphabetical)
- [x] 3.3 Write/update tests to assert the table is present in index page output
4. openspecNav Helper
- [x] 4.1 Add
openspecNav(options: { spec: string, outDir: string, text?: string }): NavItemfunction tosrc/utils.ts - [x] 4.2 Implement: load spec via existing
loadSpec(), readinfo.titleas default text, derive link as/${outDir}/ - [x] 4.3 Throw descriptive error when spec file is not found (include path in message)
- [x] 4.4 Export
openspecNavfromsrc/index.ts - [x] 4.5 Write tests for
openspecNavcovering default label, custom label, and missing-file error
5. Build & Validation
- [x] 5.1 Run
npm run lintand fix any TypeScript errors - [x] 5.2 Run
npm testand confirm all tests pass - [x] 5.3 Run
npm run buildand confirm ESM + CJS output includesopenspecNavexport