Checks: findings with a skill get Open guide (context menu and a link on the card) to the shipped skills/<name>/SKILL.md; known-skill list kept equal to skills/ by a test

This commit is contained in:
CRTkafa 2026-10-23 09:22:22 +08:00
parent 4a74989a95
commit a656240bfb
7 changed files with 53 additions and 1 deletions

12
cli/lib/skill-guide.ts Normal file
View file

@ -0,0 +1,12 @@
// The guide of a finding's skill: skills/<name>/SKILL.md ships with the toolchain (npm package, plugin) and is published
// in the public repo, which is where "Open guide" points (storebound.dev does not host the skills). Only known skill
// names get a link (tests keep the list equal to the skills/ folder), so a finding never opens a made-up page.
export const SKILLS_BASE = 'https://git.crt.fyi/CRT/storebound/src/branch/main/skills';
export const KNOWN_SKILLS: readonly string[] = ['account-deletion', 'adhoc-distribution', 'ads-levelplay-checks', 'ads-mediation-checks', 'app-icons', 'apple-ads', 'app-previews', 'appstore-first-release', 'app-store-promotion', 'aso-basics', 'build-and-sign', 'console-autofill', 'export-compliance', 'game-services', 'listing-localization', 'migrate-from-fastlane', 'play-first-release', 'portfolio-originality', 'ppp-pricing', 'privacy-manifest', 'privacy-policy', 'release-flows', 'release-management', 'revenuecat-sync', 'review-access', 'review-rejections', 'review-replies', 'store-analytics', 'store-api', 'store-declarations', 'store-health', 'store-iap-setup', 'store-pitfalls', 'store-preflight', 'store-screenshots', 'store-subscriptions', 'testflight', 'web-presence', 'whats-new'];
/** The guide URL of a skill name (a finding's `skill`), or null when it is not a skill storebound ships. */
export function skillGuideUrl(skill: string | null | undefined): string | null {
const s = skill?.trim().replace(/^skills\//, '').replace(/\/SKILL\.md$/i, '');
return s && KNOWN_SKILLS.includes(s) ? `${SKILLS_BASE}/${s}/SKILL.md` : null;
}