Skip to content

Frontmatter

SFMD documents MAY begin with a YAML frontmatter block.


---
key: value
---
  • Starts with a line containing exactly ---
  • Ends with a line containing exactly ---
  • MUST appear at the very beginning of the file (line 1)
  • Content between delimiters is parsed as YAML

FieldTypeDescription
titlestringDocument title
descriptionstringBrief summary of the document
authorstringAuthor name or identifier
tagslistCategorization tags
versionstringDocument version

All fields are optional. Additional fields MAY be included.


These fields are defined by the String runtime. They are valid SFMD frontmatter but have no effect in a plain CommonMark viewer.

FieldTypeDescription
namestringApp or tool name (fallback: filename)
namespacestringPublisher identifier (e.g. cookbook, stringhub). Combined with name, forms the package’s canonical identity for collision detection at install time.
typestringapp or tool — for registry classification
defaultstringAction to run on open (act.{value})
envlistRequired environment variables

When two publishers ship apps that share the same name (e.g. cookbook/weather and stringhub/weather), the (namespace, name) pair is what tells them apart. The runtime uses this pair on /install to decide whether an existing local entry is a re-install of the same package (allowed, in-place upgrade) or a different package colliding on the same local name (rejected, with a hint to use --as).

namespace is optional. Apps without a namespace can still install, but two such apps that share name will collide rather than coexist.

Replaces the older category field. Accepts app or tool. Used by /install to decide registry placement (apps[] vs tools[] in config.json) and by /open app:<name> / /tool:<name> to look the package up. If frontmatter type is missing, the agent must pass --app or --tool explicitly at install time.

Declares environment variables the document requires at runtime. Each entry has a name, description, and optional default:

env:
- API_KEY: "Service API key"
- LANG: "Output language"
default: en

Variables without default are required. The runtime validates them before executing actions and provides the description as a hint on error.


---
title: Weather Dashboard
description: Real-time weather for configured cities
tags: [weather, dashboard]
---
# Weather Dashboard
Content starts here.
---
name: weather
namespace: cookbook
type: app
description: Real-time weather dashboard
default: get_weather
---
# Weather Dashboard
`/act.get_weather --city "{city}"`
---
name: translate
type: tool
default: translate
env:
- DEEPL_KEY: "DeepL API key"
- TARGET_LANG: "Topic language code"
default: en
---

When packaging an app or tool for distribution (publishing or local /install), the entry-point document MUST be named string.md. The runtime locates a package by reading {home}/packages/{name}/string.md and uses that file’s frontmatter to resolve the package’s identity, type, default action, and env declarations. Sibling .md files in the same directory are treated as additional pages of a multi-file package and copied alongside during install.

/open app:<name> and /open tool:<name> always resolve to the registered package’s string.md; navigation to other pages is relative to that file.


  1. If present, frontmatter MUST be the first thing in the file. No blank lines or content before the opening ---.
  2. YAML content MUST be valid YAML.
  3. Frontmatter is metadata — it is not rendered as document content.
  4. A document without frontmatter is valid SFMD.
  5. The closing --- MUST be on its own line.
  6. All standard and runtime fields are optional.
  7. Unknown fields are preserved but ignored by the runtime.