/markout:markout-output-formatsfrom markout
Provides multi-format output from a single Markout model: plain text, Unicode tables, ANSI terminal (Spectre), aligned tables, TSV, and JSONL. For CLI --format switches or when one render path must serve several formats.
Ships in markout. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Default Serialize(...) emits Markdown. Pass a formatter (and optional MarkoutWriterOptions)
to get other formats. The anti-pattern is per-format string building (string.Join("\t", ...)); let
Markout project the same model to each format so columns/headers stay consistent.
Markout has no reflection fallback. Every report needs a partial context registering each model
type and a Serialize call that passes it. [MarkoutSerializable] is optional customization, not
a prerequisite for registration.
using Markout;
[MarkoutSerializable(TitleProperty = nameof(Title))]
public class Report
{
public string Title { get; set; } = "";
[MarkoutSection(Name = "Rows")] public List<Row>? Rows { get; set; }
}
[MarkoutSerializable]
public class Row { public string Name { get; set; } = ""; public int Count { get; set; } }
[MarkoutContext(typeof(Report))]
[MarkoutContext(typeof(Row))] // every user element type of a List<T>, too
public partial class ReportContext : MarkoutSerializerContext { }
var ctx = ReportContext.Default; // the `ctx` passed in the examples below
MarkoutSerializer.Serialize(r, Console.Out, ctx); // Markdown (default)
MarkoutSerializer.Serialize(r, Console.Out, new MarkdownFormatter(), ctx); // Markdown, explicit
MarkoutSerializer.Serialize(r, Console.Out, new PlainTextFormatter(), ctx); // plain text / logs (ASCII, no pipes)
MarkoutSerializer.Serialize(r, Console.Out, new UnicodeFormatter(), ctx); // Unicode box-drawing tables
MarkoutSerializer.Serialize(r, Console.Out, new TableFormatter(), ctx); // compact pretty rows
using Markout.Ansi.Spectre; // extra package
MarkoutSerializer.Serialize(r, Console.Out, new SpectreFormatter(AnsiConsole.Console), ctx); // ANSI
Markout.Ansi.Spectre is a separate NuGet package; Markdown/plain/table/TSV/JSONL need only Markout.
Graph sections become Markdown edge tables by default. Select a Markdown
graph mode to embed the same graph as a rooted text tree or Mermaid without
rebuilding it:
MarkoutSerializer.Serialize(
report,
Console.Out,
new MarkdownFormatter(MarkdownGraphMode.FencedTree),
ctx);
MarkoutSerializer.Serialize(
report,
Console.Out,
new MarkdownFormatter(MarkdownGraphMode.Mermaid),
ctx);
TableFormatter + MarkoutWriterOptions.TableMode selects the tabular shape:
var opts = new MarkoutWriterOptions
{
TableMode = MarkoutTableMode.Tsv, // Pretty | Tsv | Jsonl
IncludeDescription = false,
IncludeSections = new HashSet<string> { "Results" },
JsonTypedValues = true, // JSONL: emit numbers and booleans as JSON values
MaxItems = 3, // cap rows; JSONL stays record-only when rows are skipped
};
MarkoutSerializer.Serialize(report, Console.Out, new TableFormatter(), ctx, opts);
MarkoutTableMode.Pretty — columns aligned to a uniform start position.MarkoutTableMode.Tsv — stable snake_case headers; never emits embedded tabs/newlines in cells.MarkoutTableMode.Jsonl — one record per row, carrying only that row's keys (heterogeneous).MaxItems = N caps every table to N rows. Presentation and TSV output append
... and {count} more; JSONL omits the notice because every line must remain a data record.
Apply the cap only to presentation options when TSV/JSONL exports must remain complete.
(Or cap a property with [MarkoutMaxItems(3)] and an optional EllipsisFormat.)For rows produced incrementally, use the table stream on MarkoutWriter:
var writer = new MarkoutWriter(
Console.Out,
new TableFormatter(),
new MarkoutWriterOptions { TableMode = MarkoutTableMode.Tsv });
writer.WriteTableStart(["Display Name"], ["stable_name"]);
foreach (var name in names)
writer.WriteTableRow(name);
writer.WriteTableEnd();
With TableFormatter, TSV and JSONL rows reach the destination before
WriteTableEnd. Pretty tables wait until the end to calculate column widths.
Tail row windows and table ordering can also require buffering inside Markout.
--format pattern)Route one model through one method so every command gets every format for free:
static void Render<TView, TJson>(TView view, OutputFormat fmt, MarkoutSerializerContext ctx)
{
switch (fmt)
{
case OutputFormat.Text: MarkoutSerializer.Serialize(view, Console.Out, new PlainTextFormatter(), ctx); break;
case OutputFormat.Md: MarkoutSerializer.Serialize(view, Console.Out, new MarkdownFormatter(), ctx,
new MarkoutWriterOptions { MaxItems = 3 }); break; // first 3 rows + "... and N more"
case OutputFormat.Table: MarkoutSerializer.Serialize(view, Console.Out, new TableFormatter(), ctx); break;
case OutputFormat.Tsv: MarkoutSerializer.Serialize(view, Console.Out, new TableFormatter(), ctx,
new MarkoutWriterOptions { TableMode = MarkoutTableMode.Tsv }); break;
case OutputFormat.Jsonl: MarkoutSerializer.Serialize(view, Console.Out, new TableFormatter(), ctx,
new MarkoutWriterOptions { TableMode = MarkoutTableMode.Jsonl, JsonTypedValues = true }); break;
}
}
If a format needs byte-exact output (e.g. a verbatim packet), bypass Markout for that one case and keep Markout for the structured formats — don't try to force it.
| to | (not \|).snake_case headers and never embeds tabs/newlines in cells.Store code-like values with semantic <code>...</code> tags. XML-escape angle brackets inside
the tags:
row.Operation = "<code>dotnet test</code>";
row.Signature = "<code>Result<T> Parse<T>(string value)</code>";
Markdown renders code spans such as `Result<T> Parse<T>(string value)`. Pretty, TSV, and
JSONL remove the tags, decode the entities, and emit plain text. Do not store raw backticks or use
[MarkoutDisplayFormat("`{0}`")]; that hard-codes Markdown into the model.
JSONL must still go through Markout:
var jsonl = new MarkoutWriterOptions
{
TableMode = MarkoutTableMode.Jsonl,
JsonTypedValues = true,
};
MarkoutSerializer.Serialize(report, Console.Out, new TableFormatter(), ctx, jsonl);
Do not substitute System.Text.Json: it does not apply Markout's table projection, stable property
names, or semantic-tag decoding.
IncludeSections/IncludeDescription to trim exports rather than a second model.Markout.Ansi.Spectre package; the rest do not.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Generated from the plugin's indexed repository (richlander/markout) — no native marketplace selected
npx claudepluginhub p/richlander-markout5 skills in this plugin
/markoutUse when generating Markdown or other structured output (plain text, ANSI, pretty tables, TSV/JSONL) from C# objects, or when diagnosing Markout source-generator errors such as MARKOUT006. Markout replaces hand-built strings in CLIs, tools, reports, and agent output. It looks like System.Text.Json source-gen but the rules differ (NO reflection fallback), so it needs a generated MarkoutSerializerContext and Markout-specific attributes. Covers the required pattern: registered models, the partial context, scalar field shaping, typed value formatters, context-wide options, table diagnostics, semantic child rows, and serialization. Route non-Markdown output to markout-output-formats; data-selected/filtered views to markout-conditional-composition; and visual bars, trees, callouts, definitions, or code blocks to markout-built-in-shapes. Composite cells are covered separately. Don't decompile the Markout assembly or web-search its API — every idiom you need is in the skills./markout-built-in-shapesUse when a report needs rich visual elements — bar charts, stacked/proportional bars, alert boxes, tree hierarchies, term/definition glossaries, or code blocks — instead of hand-drawn ASCII or manual Markdown. Markout ships these as data types (Metric, Breakdown/Slice, Callout, TreeNode, Description, CodeSection, MarkoutTable, MappedTextDiff) you attach as model properties. If the task requests terminal/Unicode, plain text, ANSI, or another non-Markdown sink, also invoke markout-output-formats for the formatter call. Don't decompile the assembly or web-search the API — the shape types are here./markout-composite-cells-cardsUse when a single value must render dense in Markdown but decompose into typed columns in TSV/JSONL — before/after changes, fractions, shares, percentages, segment breakdowns, deltas and goal polarity — including MarkoutNumberFormat for Change<V> counts — or when building metric / role-matrix / verdict cards with threshold-based MarkoutEmphasis (Change<V>, Fraction, Share, Percent, Segments, Delta/Goal, MetricChange<T>, MultiSourceRow, Verdict). This is Markout's most advanced tier. Don't decompile the assembly or web-search the API — these composite types are here./markout-conditional-compositionUse when a Markout report must adapt to its data — show or hide whole sections, drop table columns that are empty/uniform, filter output to a chosen set of sections, or render one model into several shapes ("one model, many views"). This is Markout's highest-value idiom: declare the conditions with attributes instead of hand-writing if/else + StringBuilder. Don't decompile the assembly or web-search the API — the conditional idioms are here.Other plugins' skills for the same job