Requirements

The Studio is specified by requirements that describe what it does today. Each one is tied to the code that produces the behaviour and to the test that checks it.

What the requirements are

The requirements live in the repository, in a bundle managed by the okfreq tool. They come at two levels. A StRS (stakeholder requirement) is a use case: something a writer, reviewer or maintainer can do and see in VS Code. A SwRS (software requirement) is one observable behaviour of the extension, written with its scenarios: given a situation, when something happens, then this is the outcome. A rule that many behaviours share is written once and cited by the others. Together they specify what the Studio does today, never what we would like it to do.

Why we keep them

How it works

A use case (StRS) is refined into behaviours (SwRS). Each behaviour is anchored in two places by a one-line comment holding its identifier: @implements_req where the code produces it, and @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 and 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 5 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.

Scenario: Toggle in reading mode

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


// @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:33


// @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

The requirement checks run in CI with the other static checks (just check runs just requirements-lint): okfreq validate checks the requirement files and their links, okfreq lint --check checks the generated navigation, and okfreq update-coverage --check fails when a marker is missing, unknown or out of date. 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 (16 approved, 12 draft, 472 proposed); retired ones are counted below. Report generated 2026-10-29T16:37:08.325514+00:00.

79StRS use cases
421SwRS behaviours
100%implemented (415 of 415)
100%tested (415 of 415)
100%fully traceable (415)
6SwRS with a marker exemption
166known issues in 69 SwRS
26 of 79StRS with a stakeholder validation test

Per scope

ScopeStRSSwRSImplementedTested
block-editing85252 / 5252 / 52
code-blocks21010 / 1010 / 10
diagrams42323 / 2323 / 23
frontmatter-editing31313 / 1313 / 13
frontmatter-schema51919 / 1919 / 19
gfm299 / 99 / 9
layout-width399 / 99 / 9
lifecycle-sync73230 / 3030 / 30
myst62323 / 2323 / 23
palette-slash76464 / 6464 / 64
rendering-core32119 / 1919 / 19
review-annotations64343 / 4343 / 43
table-editing62929 / 2929 / 29
theme-zoom388 / 88 / 8
toolbar-navigation84343 / 4343 / 43
trust-security62321 / 2121 / 21
Total79421415 / 415415 / 415

Retired requirements

Kept for their identifiers, never counted above and exempt from markers.

LifecycleStRSSwRS
deprecated259
superseded51457

Browse the requirements

Browsing the requirements from this site, from a use case to its behaviours and their tests, with a page per requirement and a search, is planned and not available yet. Until then the requirements are readable in the repository, under requirements/tiers/.