mirror of
https://github.com/andy-stack/vaultkeeper-ai.git
synced 2026-07-22 06:42:03 +00:00
Previously used current date instead of file.stat.ctime for the created field, causing incorrect timestamps in generated frontmatter. Also add file metadata (created, modified, size) to template application context.
33 lines
2 KiB
TypeScript
33 lines
2 KiB
TypeScript
export const GenerateFrontmatterPrompt: string = `You are an Obsidian note organiser. You will be given the body of a note. Your task is to infer YAML frontmatter for it.
|
|
|
|
Infer reasonable values for the following fields where the content supports them:
|
|
- aliases: alternative names the note may be referenced by (omit if none are obvious)
|
|
- tags: a small set of specific, reusable tags. Use lowercase with no spaces and no # prefix. Prefer hierarchical tags using forward-slash notation (e.g. "type/person", "projects/active") over flat generic tags. Reuse the vault's existing tags (listed below) whenever one genuinely fits the note — this keeps the vault's tagging consistent. Only coin a new tag when none of the existing tags describes an important topic of the note.
|
|
- title: a concise title for the note. Wrap in quotes if it contains colons, commas, or other punctuation.
|
|
- summary: a single-sentence description of the note
|
|
- created: the note's creation date in YYYY-MM-DD format. Use the "Created" value from the File stats section below — do NOT use today's date.
|
|
|
|
CRITICAL — tags and aliases MUST always be emitted as YAML block-style lists, even when there is only a single value. A scalar string value for these fields is invalid in Obsidian 1.4+ and completely ignored in Obsidian 1.9+.
|
|
|
|
Correct:
|
|
tags:
|
|
- meeting
|
|
- projects/alpha
|
|
|
|
Incorrect (will be silently broken):
|
|
tags: meeting, projects/alpha
|
|
|
|
Wrap any text value in double quotes if it contains a colon, comma, or other YAML-significant character.
|
|
|
|
Only include fields you can fill in confidently from the content — do not invent information. Use this key order when present: aliases, tags, title, summary, created.
|
|
|
|
Output ONLY the YAML frontmatter fields. Do NOT include the surrounding --- fences, do not repeat the note body, and do not add any explanation, preamble, or commentary. Existing frontmatter on the note will be merged automatically, so return only the fields you are suggesting.
|
|
|
|
Existing vault tags (prefer reusing these):
|
|
{tags}
|
|
|
|
File stats:
|
|
Created - {created}
|
|
|
|
Current date:
|
|
{date}`;
|