/markout:markoutfrom markout
Guides usage of Markout source generator to produce structured output (Markdown, plain text, ANSI, tables, TSV/JSONL) from C# objects, covering registration, serialization, and diagnostics.
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.
Package Markout (the source generator ships in it — no extra package). Default output is
Markdown. Reach for Markout whenever a tool would otherwise build strings with
Console.WriteLine / StringBuilder.
Everything you need is in the Markout skills. Do NOT
web_search/web_fetchfor Markout usage — they are authoritative and version-matched to the package. This skill covers the core pattern; conditional composition, output formats, built-in shapes, and composite cells are covered separately.Routing gate: invoke the matching companion skill before coding:
- TSV, JSONL, plain text, Unicode/terminal, ANSI, pretty output, or multiple formats:
markout-output-formats- show/hide conditions, exactly-one section variants, selected sections, quiet/detail views:
markout-conditional-composition- bars, proportional breakdowns, trees, callouts, definitions, or code blocks:
markout-built-in-shapes
using Markout;
// 1. Annotate a model when you need to customize its rendering. Registration is what is required.
[MarkoutSerializable(TitleProperty = nameof(Title))] // TitleProperty -> the H1 heading
public class Report
{
public string Title { get; set; } = "";
public int Count { get; set; } // scalar -> "Count | 3" field row
[MarkoutSection(Name = "Items")] // -> "## Items" heading
public List<Row>? Items { get; set; } // List<T> -> a table
}
[MarkoutSerializable]
public class Row { public string Name { get; set; } = ""; public string Value { get; set; } = ""; }
// 2. Register EVERY type on a partial context (the source generator fills it in).
[MarkoutContext(typeof(Report))]
[MarkoutContext(typeof(Row))]
public partial class ReportContext : MarkoutSerializerContext { }
// 3. Serialize THROUGH the context.
MarkoutSerializer.Serialize(report, Console.Out, ReportContext.Default);
[MarkoutSerializable] is optional. Types from dependencies can remain untouched; register them
on the context and put serializer-wide behavior on that context.
Shape scalar properties with attributes — never pre-format strings in the model or hand-write rows:
[MarkoutSerializable(
TitleProperty = nameof(Name), // -> the H1 heading
DescriptionProperty = nameof(Summary), // -> a paragraph under the H1 (NOT a Field | Value row)
FieldLayout = FieldLayout.Inline)] // Table (default) | Inline | Bulleted | Numbered | Plain
public class Component
{
public string Name { get; set; } = "";
public string Summary { get; set; } = "";
[MarkoutDisplayFormat("{0:N0} downloads")] // 5100000 -> "5,100,000 downloads"
public long Downloads { get; set; }
[MarkoutDisplayFormat("{0:yyyy-MM-dd}")] // DateTime -> "2024-06-01"
public DateTime Published { get; set; }
[MarkoutBoolFormat("Yes", "No")] // true -> "Yes", false -> "No"
public bool Verified { get; set; }
}
DescriptionProperty renders a property as a description paragraph, not a table row.FieldLayout.Inline puts the scalar fields on one line (Owner: … | Status: …) instead of a table.[MarkoutDisplayFormat("{0:…}")] / [MarkoutBoolFormat(t,f)] format a value in place — do not bake
the formatting into the getter or build the cell string yourself.Serialize(obj) overload. EVERY Serialize call takes a
MarkoutSerializerContext. Omitting it does not compile — the #1 mistake.[MarkoutContext(typeof(T))] is mandatory; [MarkoutSerializable] is
optional customization. The context class MUST be partial.[MarkoutSerializable] (not [JsonSerializable]),
[MarkoutContext], [MarkoutSection(Name=...)], [MarkoutPropertyName], [MarkoutIgnore].List<T> -> table; scalar -> Field | Value row;
[MarkoutSection(Name="X")] -> a ## X heading above the property.<code>...</code> instead; markout-output-formats covers its cross-format behavior.[MarkoutIgnoreInTable] on non-tabular list properties (List<Metric>, List<Breakdown>,
List<TreeNode>, List<Description>, Callout) or they get mistreated as table columns.For transformations beyond a format string, keep the property strongly typed and implement
IMarkoutValueFormatter<T>:
public sealed class ByteSizeFormatter : IMarkoutValueFormatter<long>
{
public string Format(long value) => value switch
{
>= 1_073_741_824 => $"{value / 1_073_741_824.0:0.#} GB",
>= 1_048_576 => $"{value / 1_048_576.0:0.#} MB",
>= 1_024 => $"{value / 1_024.0:0.#} KB",
_ => $"{value} B",
};
}
[MarkoutPropertyName("Package Size")]
[MarkoutValueFormatter(typeof(ByteSizeFormatter))]
public long PackageSizeBytes { get; set; }
Do not replace the numeric property with a string or format it in a getter. The generated
serializer calls Format(T) through the attribute.
Put defaults that apply to every serialization on the generated context:
[MarkoutContextOptions(SuppressTableWarnings = true)]
[MarkoutContext(typeof(Report))]
[MarkoutContext(typeof(DependencyRow))]
public partial class ReportContext : MarkoutSerializerContext { }
Use SuppressTableWarnings when registered dependency-owned types intentionally contain
non-tabular properties that produce MARKOUT001. Do not mutate those types with
[MarkoutIgnoreInTable], add a pragma, or suppress the diagnostic in the project file.
MARKOUT006 means a List<T> is being rendered as a table but its row type has no visible
columns. Fix the model: expose at least one scalar property, or intentionally render the data as
sections instead. Do not suppress the diagnostic, remove the collection, or stringify the rows.
Use [MarkoutChild] on a bool row property when true rows are semantic children of the preceding
parent:
public sealed class OrganizationRow
{
public string Name { get; set; } = "";
public int Count { get; set; }
[MarkoutChild]
public bool IsChild { get; set; }
}
The flag is not a column. Rich output prefixes the first visible cell of child rows with the child
glyph; TSV/JSONL/plain output keeps the row data unstyled. A child flag does not count as a visible
column, so the row still needs a scalar such as Name.
Fetch JSON, project to a Markout model (a plain data model is fine — no separate visual layer), serialize. Keep the JSON DTO and the Markout model separate; project between them with LINQ.
Describe the data and let the type plus attributes drive the output. Conditional sections and
columns, alternate output formats, visual shapes, and composite cells are all declared on the
model — do NOT hand-roll if/StringBuilder for them. Each of those is covered separately.
What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (richlander/markout) — no native marketplace selected
npx claudepluginhub p/richlander-markout5 skills in this plugin
/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./markout-output-formatsUse when you need output other than default Markdown — plain text / Unicode, ANSI terminal (Spectre), pretty aligned tables, or TSV/JSONL exports — or when one model must serve several formats from a single render path (a CLI `--format` switch). Also covers semantic inline code that renders as Markdown code spans but decodes to plain text in TSV/JSONL. Pick the format with a formatter + MarkoutWriterOptions; never hand-build TSV/JSONL. Don't decompile the assembly or web-search the API — the multi-format idioms are all here.Other plugins' skills for the same job