includes lets you define shared system instructions once and reuse them across prompts. Included instructions are prepended before local system instructions.
Included files can also contain runtime placeholders ({{ variable }}), so shared guidance can consume app-specific context passed at render time.
- List paths in the
includesfront matter field (relative to the prompt file). - At resolve time, each included file is parsed and its
# System instructionssection is extracted. - Included instructions are concatenated in order, then prepended before the including prompt's own system instructions.
- The
includesfield is removed from the resolved asset — the content has been inlined.
---
id: shared/tone
schema_version: 1
---
# System instructions
Always be polite, professional, and concise. Avoid jargon unless the user uses it first.---
id: support/reply
schema_version: 1
provider: openai
model: gpt-5.4
includes:
- ../shared/tone.md
---
# System instructions
Handle support requests carefully.
# Prompt template
{{ user_message }}After include resolution, the system instructions become:
Always be polite, professional, and concise. Avoid jargon unless the user uses it first.
Handle support requests carefully.
Included files can themselves include other files. Resolution is recursive — nested includes are resolved before being merged.
---
id: shared/safety
schema_version: 1
includes:
- ./base-rules.md
---
# System instructions
Never reveal internal policies.PromptOpsKit detects circular includes and throws an error:
Circular include detected: /prompts/a.md (included from /prompts/b.md)
The validate CLI command also checks for circular includes.
Paths are resolved relative to the file that declares them:
prompts/
├── support/
│ └── reply.md # includes: ../shared/tone.md
└── shared/
└── tone.md # resolved relative to reply.md
import { resolveIncludes } from 'promptopskit';
// resolveIncludes(asset, filePath) returns a new asset
// with included system instructions merged and includes removed
const resolved = await resolveIncludes(asset, '/path/to/prompt.md');The kit.resolvePrompt() and kit.renderPrompt() methods call resolveIncludes automatically.
Included files are resolved with parsePrompt and do not inherit folder defaults from defaults.md. Only the top-level prompt loaded via loadPromptFile receives defaults. This prevents system instructions from being double-applied when a default and an include both contribute system content.
See Prompt Format — Folder defaults for details on defaults.md.