Menu

Docs · YAML

YAML structure in Fragment

Fragment uses YAML in two layers: a small front-matter block for page metadata, and inline YAML blocks next to your Markdown for AI behavior, tasks, timelines, diagrams, and relations.

ここで扱う YAML は、バックエンド向けの大きなスキーマではありません。「このノートは何か」「AI にどう振る舞ってほしいか」を、人間が読めるサイズでそっと添えるためのものです。

A gentle way to start: add one small front-matter block to a note you already use, then try a single block:prism or block:tasks on a page where AI support would actually help.

Two layers of YAML in each Fragment

Conceptually, every Fragment can use YAML in two places:

1. Front-matter (page-level)

A triple-dash block at the top of the note. It behaves like a tiny schema for the page itself: title, scope, tags, default Prism profile, layout, and so on.

Studio 側の UI と連動し、公開範囲やタグなどを UI から/YAML からどちらでも変更できるようにしていく想定です。

2. Inline YAML blocks (inside the page)

Fenced code blocks with a block:<type> annotation, such as block:prism or block:tasks, that sit next to your Markdown narrative.

These describe how AI should behave, what's on your plate, and how this page relates to others. Over time, Fragment will surface them as boards, timelines, and cross-page views.

Front-matter: a small schema for the page

Front-matter lives at the very top of a Fragment, wrapped in ---. It's optional, and it's designed to stay small, predictable, and easy to scan.

「ID・タイトル・更新日・公開範囲・タグ」といった、「ページそのものの属性」だけをまとめる場所として使います。

Example: front-matter for a weekly note

---
id: "weekly-review-2025-03-01"
title: "Weekly review — work & family"
updated: "2025-03-01"
scope: "private"         # private | unlisted | public
tags: ["weekly", "journal"]
prism: "weekly-reflection"
layout: "article"        # article | slides | mixed (future)
---

id / title / updated

Stable identifiers and basic labeling. You can let Fragment auto-generate IDs, or pick your own slugs if you want predictable URLs.

scope & tags

Scope controls visibility (private, unlisted, public). Tags help with grouping and search. Both can be edited via UI or directly in YAML.

prism & layout

A default Prism profile name to prefer when using AI with this page, and a layout hint for readers (article / slides / mixed). These can evolve as Fragment grows.

Inline YAML blocks: small pieces of structure inside the note

Inside a Fragment, you can add fenced YAML blocks annotated with block:<type>. Each type focuses on one thing: AI behavior, local settings, tasks, future timelines, or relations.

block:prism — how AI should behave

Describes persona, tone, boundaries, and what the AI should always check for this page. It effectively turns a note into a small AI app.

```yaml block:prism
persona:
  name: "Gentle weekly coach"
role: "helps me review my week without guilt"
tone:
  style: "calm, concrete"
  directness: "low"
boundaries:
  avoid:
    - "productivity guilt"
    - "pushing extra commitments"
  always_check:
    - "energy"
    - "family load"
```

When you ask AI to help on this page, Fragment can load this block first so the model starts from the right stance.

block:config — local config inside the page

Optional, for power users. A place for small, structured hints about audience, language, or mode that are specific to this Fragment.

```yaml block:config
audience: ["self", "partner"]
language: "ja-en"
notes:
  - "Private weekly reflection"
  - "Share summary later if it feels right"
```

Studio and AI can both read this block to adjust how they present or suggest things, without cluttering the main text.

block:tasks — tasks anchored to this Fragment

A structured list of tasks related to this note. Fragment can already let AI read and update them; UI for boards and summaries will grow over time.

```yaml block:tasks
tasks:
  - id: "t1"
    title: "Schedule dentist appointment"
    status: "todo"
  - id: "t2"
    title: "Write short update for team"
    status: "in-progress"
```

Even before a full calendar or board view, AI can help you review, rephrase, and carry these tasks forward.

block:calendar & block:relations — time & links

These blocks describe upcoming or past events, and how this Fragment connects to others. Fragment will gradually add richer ways to browse and visualize them.

```yaml block:calendar
events:
  - title: "Next weekly review"
    start: "2025-03-08T09:00"
```

```yaml block:relations
refs:
  parents: ["life-os-2025"]
  children: ["weekly-review-2025-03-08"]
```

You can start writing these today. As Fragment evolves, the same YAML will power cross-page views, reminders, and timelines.

An everyday example: a weekly reflection page

Here's a complete Fragment you could actually use: a weekly review page that combines front-matter, a block:prism for AI stance, and normal Markdown text.

---
id: "weekly-review-2025-03-01"
title: "Weekly review — work & family"
updated: "2025-03-01"
scope: "private"
tags: ["weekly", "journal"]
prism: "weekly-reflection"
---

```yaml block:prism
persona:
  name: "Gentle weekly coach"
role: "helps me reflect on the week without guilt"
tone:
  style: "calm, concrete"
  directness: "low"
boundaries:
  avoid:
    - "productivity guilt"
    - "pushing extra commitments"
  always_check:
    - "energy"
    - "family load"
```

# This week — quick recap

- Work:
  - …
- Family / home:
  - …
- Health / energy:
  - …

## What went well

- …

## What felt heavy

- …

## Next week — one small adjustment

- …

When you open this page in Studio and ask AI something like "Help me reflect on this week based on the note", Fragment can load the block:prism first so the model starts from a gentle, concrete, non-guilt stance, instead of you having to retype that in a prompt every time.

Keep YAML small and stable

YAML in Fragment is not meant to capture everything. Use it for small, stable facts and rules — things like scope, roles, tone, and links that will still make sense a year from now. Let the prose carry the full story.

Grow the structure over time

最初から完璧な YAML を設計する必要はありません。「フロントマター 1 個 → Prism ブロック 1 個 → タスクやリレーション」のように、必要になった順に少しずつ足していく想定です。

Try adding one YAML layer to your next note

In Studio, you can insert front-matter and inline YAML blocks directly into a Fragment. Start with a simple weekly review or project page, then let AI and future views reuse that structure for you.

YAML structure docs — part of Fragment, an AI-native notebook by Fragment Practice.

YAML structure — front-matter and blocks — Fragment