Skip to content

PromptScript API


Interface: CanonicalFormatter

Defined in: compiler/src/types.ts:100

Canonical formatter contract for immutable pipeline consumers.

Extends

Properties

defaultConvention

readonly defaultConvention: string

Defined in: compiler/src/types.ts:72

Default convention for this formatter

Inherited from

Formatter.defaultConvention


description

readonly description: string

Defined in: compiler/src/types.ts:70

Human-readable description

Inherited from

Formatter.description


name

readonly name: string

Defined in: compiler/src/types.ts:66

Formatter name (e.g., "github", "claude", "cursor")

Inherited from

Formatter.name


outputPath

readonly outputPath: string

Defined in: compiler/src/types.ts:68

Output path pattern

Inherited from

Formatter.outputPath

Methods

format()

format(ast, options?): FormatterOutput

Defined in: compiler/src/types.ts:74

Format the AST to target format

Parameters

ast

Program

options?

FormatOptions

Returns

FormatterOutput

Inherited from

Formatter.format


formatCanonical()

formatCanonical(ast, options?): FormatterOutput

Defined in: compiler/src/types.ts:101

Optional canonical entry point for migrated formatters.

Parameters

ast

CanonicalProgram

options?

FormatOptions

Returns

FormatterOutput

Overrides

Formatter.formatCanonical


getSkillBasePath()

getSkillBasePath(): string | null

Defined in: compiler/src/types.ts:78

Base path for skills (e.g., '.claude/skills'), or null if no skill support

Returns

string | null

Inherited from

Formatter.getSkillBasePath


getSkillFileName()

getSkillFileName(): string | null

Defined in: compiler/src/types.ts:80

Skill file name (e.g., 'SKILL.md' or 'skill.md'), or null if no skill support

Returns

string | null

Inherited from

Formatter.getSkillFileName


referencesMode()

referencesMode(): "none" | "directory" | "inline"

Defined in: compiler/src/types.ts:82

How this formatter handles skill references: 'directory', 'inline', or 'none'

Returns

"none" | "directory" | "inline"

Inherited from

Formatter.referencesMode


transformInjectedSkillContent()?

optional transformInjectedSkillContent(content): string

Defined in: compiler/src/types.ts:89

Optional hook to transform the raw content of a pass-through skill file (e.g. the bundled PromptScript SKILL.md) before it is written. Formatters whose target tools enforce frontmatter schemas can override this to strip unsupported fields.

Parameters

content

string

Returns

string

Inherited from

Formatter.transformInjectedSkillContent