Skip to content

fix(skill-gen): eliminate manual maps to prevent undocumented commands#670

Merged
BYK merged 3 commits intomainfrom
fix/skill-gen-eliminate-manual-maps
Apr 6, 2026
Merged

fix(skill-gen): eliminate manual maps to prevent undocumented commands#670
BYK merged 3 commits intomainfrom
fix/skill-gen-eliminate-manual-maps

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Apr 6, 2026

Summary

  • Replaces the three manually-maintained maps (ROUTE_TO_REFERENCE, REFERENCE_TITLES, REFERENCE_DESCRIPTIONS) in generate-skill.ts with 1:1 route-to-file mapping
  • Titles and descriptions are now derived from route metadata (brief), matching the strategy used by generate-command-docs.ts
  • Adding a new route to app.ts now automatically produces a correctly-titled reference file with zero manual steps

Motivation

PR #662 identified that release and sourcemap routes had degraded skill documentation despite the fully automated generation pipeline. The root cause was that generate-skill.ts required manual map updates that generate-command-docs.ts did 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+spantraces.md, team+repoteams.md, cli+init+schemasetup.md. Each route now gets its own file.

Closes #662

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
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Bug Fixes 🐛

Init

  • Run commands without shell to eliminate injection surface by betegon in #665
  • Use opendir for listDir and validate symlinks during traversal by betegon in #663
  • Rename 'Custom Metrics' feature label to 'Metrics' by MathurAditya724 in #659
  • Add reactFeatures to feature display info by MathurAditya724 in #658
  • Generate spinner messages from payload params instead of server detail by MathurAditya724 in #655

Other

  • (errors) Separate informational notes from actionable alternatives in ContextError by BYK in #651
  • (skill-gen) Eliminate manual maps to prevent undocumented commands by BYK in #670
  • Fix set-commits --auto, document release workflow pitfalls by BYK in #650

Internal Changes 🔧

Init

  • Reuse resolveOrg for offline-first org detection by betegon in #666
  • Use mdKvTable and renderMarkdown for wizard summary by betegon in #661

Other

  • Extract createProjectWithDsn to deduplicate project creation by betegon in #667
  • Regenerate skill files and command docs by github-actions[bot] in eb1b19e7

Other

  • Update custom.css by stevenplewis in #653

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/pr-preview/pr-670/

Built to branch gh-pages at 2026-04-06 17:36 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: New capitalize function 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.

Create PR

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.

BYK added 2 commits April 6, 2026 17:35
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.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

Codecov Results 📊

134 passed | Total: 134 | Pass Rate: 100% | Execution Time: 0ms

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 1427 uncovered lines.
❌ Project coverage is 95.54%. Comparing base (base) to head (head).

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

@BYK BYK merged commit bda701b into main Apr 6, 2026
27 checks passed
@BYK BYK deleted the fix/skill-gen-eliminate-manual-maps branch April 6, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant