/markout:markout-conditional-compositionfrom markout
Declares conditional sections, adaptive columns, and multi-view reports in Markout using attributes instead of manual if/else. Useful for data-driven Markout reports.
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.
The trap this skill prevents: hand-rolling if (hasErrors) sb.AppendLine("## Errors") and manual
column arithmetic. In Markout you declare the condition on the model; the generator renders the
right shape. This keeps one source of truth and makes the same model serve quiet/detail/export modes.
Markout has no reflection fallback. Every report needs an annotated model, a partial context
registering each model type, and a Serialize call that passes it — there is no Serialize(obj)
overload, and omitting the context does not compile.
using Markout;
[MarkoutContext(typeof(Inspection))] // the model AND every user element type of a List<T>
[MarkoutContext(typeof(FailureRow))]
[MarkoutContext(typeof(WarnRow))]
[MarkoutContext(typeof(MatchRow))]
public partial class InspectionContext : MarkoutSerializerContext { }
var ctx = InspectionContext.Default; // the `ctx` passed in the examples below
[MarkoutSerializable(TitleProperty = nameof(Name))]
public class Inspection
{
public string Name { get; set; } = "";
// Section renders ONLY when HasFailures is true. Compute the predicate on the model.
[MarkoutSection(Name = "Failures", ShowWhenProperty = nameof(HasFailures))]
public List<FailureRow>? Failures { get; set; }
public bool HasFailures => Failures is { Count: > 0 };
// EmptyText shows a fallback paragraph when the list is non-null but empty; null omits the section.
[MarkoutSection(Name = "Warnings", EmptyText = "No warnings.")]
public List<WarnRow>? Warnings { get; set; }
}
ShowWhenProperty = nameof(Bool) gates a section on a bool property.[MarkoutShowWhen(nameof(Bool))] gates a scalar field the same way.[MarkoutSkipNull] / [MarkoutSkipDefault] drop individual fields when null/default.// Drop the "Pattern" column when it's uniform/empty across the rows (keeps tables compact).
// The attribute goes on the SECTION list and names a static bool predicate + the column to hide.
[MarkoutSection(Name = "Matches")]
[MarkoutIgnoreColumnWhen(nameof(PatternIsUniform), "Pattern")]
public List<MatchRow>? Matches { get; set; }
public static bool PatternIsUniform(List<MatchRow>? rows)
=> rows?.Select(r => r.Pattern).Distinct().Count() <= 1;
// IgnoreProperty hides named columns unconditionally.
[MarkoutSection(Name = "Debug", IgnoreProperty = "InternalId,Debug")]
public List<MatchRow>? DebugRows { get; set; }
[MarkoutIgnoreColumnWhen(...)] is the declarative replacement for "compute distinct values, then
rebuild headers and rows." Columns hidden this way are also dropped from TSV/JSONL decomposition.
var options = new MarkoutWriterOptions { IncludeSections = new HashSet<string> { "Failures" } };
MarkoutSerializer.Serialize(report, Console.Out, new MarkdownFormatter(), ctx, options);
IncludeSections renders only the named sections — the caller-side lever for "just show me X"
without a second model, and the declarative way to drive quiet/detail/verbosity views from one model.
When a mode needs a different projection of the same logical section (e.g. terse vs with-docs),
declare multiple properties with the same Name and gate them so exactly one renders:
[MarkoutSection(Name = "Members", ShowWhenProperty = nameof(Terse))]
public List<MemberRow>? MembersTerse { get; set; }
[MarkoutSection(Name = "Members", ShowWhenProperty = nameof(WithDocs))]
public List<MemberDocRow>? MembersWithDocs { get; set; }
This "same-name polymorphic section" is how a single report serves --docs, quiet, and select
modes without branching in the writer. Set the gating bools when you build the model.
if+AppendLine, no manual header/row rebuilding.Has*, Terse) as computed properties on the model, next to the data.ShowWhenProperty gates rather than
relying on empty-list omission; the gates make the selected projection explicit.null list omits a section; empty list + EmptyText shows the fallback.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
/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-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