The framework definition
sklad knows nothing about projects, tickets, or journals. Every kind of note, every path, every frontmatter field, and the task syntax come from one file in the knowledge base: .kb/framework.toml. sklad implements the mechanisms (classifying paths, checking fields, ranking work); the definition supplies the data.
The server does not start without a valid definition, and sklad check reports every problem in it with its line number. Unknown keys are errors, so a typo such as labl fails loudly instead of being ignored.
A small definition
Section titled “A small definition”This definition has two kinds: projects, which can grow from one file into a directory, and notes in topic folders. It also defines a checkbox task syntax.
version = 1
[vault]docs = ["README.md"]
[kinds.project]label = "Projects"description = "Work with a goal and an end state."file = "projects/{slug}.md"dir = "projects/{slug}"entry = "index.md"new = { form = "file" }template = "project"next = { summary = "Next action" }
[kinds.project.fields]status = { type = "enum", values = ["active", "paused", "done"], required = true }started = { type = "date", required = true }tags = { type = "tags" }
[kinds.project.state]field = "status"active = ["active"]inactive = ["paused"]done = ["done"]
[kinds.project.sections]"Next action" = "active"
[kinds.note]label = "Notes"description = "Anything learned, in topic folders."file = "notes/{path}.md"
[kinds.note.fields]tags = { type = "tags" }
[tasks]markers = { " " = "open", "x" = "done" }open = ["open"]done = ["done"]
[tasks.fields]due = { type = "date", syntax = ["@due({})"] }done = { type = "date", syntax = ["@done({})"] }With a template at .kb/templates/project.md, sklad new project "Garden shed" writes projects/garden-shed.md, and sklad new note "Systemd timers" --in linux writes notes/linux/systemd-timers.md. If a project’s status is set to a value outside the enum, sklad check reports it:
projects/garden-shed.md:2: error fm.type `status` must be one of active, paused, doneThe only required key is version, and the only supported version is 1. A definition with no kinds is valid but classifies nothing.
Kinds and placement
Section titled “Kinds and placement”A kind is a [kinds.<name>] table. Its path patterns decide which files belong to it; a file that matches no kind and is not listed under [vault] docs is reported as place.unclassified.
| Key | Meaning |
|---|---|
label, description |
Shown to people and agents: in the web view’s sidebar and in the generated conventions. |
file |
Pattern for a unit that is one Markdown file. |
dir, entry |
Pattern for a unit that is a directory, and the name of its entry file (such as index.md). Each needs the other. |
new |
form = "file" or "dir": which form sklad new creates. unique = true makes sklad new return the existing unit instead of failing, which suits one-per-day journals. |
template |
A template name; the file <name>.md must exist in the templates directory. |
guide |
A vault path to hand-written guidance; the generated conventions tell agents to read it before working on a unit of this kind. |
next |
summary = "<heading>" makes units of this kind work items in sklad next, summarised by that section. Needs a state. |
nav |
open = true expands the kind in the web view’s sidebar; home = true lists its units on the web view’s home page. |
fields, extra_fields |
The frontmatter schema; see Fields. |
state |
Maps an enum field to state groups; see States. |
sections |
Headings that must have content; see Sections. |
members |
Rules for other files inside a directory unit; see Members. |
A kind needs at least one of file or dir. A kind with both can start as a file and become a directory later; a unit present in both forms at once is reported as place.both_forms.
Patterns and placeholders
Section titled “Patterns and placeholders”Patterns are vault-relative paths with placeholders in braces. The built-in placeholders are:
| Placeholder | Matches |
|---|---|
{slug} |
Lowercase letters and digits in hyphen-separated runs, such as garden-shed |
{path} |
One or more slugs separated by /, such as linux/systemd-timers |
{yyyy}, {mm}, {dd} |
A year, month, and day; together they must form a real date |
{n} |
A positive integer without leading zeros |
{nn} |
Two digits |
[placeholders] defines your own placeholders as lists of alternatives built from the built-in ones, such as handle = ["know-{n}", "{yyyy}-{mm}-{dd}"]. A custom placeholder cannot override a built-in one, every alternative must be reachable, and every custom placeholder must be used by some pattern.
Kinds are tried in the order they appear in the file, so order sets precedence. A kind whose paths are all claimed by an earlier kind is an error (“kind b is shadowed”).
Fields
Section titled “Fields”[kinds.<name>.fields] lists the frontmatter keys a kind’s entry files may carry, in order. Each field has a type:
| Type | Accepts |
|---|---|
text |
A string (or a number or boolean). With pattern, it must match that regular expression in full. |
date |
YYYY-MM-DD, a real calendar date |
partial-date |
YYYY-MM-DD or a year-less MM-DD, such as a birthday |
datetime |
YYYY-MM-DDTHH:mm, optional seconds, fraction, and Z or ±HH:MM offset |
enum |
One of values |
tags |
A list of tags; each starts with a letter or digit, then letters, digits, _, /, or - |
ref |
A unit of the kind given by kind, named by its file stem or directory name, such as garden-shed |
required = true makes a field mandatory (fm.required). An empty value such as issue: counts as absent. default is a pattern that sklad new fills from its bindings when the template leaves the field empty. A key the schema does not list is a fm.unknown warning unless the kind sets extra_fields = "allow".
States
Section titled “States”[kinds.<name>.state] names an enum field and sorts its values into three groups: active, inactive, and done. A value may sit in only one group. The groups are what --state filters on in sklad search and sklad query, and what sklad next uses to pick work items. Inside active, list order is rank order in sklad next.
Sections
Section titled “Sections”[kinds.<name>.sections] maps a heading to when it must have content: always, or only while the unit is in the active, inactive, or done group. An empty required section is section.required.
Members
Section titled “Members”For a directory unit, [kinds.<name>.members] describes the other files in the directory. files lists allowed patterns relative to the unit directory; with strict = true, any other file is a dir.member warning. ignore lists globs that are never read. fields and extra_fields give Markdown members their own frontmatter schema; without fields, member frontmatter is not checked. Members need the kind to have a dir.
Vault-wide settings
Section titled “Vault-wide settings”| Table | Keys |
|---|---|
[vault] |
docs: globs for prose files (README, agent guides) whose links are checked but which belong to no kind. templates: the templates directory, default .kb/templates. exclude: paths no component ever reads, such as private directories. |
[archive] |
prefix: a directory that mirrors the kind layout for finished units, such as archive/. done_outside: the severity of place.done_outside, a unit in a done state left outside the archive; default info. |
[conventions] |
agents_file: the file that holds the generated conventions block. mcp_include: hand-written headings from that file that the MCP server also serves. |
[policy] |
The scan for secrets and personal data: include (globs sklad check scans), allowlist, and severity per category (secret, phone_number, email_address, physical_address), each warn or block. Server writes are scanned whatever their path. |
[check] |
severity: per-rule overrides, info, warn, or error, keyed by rule name. An unknown rule name is an error. |
Templates
Section titled “Templates”Templates are Markdown files in the templates directory, named after the template key. sklad new replaces {{title}}, {{date}}, {{datetime}}, {{weekday}}, every placeholder it bound ({{slug}}, {{yyyy}}, and so on), and {{date:FORMAT}} with moment.js tokens (YYYY, MM, DD, HH, mm, ss, dddd, and others). Anything else in double braces stays as written. A kind without a template gets a file holding only # <title>.
A [templates.<name>] table declares a standalone template that belongs to no kind. sklad new <name> then needs --path, and the path must still classify. A name cannot be both a kind and a standalone template.
[tasks] defines the checkbox syntax that sklad next and sklad check read.
| Key | Meaning |
|---|---|
markers |
One character inside [ ] mapped to a state, such as " " = "open" |
open |
Open states; the first means not started |
done |
States that close a task; a task in one of them needs a done date (task.done_date) |
high |
Priority values that sklad next lists even without a date |
aliases |
Severity of task.alias, a token in a non-canonical spelling; default warn |
tag |
Regular expression for inline tags |
[tasks.fields] gives each metadata token its spelling. The field names are fixed: due, scheduled, start, done, cancelled, recurrence, id, and priority. syntax lists the spellings with {} for the value; the first is canonical and later ones are aliases. flags maps bare tokens to a value, such as an emoji that means high priority.
What sklad check reports
Section titled “What sklad check reports”Each problem carries a rule name, which [check] severity can retune:
| Group | Rules |
|---|---|
| Definition | def.invalid |
| Frontmatter | fm.parse, fm.required, fm.type, fm.ref, fm.unknown |
| Placement | place.unclassified, place.archived_state, place.done_outside, place.both_forms |
| Directory units | dir.entry_missing, dir.member |
| Sections | section.required |
| Links | link.broken, link.anchor, link.ambiguous, link.noncanonical |
| Tasks | task.token, task.alias, task.done_date |
| Conventions | conventions.stale |
| Policy | policy.secret, policy.phone_number, policy.email_address, policy.physical_address |
The conventions block
Section titled “The conventions block”With [conventions] set, sklad generates a summary of the definition for agents: where each kind goes, its fields, and which MCP tools to use. It lives between <!-- kb:conventions:begin … --> and <!-- kb:conventions:end --> in the agents file and is also part of the MCP server’s instructions. When it drifts from the definition, sklad check reports conventions.stale; sklad check --fix rewrites it.
See the sklad check, sklad new, and sklad next references for their flags.