Skip to content

Commit bda701b

Browse files
authored
fix(skill-gen): eliminate manual maps to prevent undocumented commands (#670)
## 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`+`span` → `traces.md`, `team`+`repo` → `teams.md`, `cli`+`init`+`schema` → `setup.md`. Each route now gets its own file. Closes #662
1 parent 72a8eb2 commit bda701b

File tree

22 files changed

+322
-323
lines changed

22 files changed

+322
-323
lines changed

docs/public/.well-known/skills/index.json

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,22 @@
77
"SKILL.md",
88
"references/api.md",
99
"references/auth.md",
10-
"references/dashboards.md",
11-
"references/events.md",
12-
"references/issues.md",
13-
"references/logs.md",
14-
"references/organizations.md",
15-
"references/projects.md",
10+
"references/cli.md",
11+
"references/dashboard.md",
12+
"references/event.md",
13+
"references/init.md",
14+
"references/issue.md",
15+
"references/log.md",
16+
"references/org.md",
17+
"references/project.md",
1618
"references/release.md",
17-
"references/setup.md",
19+
"references/repo.md",
20+
"references/schema.md",
1821
"references/sourcemap.md",
19-
"references/teams.md",
20-
"references/traces.md",
21-
"references/trials.md"
22+
"references/span.md",
23+
"references/team.md",
24+
"references/trace.md",
25+
"references/trial.md"
2226
]
2327
}
2428
]

plugins/sentry-cli/skills/sentry-cli/SKILL.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ Work with Sentry organizations
276276
- `sentry org list` — List organizations
277277
- `sentry org view <org>` — View details of an organization
278278

279-
→ Full flags and examples: `references/organizations.md`
279+
→ Full flags and examples: `references/org.md`
280280

281281
### Project
282282

@@ -287,7 +287,7 @@ Work with Sentry projects
287287
- `sentry project list <org/project>` — List projects
288288
- `sentry project view <org/project>` — View details of a project
289289

290-
→ Full flags and examples: `references/projects.md`
290+
→ Full flags and examples: `references/project.md`
291291

292292
### Issue
293293

@@ -299,25 +299,25 @@ Manage Sentry issues
299299
- `sentry issue plan <issue>` — Generate a solution plan using Seer AI
300300
- `sentry issue view <issue>` — View details of a specific issue
301301

302-
→ Full flags and examples: `references/issues.md`
302+
→ Full flags and examples: `references/issue.md`
303303

304304
### Event
305305

306306
View Sentry events
307307

308308
- `sentry event view <org/project/event-id...>` — View details of a specific event
309309

310-
→ Full flags and examples: `references/events.md`
310+
→ Full flags and examples: `references/event.md`
311311

312-
### Api
312+
### API
313313

314314
Make an authenticated API request
315315

316316
- `sentry api <endpoint>` — Make an authenticated API request
317317

318318
→ Full flags and examples: `references/api.md`
319319

320-
### Cli
320+
### CLI
321321

322322
CLI-related commands
323323

@@ -326,7 +326,7 @@ CLI-related commands
326326
- `sentry cli setup` — Configure shell integration
327327
- `sentry cli upgrade <version>` — Update the Sentry CLI to the latest version
328328

329-
→ Full flags and examples: `references/setup.md`
329+
→ Full flags and examples: `references/cli.md`
330330

331331
### Dashboard
332332

@@ -339,7 +339,7 @@ Manage Sentry dashboards
339339
- `sentry dashboard widget edit <org/project/dashboard...>` — Edit a widget in a dashboard
340340
- `sentry dashboard widget delete <org/project/dashboard...>` — Delete a widget from a dashboard
341341

342-
→ Full flags and examples: `references/dashboards.md`
342+
→ Full flags and examples: `references/dashboard.md`
343343

344344
### Release
345345

@@ -363,15 +363,15 @@ Work with Sentry repositories
363363

364364
- `sentry repo list <org/project>` — List repositories
365365

366-
→ Full flags and examples: `references/teams.md`
366+
→ Full flags and examples: `references/repo.md`
367367

368368
### Team
369369

370370
Work with Sentry teams
371371

372372
- `sentry team list <org/project>` — List teams
373373

374-
→ Full flags and examples: `references/teams.md`
374+
→ Full flags and examples: `references/team.md`
375375

376376
### Log
377377

@@ -380,7 +380,7 @@ View Sentry logs
380380
- `sentry log list <org/project-or-trace-id...>` — List logs from a project
381381
- `sentry log view <org/project/log-id...>` — View details of one or more log entries
382382

383-
→ Full flags and examples: `references/logs.md`
383+
→ Full flags and examples: `references/log.md`
384384

385385
### Sourcemap
386386

@@ -398,7 +398,7 @@ List and view spans in projects or traces
398398
- `sentry span list <org/project/trace-id...>` — List spans in a project or trace
399399
- `sentry span view <trace-id/span-id...>` — View details of specific spans
400400

401-
→ Full flags and examples: `references/traces.md`
401+
→ Full flags and examples: `references/span.md`
402402

403403
### Trace
404404

@@ -408,7 +408,7 @@ View distributed traces
408408
- `sentry trace view <org/project/trace-id...>` — View details of a specific trace
409409
- `sentry trace logs <org/trace-id...>` — View logs associated with a trace
410410

411-
→ Full flags and examples: `references/traces.md`
411+
→ Full flags and examples: `references/trace.md`
412412

413413
### Trial
414414

@@ -417,23 +417,23 @@ Manage product trials
417417
- `sentry trial list <org>` — List product trials
418418
- `sentry trial start <name> <org>` — Start a product trial
419419

420-
→ Full flags and examples: `references/trials.md`
420+
→ Full flags and examples: `references/trial.md`
421421

422422
### Init
423423

424424
Initialize Sentry in your project (experimental)
425425

426426
- `sentry init <target> <directory>` — Initialize Sentry in your project (experimental)
427427

428-
→ Full flags and examples: `references/setup.md`
428+
→ Full flags and examples: `references/init.md`
429429

430430
### Schema
431431

432432
Browse the Sentry API schema
433433

434434
- `sentry schema <resource...>` — Browse the Sentry API schema
435435

436-
→ Full flags and examples: `references/setup.md`
436+
→ Full flags and examples: `references/schema.md`
437437

438438
## Global Options
439439

plugins/sentry-cli/skills/sentry-cli/references/api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
name: sentry-cli-api
33
version: 0.25.0-dev.0
4-
description: Make arbitrary Sentry API requests
4+
description: Make an authenticated API request
55
requires:
66
bins: ["sentry"]
77
auth: true
88
---
99

10-
# API Command
10+
# API Commands
1111

1212
Make an authenticated API request
1313

plugins/sentry-cli/skills/sentry-cli/references/auth.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
name: sentry-cli-auth
33
version: 0.25.0-dev.0
4-
description: Authenticate with Sentry via OAuth or API tokens
4+
description: Authenticate with Sentry
55
requires:
66
bins: ["sentry"]
77
auth: true
88
---
99

10-
# Authentication Commands
10+
# Auth Commands
1111

1212
Authenticate with Sentry
1313

plugins/sentry-cli/skills/sentry-cli/references/setup.md renamed to plugins/sentry-cli/skills/sentry-cli/references/cli.md

Lines changed: 3 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
---
2-
name: sentry-cli-setup
2+
name: sentry-cli-cli
33
version: 0.25.0-dev.0
4-
description: Configure the CLI, install integrations, and manage upgrades
4+
description: CLI-related commands
55
requires:
66
bins: ["sentry"]
77
auth: true
88
---
99

10-
# CLI Setup Commands
10+
# CLI Commands
1111

1212
CLI-related commands
1313

14-
Initialize Sentry in your project (experimental)
15-
16-
Browse the Sentry API schema
17-
1814
### `sentry cli feedback <message...>`
1915

2016
Send feedback about the CLI
@@ -99,69 +95,4 @@ sentry cli upgrade nightly
9995
sentry cli upgrade stable
10096
```
10197

102-
### `sentry init <target> <directory>`
103-
104-
Initialize Sentry in your project (experimental)
105-
106-
**Flags:**
107-
- `-y, --yes - Non-interactive mode (accept defaults)`
108-
- `--dry-run - Preview changes without applying them`
109-
- `--features <value>... - Features to enable: errors,tracing,logs,replay,metrics,profiling,sourcemaps,crons,ai-monitoring,user-feedback`
110-
- `-t, --team <value> - Team slug to create the project under`
111-
112-
**Examples:**
113-
114-
```bash
115-
# Interactive setup
116-
sentry init
117-
118-
# Non-interactive with auto-yes
119-
sentry init -y
120-
121-
# Dry run to preview changes
122-
sentry init --dry-run
123-
124-
# Target a subdirectory
125-
sentry init ./my-app
126-
127-
# Use a specific org (auto-detect project)
128-
sentry init acme/
129-
130-
# Use a specific org and project
131-
sentry init acme/my-app
132-
133-
# Assign a team when creating a new project
134-
sentry init acme/ --team backend
135-
136-
# Enable specific features
137-
sentry init --features profiling,replay
138-
```
139-
140-
### `sentry schema <resource...>`
141-
142-
Browse the Sentry API schema
143-
144-
**Flags:**
145-
- `--all - Show all endpoints in a flat list`
146-
- `-q, --search <value> - Search endpoints by keyword`
147-
148-
**Examples:**
149-
150-
```bash
151-
# List all API resources
152-
sentry schema
153-
154-
# Browse issue endpoints
155-
sentry schema issues
156-
157-
# View details for a specific operation
158-
sentry schema issues list
159-
160-
# Search for monitoring-related endpoints
161-
sentry schema --search monitor
162-
163-
# Flat list of every endpoint
164-
sentry schema --all
165-
```
166-
16798
All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags.

plugins/sentry-cli/skills/sentry-cli/references/dashboards.md renamed to plugins/sentry-cli/skills/sentry-cli/references/dashboard.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
name: sentry-cli-dashboards
2+
name: sentry-cli-dashboard
33
version: 0.25.0-dev.0
4-
description: List, view, and create Sentry dashboards
4+
description: Manage Sentry dashboards
55
requires:
66
bins: ["sentry"]
77
auth: true

plugins/sentry-cli/skills/sentry-cli/references/events.md renamed to plugins/sentry-cli/skills/sentry-cli/references/event.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
name: sentry-cli-events
2+
name: sentry-cli-event
33
version: 0.25.0-dev.0
4-
description: View individual error events
4+
description: View Sentry events
55
requires:
66
bins: ["sentry"]
77
auth: true
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
name: sentry-cli-init
3+
version: 0.25.0-dev.0
4+
description: Initialize Sentry in your project (experimental)
5+
requires:
6+
bins: ["sentry"]
7+
auth: true
8+
---
9+
10+
# Init Commands
11+
12+
Initialize Sentry in your project (experimental)
13+
14+
### `sentry init <target> <directory>`
15+
16+
Initialize Sentry in your project (experimental)
17+
18+
**Flags:**
19+
- `-y, --yes - Non-interactive mode (accept defaults)`
20+
- `--dry-run - Preview changes without applying them`
21+
- `--features <value>... - Features to enable: errors,tracing,logs,replay,metrics,profiling,sourcemaps,crons,ai-monitoring,user-feedback`
22+
- `-t, --team <value> - Team slug to create the project under`
23+
24+
**Examples:**
25+
26+
```bash
27+
# Interactive setup
28+
sentry init
29+
30+
# Non-interactive with auto-yes
31+
sentry init -y
32+
33+
# Dry run to preview changes
34+
sentry init --dry-run
35+
36+
# Target a subdirectory
37+
sentry init ./my-app
38+
39+
# Use a specific org (auto-detect project)
40+
sentry init acme/
41+
42+
# Use a specific org and project
43+
sentry init acme/my-app
44+
45+
# Assign a team when creating a new project
46+
sentry init acme/ --team backend
47+
48+
# Enable specific features
49+
sentry init --features profiling,replay
50+
```
51+
52+
All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags.

plugins/sentry-cli/skills/sentry-cli/references/issues.md renamed to plugins/sentry-cli/skills/sentry-cli/references/issue.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
name: sentry-cli-issues
2+
name: sentry-cli-issue
33
version: 0.25.0-dev.0
4-
description: List, view, and analyze Sentry issues with AI
4+
description: Manage Sentry issues
55
requires:
66
bins: ["sentry"]
77
auth: true

plugins/sentry-cli/skills/sentry-cli/references/logs.md renamed to plugins/sentry-cli/skills/sentry-cli/references/log.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
name: sentry-cli-logs
2+
name: sentry-cli-log
33
version: 0.25.0-dev.0
4-
description: List and stream logs from Sentry projects
4+
description: View Sentry logs
55
requires:
66
bins: ["sentry"]
77
auth: true

0 commit comments

Comments
 (0)