Skip to content

PromptScript API


Function: discoverNativeContent()

discoverNativeContent(dir): Promise\<Program | null>

Defined in: resolver/src/auto-discovery.ts:256

Synthesize a virtual Program AST from native content discovered in a directory.

Scans the given directory for: - Subdirectories containing SKILL.md -> synthesizes @skills block - .md files with tools: or model: frontmatter -> synthesizes @agents block - .md files with description: (but not tools: or model:) -> synthesizes @shortcuts block - CLAUDE.md, .clinerules, .cursorrules -> synthesizes @context block

Parameters

dir

string

Absolute path to the directory to scan

Returns

Promise\<Program | null>

A synthesized Program AST, or null if nothing was found or directory doesn't exist