Markdown OKF-Schema Studio

Requirements of Markdown OKF-Schema Studio

Every feature of Studio is written down at three levels, each one linked to the next.

  1. Use caseWhat a user does and gets, from start to end. Written for a person.StRS · 94
  2. BehaviourOne rule the software follows, small enough to test on its own.SwRS · 439
  3. Code and testsThe files that implement each behaviour and the tests that check it.81.84% linked

Areas

Requirements are grouped by product area; open one to read its use cases.

AreaCoversUse casesBehaviours
Rendering coreCommonMark blocks, inline code, long documents, CJK/RTL text, missing images (admonition colours and layouts belong to `myst`)639Code blocksFenced code, syntax highlighting, diff fences, unknown grammar, copy button28GitHub Flavored MarkdownAutolinks, task lists and toggles, strikethrough, alerts, footnotes, raw HTML, colour spans39MyST syntaxDirectives, roles, admonitions, context tags, math, figures and labels, citations, conf.py checks, label rename923DiagramsMermaid (themes, fallback, errors) and PlantUML (built-in engine light/dark, {uml} diagram files and local !include light/dark, unsupported standard-library include; JAR success, unconfigured, executable not found)528Frontmatter and OKF schemaProperties table, schema validation and errors, generic YAML, x-okf-link details420Frontmatter editingEditing the properties table: field values, lists, booleans, enum and key suggestions, add/remove/rename, title312Layout and widthFirst-element gap, Margin/Auto/Full width, max content width, overflow, narrow and wide panes310Theme and zoomHost themes, forced white/cream/dark modes, high contrast, zoom 70-200 %37Toolbar and navigationToolbar rows and collapse, sticky headings, TOC, Back/Next, anchor, title-bar and Quick Open entries935Block editingEdit mode, block editors, keyboard, undo, insert points, move, selection, clipboard852Edition palette and slash menuPalette modes, popups, shortcuts, link panel, figure form, slash menu, image pick and paste962Table editingCell editors, cell bar, Tab/Enter navigation, minimal diffs826Review annotationsComment and TODO chips, review threads, sidecar, orphans, incoming changes742Lifecycle and syncOpen, refresh, reload and restore, Open With, scroll sync, incremental patches, status pages, coexistence946Trust and securityRestricted Mode and standalone previews (editable, restricted reads), refused messages, CSP, resource policy620

What the requirements are

A StRS is a use case: something a writer, reviewer or maintainer can do and see in VS Code. A SwRS is one observable behaviour of the extension, written with its scenarios (given, when, then, or a table); a rule many behaviours share is written once and cited by the others. They say what Studio does today, never what we would like it to do.

Why we keep them

The documented behaviour stays equal to the code, a behaviour that looks wrong is written down as a known issue, we know which test checks which behaviour, and a change is reviewed against the requirement, the code and the test together.

How it works

A use case is refined into behaviours, and each behaviour is anchored by a one-line comment holding its identifier: @implements_req where the code produces it, @tests_req in the test that checks it.

How a requirement is anchored to the codeA use case (StRS) is refined into SwRS behaviours. Each behaviour is marked with @implements_req in the source and @tests_req in a test. Cross-cutting rules are cited by the SwRS that rely on them.StRSA use case a person canobserve in VS Code(user need)SwRSOne behaviour with itsscenarios (nominal, refusal,boundary), derived from StRSCode@implements_reqThe source that producesthe behaviour carries themarker, next to itTest@tests_reqThe test that checks thebehaviour carries themarker, in the testCross-cutting rules, written onceand cited with depends_on

A real example

This requirement is read from the report and the repository as they stand: its statement, a scenario, then the two comments that tie it to the code and to the test.

SwRS-MDOKFSTUDIO-GFM-021 · derives from StRS-MDOKFSTUDIO-GFM-003 · cites 6 cross-cutting rules

Clicking a checkbox toggles one source character

When a writer clicks a checkbox in reading or edit mode, the extension SHALL edit only the character between its brackets, without opening a block editor, and revert the checkbox and show the reason next to it for a few seconds (and as its tooltip) when the host refuses the toggle; the host SHALL accept a previewCheckboxToggle message only with a safe non-negative integer column, a boolean checked state and a single line.

Scenario: Toggle in reading mode

In the code, the marker next to the implementation: src/core/edits/sourceEdits.ts:54


// @implements_req SwRS-MDOKFSTUDIO-GFM-021
/**
 * Gives the task-list marker at 1-based `line`, zero-based `column` (its opening bracket) the
 * state `checked`: a one-character edit between the brackets.
 */
export function planCheckboxToggle(text: string, line: number, column: number, checked: boolean): CheckboxTogglePlan {
  const lines = sourceLines(text);

In the test, the marker above the test that checks it: test/core/edits/sourceEdits.test.ts:34


// @tests_req SwRS-MDOKFSTUDIO-GFM-021
test("a checkbox toggle changes the one character between the brackets", () => {
  const text = "# Tasks\r\n\r\n- [ ] one\r\n- [x] two\r\n";
  const toggle = planCheckboxToggle(text, 3, 2, true);
  assert.deepEqual(toggle, { edit: { start: 14, end: 15, text: "x" } });
  assert.equal(applied(text, toggle), "# Tasks\r\n\r\n- [x] one\r\n- [x] two\r\n");
  assert.equal(applied(text, planCheckboxToggle(text, 4, 2, false)), "# Tasks\r\n\r\n- [ ] one\r\n- [ ] two\r\n");

What keeps it in sync

CI runs okfreq validate on the files and links, okfreq lint --check on the navigation and okfreq update-coverage --check on the markers, so a change that moves marked code or tests moves the markers in the same commit.

The figures

Counts come from the okfreq generate-report JSON and cover active requirements only (15 approved, 518 proposed); retired ones are counted below. Report generated 2026-11-24T08:38:44.949563+00:00.

94StRS use cases
439SwRS behaviours
100%implemented (437 of 437)
100%tested (437 of 437)
100%fully traceable (437)
2SwRS with a marker exemption
148known issues in 68 SwRS
23 of 94StRS with a stakeholder validation test

Per area

AreaStRSSwRSImplementedTested
Rendering core63939 / 3939 / 39
Code blocks288 / 88 / 8
GitHub Flavored Markdown399 / 99 / 9
MyST syntax92323 / 2323 / 23
Diagrams52828 / 2828 / 28
Frontmatter and OKF schema42020 / 2020 / 20
Frontmatter editing31212 / 1212 / 12
Layout and width31010 / 1010 / 10
Theme and zoom377 / 77 / 7
Toolbar and navigation93535 / 3535 / 35
Block editing85252 / 5252 / 52
Edition palette and slash menu96262 / 6262 / 62
Table editing82626 / 2626 / 26
Review annotations74242 / 4242 / 42
Lifecycle and sync94646 / 4646 / 46
Trust and security62018 / 1818 / 18
Total94439437 / 437437 / 437

Retired requirements

Kept for their identifiers, never counted above and exempt from markers; the History button shows them.

LifecycleStRSSwRS
deprecated264
superseded56550