DashboardcliDistillation

Distillation

ID: b4aa7993-adb0-4e6b-bac8-466e338e1cd3
Session: 1DKpanpHw0Um
Generation: 0
Tokens: 1280
R_compression: 20.343
C_norm: 0.000
Archived: Yes
Created: 2026-09-09 10:24:55
Source IDs:
["lore_tm_v1_mkNUAtsRGjyyd9SzABr-wO7eEvMZooZIk_mTlcoyFcM"]

Observations

🔴 (09:58) User provided packages/cli/script/generate-skill.ts lines 100–529. SKILL_DESCRIPTION is "Guide for using the Sentry CLI to interact with Sentry from the command line. Use when the user asks about viewing issues, events, projects, organizations, making API calls, or authenticating with Sentry via CLI.".

🔴 (09:58) packages/cli/script/generate-skill.ts defines preferred ROUTE_ORDER exactly as ["help", "auth", "org", "project", "issue", "event", "api"]; unlisted routes sort afterward with order value 999.

🔴 (09:58) packages/cli/script/generate-skill.ts defines GLOBAL_FLAG_NAMES as "json", "fields", "help", "helpAll", and "log-level"; these globally injected flags are omitted from the compact index and mentioned once in the Global Options section.

🔴 (09:58) Markdown parsing in packages/cli/script/generate-skill.ts uses FRONTMATTER_REGEX = /^---\n[\s\S]*?\n---\n/, CODE_BLOCK_REGEX = /```(\w*)\n([\s\S]*?)```/g, and PACKAGE_MANAGER_REGEX = /<PackageManagerCode[\s\S]*?npm="([^"]+)"/.

🔴 (09:58) stripFrontmatter() removes leading YAML frontmatter; stripMdxComponents() removes single-line import and export statements, self-closing uppercase JSX components, paired uppercase JSX components, collapses 3-or-more newlines to 2, and trims the result.

🔴 (09:58) extractSection(markdown, heading) locates headings at levels 1–6 using escaped heading text, returns content until the next heading of the same or higher level, and returns null when the requested heading is absent.

🔴 (09:58) extractCodeBlocks(markdown, language?) returns trimmed { code, lang } entries for fenced code blocks and optionally filters them by exact language; escapeRegex() escapes regex-special characters.

🔴 (09:58) loadDoc(relativePath) reads from ${DOCS_PATH}/${relativePath}, returns null when inaccessible, and otherwise applies stripFrontmatter() followed by stripMdxComponents().

🔴 (09:58) generateInstallSection(installSection, rawContent) emits ### Installation, collects bash blocks, extracts an npm command from <PackageManagerCode ... npm="...">, and, when both forms exist, separates the npm command with # Or install via npm/pnpm/bun.

🔴 (09:58) generateAuthSection(authSection) emits ### Authentication and combines all extracted bash blocks into one fenced bash block.

🔴 (09:58) loadPrerequisites() reads ${DOCS_PATH}/getting-started.mdx; when available, it generates ## Prerequisites from the Install Script and Authentication sections and states The CLI must be installed and authenticated before use.; when unavailable, it uses getDefaultPrerequisites().

🔴 (09:58) getDefaultPrerequisites() documents installation commands curl https://cli.sentry.dev/install -fsS | bash and npm install -g sentry, plus authentication commands sentry auth, sentry auth --token YOUR_SENTRY_API_TOKEN, and sentry auth status; OAuth login is labeled recommended.

🔴 (09:58) appendExample(map, key, code) appends a code block to the existing string[] for a command path or creates a new array when needed.

🔴 (09:58) collectCommandPaths(tokens, examples) recognizes depth-3 headings whose text resolves through extractCommandPathFromHeading(), returns command paths in token order, and initializes each missing path in the examples map with [].

🔴 (09:58) associateCodeBlocks() walks marked tokens sequentially, tracks the current depth-3 command heading, and associates each bash code block either directly with that heading or via matchExampleToCommand(code, commandPaths, groupFallback, defaultCommandPath); groupFallback is sentry ${commandGroup}.

🔴 (09:58) loadCommandExamples(commandGroup, defaultCommandName?) loads commands/${commandGroup}.md, parses it with marked.lexer(), collects command paths, derives an optional default path as sentry ${commandGroup} ${defaultCommandName}, and associates bash blocks with commands. It supports both auto-generated ### \sentry ...`reference headings and hand-written## Examplessections using heading context or content matching; missing docs produce an emptyMap`.

🔴 (09:58) loadCommandsOverview() loads commands/index.md and extracts Global Options, JSON Output, and Opening in Browser into { globalOptions, jsonOutput, webFlag }, using empty strings for missing sections and returning null when the file is absent.

🔴 (09:58) loadAgentGuidance() loads agent-guidance.md, corresponding to docs/src/content/docs/agent-guidance.md, with frontmatter and title/content processing delegated to loadDoc().

🔴 (09:58) extractRoutes(routeMap) iterates routeMap.getAllEntries(), skips hidden entries, loads documentation examples per top-level route, and determines a route-map default command via findDefaultCommandName(target). Route groups call extractRouteGroupCommands(target, routeName, docExamples); standalone commands use path sentry ${routeName}, retrieve docExamples.get(path) ?? [], and call buildCommandInfo(target, path, examples).

🔴 (09:58) sortRoutes(routeInfos) returns a copied, sorted array based on ROUTE_ORDER; routes absent from the preferred list receive order 999.