_format — Claude Code prompt: ops/*.md documentation format
Defines the authoring format for ops/*.md files that document canonical edit operations in the genoffice slide editor.
Apache-2.0 ★ 12,746 updated 2026-10-29
.claude/commands/_format.mdWhat _format does
The prompt lays out how ops/*.md files are structured: one file per operation group (text, element, insert, table, slide, deck), each operation block opening with ### <opName> followed immediately by a backtick-wrapped signature. Heading suffixes like (not-ai-callable) and (pending) control whether an op shows up in the model's vocabulary and signature index.
Every json example inside a block gets run through runTxn(dryRun) against a two-slide fixture deck (durable ids s_1, s_2), using placeholder element ids such as e_TEXT, e_SHAPE, e_TABLE. The files themselves are parsed by shared/op-docs.ts into OP_DOCS, which feeds opVocabulary(), opUsage(), opSignatureIndex(), and opGuide() — this guide is for the people writing those docs, not something loaded into the model's own prompt.
The suite in apps/slides/tests/op-docs.test.ts checks that the docs stay in sync with the op registry, that examples validate, and that no CJK characters slip in, which is why the writing rules call for English-only prose and example content.
What it helps with
- write a new edit operation entry matching the op-docs.ts parser
- structure a signature and field table for an operation
- flag an operation as not-ai-callable or pending
- build json examples that pass runTxn(dryRun) against the fixture deck
- split an oversized group file into sub-files with a catalog entry
Example prompts for the agent
- Add a new operation entry to
ops/table.mdfollowing the _format rules - Check whether my
### insertRowblock matches the _format conventions - Split this operation group file into sub-files per _format
How to install _format
Manually: put the files in place
.claude/commands/_format.mdHow to use
Paste the text at the start of a chat or into project instructions
Questions about _format
How do I install _format in Claude Code?
Place the file at .claude/commands/_format.md.
What does _format do?
It's an authoring guide for ops/*.md files that document canonical edit operations in genoffice's slide editor, covering block structure, signatures, flags and example conventions.
Why can't ops/*.md files contain CJK characters?
The op-docs.test.ts suite checks for the absence of CJK text in these files, and the writing rules require English-only content, including example text.
Source text
_format.md · Apache-2.0
# Op documentation format (authoring guide — not loaded into any prompt) The `ops/*.md` files are the single source of truth for what the model knows about canonical edit ops. `shared/op-docs.ts` parses them at import time into `OP_DOCS`; `opVocabulary()` / `opUsage()` / `opSignatureIndex()` / `opGuide()` are all derived from the parse. Tests in `apps/slides/tests/op-docs*.test.ts` assert that the docs track the op registry exactly, that every example validates against a fixture deck, and that the files contain no CJK text. ## File layout ``` # <Group title> > <one-line summary shown in the load_guide catalog> <optional group-level prose: addressing, units, conventions> ### <opName> `<signature>` <prose, field table, examples, common mistakes, related ops> ### <nextOpName> (not-ai-callable) `<signature>` ... ``` - One file per group; the file name is the group id (`text`, `element`, `insert`, `table`, `slide`, `deck`). - A block starts at `### <opName>`; `opName` must match a registered op. - The first non-empty line after the heading is the **signature**, wrapped in single backticks. It is emitted verbatim as `Usage: <opName> <signature>` in guided errors, so keep it compact and free of backticks. - Heading suffixes in parentheses set flags: `(not-ai-callable)` hides the op from the vocabulary and the signature index (byte / clipboard / part-path payloads the model cannot produce); `(pending)` hides it entirely until the registering branch lands. Combine as `(not-ai-callable, pending)`. - Every ```json fenced block inside an AI-callable op block is an example that the test suite runs through `runTxn(dryRun)`. Use the placeholder ids below; the test substitutes real ids from its fixture deck. ## Placeholder ids for examples | Placeholder | Fixture element | | ------------ | ------------------------------- | | `e_TEXT` | a text box on slide 0 | | `e_SHAPE` | a rounded rectangle on slide 0 | | `e_PICTURE` | a picture on slide 0 | | `e_TABLE` | a 2x2 table on slide 0 | | `e_CHART` | a bar chart on slide 0 | | `e_LINE` | a straight connector on slide 0 | | `e_GROUP` | a group on slide 0 | | `e_CHILD` | a direct child of that group | | `SECTION_ID` | an existing section GUID | The fixture deck has exactly two slides (indices 0 and 1; durable ids `s_1` and `s_2`). ## Writing rules - English only. Example text content (titles, labels, categories) is English too. - Units are document-space EMU unless a field name says otherwise (`...Pt`, `...Pct`, `...Deg`). Say so in the field table. - Field tables list every field the op's `validate` / `apply` reads, not only the ones in the signature. - "Common mistakes" entries describe what the model tends to get wrong and the corrective action, in the same voice as the guided errors. - Keep each group file under roughly 8 KB; split a group into sub-files (and add a catalog entry) rather than exceeding that.
© genspark-ai · Apache-2.0 · genspark-ai/genoffice