Skip to content
Source
Sign inSign up
TanStack/intent

feat: typecheck skill code blocks against the library's own source #289

MergedLadyBluenotes(GitHub profile, opens in a new tab)merged 19 commits intofeat/review-one-shot fromrefs/pull/289/headmerged by LadyBluenotes(GitHub profile, opens in a new tab)

Showing 6 changed files with 52 additions and 3 deletions (loading 3).

x
0 of 6 viewed, 6 left
5 additions and 0 deletions.changeset/skill-code-block-checks.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/intent': minor
+---
+​
+`validate` checks every fenced TypeScript and JavaScript block in a `SKILL.md` against the owning package's own types when TypeScript is available in the repository. A renamed export, a removed option, or a changed shape fails validation with the skill file and line. Imports of exports marked `@deprecated` produce warnings, and relative Markdown links must resolve. Names, modules, and globals a partial snippet leaves out are not reported. Repositories without TypeScript skip the code checks with a notice. Pending review items for skills report whether their examples still compile.
36 additions and 2 deletionsbenchmarks/intent/startup.bench.tsModified
View file
@@ -1,6 +1,9 @@
import { spawnSync } from 'node:child_process'
+import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'
+import { tmpdir } from 'node:os'
+import { join } from 'node:path'
import { fileURLToPath } from 'node:url'
-import { bench, describe } from 'vitest'
+import { afterAll, beforeAll, bench, describe } from 'vitest'
​
const cliPath = fileURLToPath(
new URL('../../packages/intent/dist/cli.mjs', import.meta.url),
@@ -11,8 +14,9 @@
time: 3_000,
​
-function runNode(args: Array<string>): void {
+function runNode(args: Array<string>, cwd?: string): void {
const result = spawnSync(process.execPath, args, {
+ cwd,
stdio: 'ignore',
timeout: 10_000,
})