Skip to content

BundleFormatter

PromptScript API


Defined in: formatters/src/formatters/bundle.ts:26

Compiles @prompts entries to portable, content-hashed JSON bundles.

Writes prompts/<key>.json for each prompt and prompts/index.json as the primary file. Writes nothing for a program without prompts.

Extends

  • PromptFormatter

Constructors

Constructor

new BundleFormatter(): BundleFormatter

Defined in: formatters/src/formatters/bundle.ts:27

Returns

BundleFormatter

Overrides

PromptFormatter.constructor

Properties

defaultConvention

readonly defaultConvention: "markdown" = 'markdown'

Defined in: formatters/src/prompt/prompt-formatter.ts:68

Default convention for this formatter

Inherited from

PromptFormatter.defaultConvention


description

readonly description: string

Defined in: formatters/src/prompt/prompt-formatter.ts:73

Inherited from

PromptFormatter.description


name

readonly name: string

Defined in: formatters/src/prompt/prompt-formatter.ts:71

Inherited from

PromptFormatter.name


outputPath

readonly outputPath: string

Defined in: formatters/src/prompt/prompt-formatter.ts:72

Inherited from

PromptFormatter.outputPath

Methods

format()

format(ast, options?): FormatterOutput

Defined in: formatters/src/prompt/prompt-formatter.ts:78

Transform AST to target format

Parameters

ast

Program

options?

FormatOptions

Returns

FormatterOutput

Inherited from

PromptFormatter.format


getSkillBasePath()

getSkillBasePath(): string | null

Defined in: formatters/src/prompt/prompt-formatter.ts:120

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

Returns

string | null

Inherited from

PromptFormatter.getSkillBasePath


getSkillFileName()

getSkillFileName(): string | null

Defined in: formatters/src/prompt/prompt-formatter.ts:124

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

Returns

string | null

Inherited from

PromptFormatter.getSkillFileName


referencesMode()

referencesMode(): "none"

Defined in: formatters/src/prompt/prompt-formatter.ts:128

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

Returns

"none"

Inherited from

PromptFormatter.referencesMode


render()

protected render(built): PromptRender

Defined in: formatters/src/formatters/bundle.ts:35

Parameters

built

BuiltPrompts

Returns

PromptRender

Overrides

PromptFormatter.render


getSupportedVersions()

static getSupportedVersions(): FormatterVersionMap

Defined in: formatters/src/formatters/bundle.ts:31

Returns

FormatterVersionMap