Eugen Ullrich / OKF Hub
/docs/prompt-templates/

Prompt templates

OKF is model-neutral. You can run the same prompt with Gemini, Claude, ChatGPT, or DeepSeek – the format prescribes no model. This page collects three tested templates: turn raw text into valid v0.2 frontmatter, enrich a whole bundle, and answer from a knowledge base without inventing. All three come from this project's real pipeline and RAG assistant.

1. Generate frontmatter

The core prompt. It takes a Markdown text and returns only a valid v0.2 frontmatter. This is the step transform_to_okf.py otherwise performs.

Du bist ein OKF-Architekt (Open Knowledge Format v0.2).
Analysiere den folgenden Markdown-Text und erzeuge dafür einen
streng gültigen YAML-Frontmatter. Gib NUR den Frontmatter zurück,
keinen weiteren Text.

Regeln:
- type: genau einer aus "Guide" | "Tool" | "CaseStudy" | "Article".
- description: eine RAG-taugliche Zusammenfassung, höchstens 250 Zeichen,
  eigenständig verständlich, keine Wiederholung des Titels.
- tags: 3 bis 6 konkrete Kleinbuchstaben-Tags, konsistent geschrieben.
- word_count: die tatsächliche Wortzahl des Textes.
- Erfinde keine Quelle und kein Datum, das nicht im Text steht.

Struktur:
---
type: "Guide" | "Tool" | "CaseStudy" | "Article"
title: "<exakter Titel>"
description: "<Zusammenfassung bis 250 Zeichen>"
resource: "<Original-URL>"
domain: "<Domain>"
category: "<Kategorie>"
tags: ["tag-eins", "tag-zwei"]
word_count: <zahl>
generated:
  by: "human:<autor>"
  at: "<YYYY-MM-DDTHH:MM:SSZ>"
verified:
  - by: "human:<autor>"
    at: "<YYYY-MM-DDTHH:MM:SSZ>"
status: "stable"
stale_after: "<YYYY-MM-DD>"
sources:
  - "<Original-URL>"
---

TEXT:
<hier den Markdown-Text einfügen>

The most important line is the rule against invented sources and dates. A model otherwise happily fills sources and stale_after with plausible-but-false values. Check those two fields after every run.

2. Enrich a whole bundle

When it's a folder rather than a single text, extend the prompt with cross-file consistency. The bottleneck is not the single file but the uniformity of types and tags across the bundle.

Du reicherst ein OKF-v0.2-Bundle an. Für jede Datei erzeugst du den
Frontmatter nach den Regeln aus Vorlage 1. Zusätzlich:

- Verwende ein GEMEINSAMES, kleines Tag-Vokabular über alle Dateien.
  Führe es als Liste mit und weiche nur ab, wenn ein Thema wirklich neu ist.
- Vergib type konsistent: gleiche Textsorte => gleicher type.
- Setze category nach dem Themenbereich, nicht nach der Ordnerzufälligkeit.
- Wenn zwei Dateien dasselbe behandeln, verlinke sie im Body
  bundle-relativ: [Titel](/pfad/zur/datei.md).

Gib je Datei den Dateinamen und darunter den Frontmatter aus.

The "shared tag vocabulary" addition is the lever for the Knowledge Graph: only consistent tags create similarity edges. A bundle with seo, SEO, and Seo splinters into isolated nodes.

3. Answer from sources (RAG)

This template is the system instruction the Hub uses on every chat request. It is strict, because a knowledge base is worth only as much as its discipline against hallucination.

Du bist der OKF-Wissensassistent. Antworte AUSSCHLIESSLICH aus den
unten gelieferten OKF-Quellen. Nutze niemals Außenwissen und nenne
keine dritte Website, Marke oder Originalquelle.

Zitate – strenge Regeln:
- Verweise auf Quellen nur über ihre Nummer in eckigen Klammern, z. B. [1], [2].
- Schreibe, rate oder rekonstruiere KEINE URL, Domain oder externen Seitennamen.
  Gib gar keine http-Links aus.
- Zitiere eine Quellennummer nur, wenn sie den Satz wirklich stützt.
- Beantworten die Quellen die Frage nicht, sage das klar
  ("Das ist in der ausgewählten OKF nicht abgedeckt.") statt Außenwissen zu ergänzen.

Antworte in der Sprache der Frage.

Two things here are negotiable and two are not. Negotiable are tone and domain – adapt the first line to your knowledge base. Not negotiable are the citation rule and the duty to admit missing evidence. Without them, RAG produces exactly the confident wrong answers it is meant to prevent.

Which model?

For stages 1 and 2, format fidelity matters: the model must return clean YAML without chatter around it. All four named models can; with smaller models it helps to repeat "return ONLY the frontmatter." For stage 3, instruction fidelity against hallucination matters. The Hub runs Gemini 2.5 Flash at low temperature by default, but allows DeepSeek V3 and Llama 3.3 70B as alternatives.

Continue

The target format of the first two prompts is in the frontmatter schema, the surrounding flow under CLI and CI/CD. How the RAG assistant selects sources and answers is measured on the RAG benchmarks page.


Frontmatter-Prompt nach dem realen OKF_AUTOMATION_GUIDE, RAG-Anweisung nach der Systemanweisung in server.js dieses Projekts. / Frontmatter prompt per the real OKF_AUTOMATION_GUIDE, RAG instruction per this project's server.js system prompt.