fix(skill-gen): eliminate manual maps to prevent undocumented commands#670
fix(skill-gen): eliminate manual maps to prevent undocumented commands#670
Conversation
Replace the three manually-maintained maps (ROUTE_TO_REFERENCE, REFERENCE_TITLES, REFERENCE_DESCRIPTIONS) with 1:1 route-to-file mapping that derives titles and descriptions from route metadata. This matches the strategy used by generate-command-docs.ts and makes it impossible for new routes to produce degraded skill documentation. Closes #662
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛Init
Other
Internal Changes 🔧Init
Other
Other
🤖 This preview updates automatically when you update the PR. |
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: New
capitalizefunction not used in SKILL.md headings- Replaced inline capitalization with capitalize() function call at line 662 to ensure consistent acronym handling (API/CLI) across SKILL.md and reference files.
Or push these changes by commenting:
@cursor push 18916aa486
Preview (18916aa486)
diff --git a/script/generate-skill.ts b/script/generate-skill.ts
--- a/script/generate-skill.ts
+++ b/script/generate-skill.ts
@@ -659,7 +659,7 @@
continue;
}
- const titleCase = route.name.charAt(0).toUpperCase() + route.name.slice(1);
+ const titleCase = capitalize(route.name);
lines.push(`### ${titleCase}`);
lines.push("");
lines.push(route.brief);This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
Reviewed by Cursor Bugbot for commit faf862f. Configure here.
Addresses Cursor Bugbot feedback — the compact index headings now use the same capitalize() helper as reference file titles, so acronyms like API and CLI are properly uppercased in both places.
Codecov Results 📊✅ 134 passed | Total: 134 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 1427 uncovered lines. Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 95.55% 95.54% -0.01%
==========================================
Files 220 220 —
Lines 31987 31994 +7
Branches 0 0 —
==========================================
+ Hits 30563 30567 +4
- Misses 1424 1427 +3
- Partials 0 0 —Generated by Codecov Action |


Summary
ROUTE_TO_REFERENCE,REFERENCE_TITLES,REFERENCE_DESCRIPTIONS) ingenerate-skill.tswith 1:1 route-to-file mappingbrief), matching the strategy used bygenerate-command-docs.tsapp.tsnow automatically produces a correctly-titled reference file with zero manual stepsMotivation
PR #662 identified that
releaseandsourcemaproutes had degraded skill documentation despite the fully automated generation pipeline. The root cause was thatgenerate-skill.tsrequired manual map updates thatgenerate-command-docs.tsdid not — and the silent fallback (?? route.name) masked the problem by producing subtly wrong output that CI's staleness check couldn't distinguish from correct output.Rather than adding validation on top of the manual maps, this PR eliminates them entirely so the two generation pipelines share the same self-healing strategy: one file per visible route, metadata derived from the route tree.
Trade-off
Reference files go from 14 (grouped) to 18 (1:1). The 3 former groupings were:
trace+span→traces.md,team+repo→teams.md,cli+init+schema→setup.md. Each route now gets its own file.Closes #662