Skip to content
cccskills
FreePublished on GitHub

mk:preview

Use when generating visual artifacts — explanations, diagrams, slides, or diff visualizations. Triggers on "explain X visually", "diagram this", "show as slides", "diff against main". NOT for rendering a plan as HTML (see mk:visual-plan), live media generation (see mk:multimodal), browser QA (see mk:qa), or plan critique (see mk:plan-ceo-review).

The English summary is being prepared. Showing the original description.

See how to install

Files included (9)

  • SKILL.md11.2 KB
  • assets/architecture.html7.6 KB
  • assets/data-table.html7.2 KB
  • assets/mermaid-flowchart.html7.3 KB
  • assets/slide-deck.html7.0 KB
  • references/analytical-modes.md4.7 KB
  • references/generation-modes.md5.6 KB
  • references/html-design-rules.md13.3 KB
  • references/mermaid-essentials.md3.0 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

mk:preview

Generates visual artifacts — markdown and self-contained HTML — for explaining code, drawing diagrams, building slide decks, and visualizing diffs. Rendering a plan as HTML belongs to mk:visual-plan.

No live server. No Python. Pure markdown + HTML + bash file operations. Output writes to tasks/plans/{active-plan}/visuals/ when an active plan exists; otherwise falls back to tasks/visuals/.

When to Use

  • A reader needs to understand an unfamiliar code path, protocol, or architecture
  • A diagram (flowchart, sequence, ER) would communicate the topology faster than prose
  • Step-by-step content benefits from slides over a single long page
  • A pre-PR diff review needs visual KPIs, file map, and change cards
  • Stakeholders prefer a self-contained HTML page they can open in a browser without a server

For rendering a plan directory as a shareable HTML page, use mk:visual-plan.

Default (No Arguments)

If invoked with no arguments, present available operations via AskUserQuestion. Header: "Preview Operation". Question: "What would you like to do?".

OperationDescription
--explainMarkdown visual explanation (ASCII + Mermaid + prose)
--diagramMarkdown diagram (ASCII + Mermaid)
--slidesMarkdown presentation slides
--asciiTerminal-friendly ASCII diagram only
--html --explainSelf-contained HTML explanation, opens in browser
--html --diagramHTML diagram with zoom/pan controls
--html --slidesMagazine-quality HTML slide deck
--html --diffHTML diff visualization (KPI grid + file map + cards)

Recommended default: --explain or --html --explain.

Usage

Markdown Generation

  • /mk:preview --explain <topic> — visual explanation (ASCII + Mermaid + concepts)
  • /mk:preview --diagram <topic> — focused diagram (ASCII + Mermaid)
  • /mk:preview --slides <topic> — presentation slides (one concept per slide)
  • /mk:preview --ascii <topic> — ASCII-only diagram (terminal-friendly)

HTML Generation

  • /mk:preview --html --explain <topic> — self-contained HTML explanation
  • /mk:preview --html --diagram <topic> — HTML diagram with zoom/pan
  • /mk:preview --html --slides <topic> — magazine-quality slide deck

Analytical Modes

  • /mk:preview --html --diff [ref] — visualize a git diff. Default ref = main. Accepts branch, commit, range, PR number.

--ascii does not combine with --html (terminal-only by design). To render a plan as HTML, use mk:visual-plan.

Argument Resolution

Priority order:

  1. --html flag detected → set HTML output mode
  2. Generation flag detected (--explain, --diagram, --slides, --ascii) → load references/generation-modes.md
  3. HTML-only flag (--diff) → implies --html; load references/analytical-modes.md
  4. Topic missing → ask user via AskUserQuestion
  5. Topic present → continue

Topic-to-slug:

  • Lowercase the topic
  • Replace spaces and special chars with hyphens
  • Remove non-alphanumeric except hyphens
  • Collapse multiple hyphens to single
  • Trim leading/trailing hyphens
  • Truncate at 80 chars on a word boundary

Title placeholder {topic} uses the original input in title case, not the slug.

Multiple flags: if more than one generation flag is supplied, use the first; the rest become part of the topic string.

Output Path Lifecycle

session-state/active-plan exists?
  yes → value is absolute path?
          yes → {value}/visuals/
          no  → tasks/plans/{value}/visuals/   (treated as slug)
  no  → tasks/visuals/

Detail and the bash detection snippet live in references/generation-modes.md → "Step 1 — Resolve output path". The fallback path is logged on stderr (warn:) so silent path mismatches surface immediately.

Error Handling

ErrorAction
Topic empty after sanitizationAsk user for an alphanumeric topic
Flag without topicAsk user for the topic string
File write failureReport the error; suggest checking disk space and permissions
Output path already existsOverwrite without prompting
--diff outside a git repoExplain: "No git repository detected"
--diff with PR number, no ghSuggest installing gh from https://cli.github.com/
--html --ascii combinationReject; suggest --html --diagram instead
Active-plan path absolute but missingLog warning; fall back to tasks/visuals/
Active-plan slug with no matching dirLog warning; fall back to tasks/visuals/

Reference Loading

Every mode reads its references BEFORE writing the output file.

ModeAlways readsMode-specific
--explainreferences/generation-modes.md, references/mermaid-essentials.md—
--diagramreferences/generation-modes.md, references/mermaid-essentials.md—
--slidesreferences/generation-modes.md, references/mermaid-essentials.md—
--asciireferences/generation-modes.md—
--html --explainreferences/html-design-rules.md, ../frontend-design/references/anti-slop-directives.mdtemplate assets/architecture.html
--html --diagramreferences/html-design-rules.md, references/mermaid-essentials.md, ../frontend-design/references/anti-slop-directives.mdtemplate assets/mermaid-flowchart.html
--html --slidesreferences/html-design-rules.md, ../frontend-design/references/anti-slop-directives.mdtemplate assets/slide-deck.html
--html --diffreferences/html-design-rules.md, references/analytical-modes.md, ../frontend-design/references/anti-slop-directives.mdtemplate assets/data-table.html, assets/architecture.html

Templates in assets/ are out-of-band — they are not auto-Read; the agent reads the template only when generating the matching mode.

Composes With

  • mk:ui-design-system — palette and typography selection (assets/colors.csv 160 rows, assets/typography.csv 73 rows). HTML modes vary palette per run.
  • mk:frontend-design — anti-slop forbidden patterns. Cited via ../frontend-design/references/anti-slop-directives.md, not duplicated.
  • mk:web-to-markdown — for users who want to view a generated markdown file in a browser, no server bundled here.
  • mk:visual-plan — the owner of plan-as-HTML rendering; route plan-render requests there.

Gotchas

  • Mermaid .node class collision — Mermaid.js uses .node internally. Page-level .node CSS leaks into diagrams. Use .ve-card or any non-.node class on cards.
  • Mandatory theme toggle — every HTML artifact MUST include the light/dark toggle button as the first child of <body> per references/html-design-rules.md. Missing toggle = incomplete output.
  • Mermaid theme is static at load — switching the page theme does not re-skin Mermaid SVG internals; the diagram color palette is read once at init. Document this; do not pretend otherwise.
  • Output path falls back silently — when session-state/active-plan is missing or unreadable, output writes to tasks/visuals/. Log the fallback on stderr so users notice; do not raise.
  • Slug truncation at 80 chars — topics get lowercased, hyphenated, stripped of non-alphanumerics, and truncated at word boundary. Title placeholder uses the original input in title case (not slug). Mismatch silently produces wrong filenames.
  • Topic strings are HTML-untrusted — interpolating --explain "</title><script>alert(1)</script>" MUST render as literal text. HTML-entity-encode < > & " ' in element and attribute contexts. See references/html-design-rules.md for context-by-context encoding rules.
  • Browser auto-open is conditional — headless / SSH / WSL environments cannot open a browser. The shell snippet detects these cases and prints the path instead of invoking open/xdg-open.

Workflow Position

  • Phase: on-demand
  • Follows: nothing required
  • Precedes: nothing required
  • Common pairings: invoked after a researcher report or planner output to communicate findings; invoked before a review meeting to explain a code path or diagram an architecture.

Composes Into

  • mk:cook may invoke --explain to communicate a complex implementation phase
  • mk:visual-plan owns plan-as-HTML rendering; mk:plan-ceo-review CRITIQUES plans — neither overlaps this skill's generic explain/diagram/slides/diff output

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Use this skill to generate well-branded interfaces and assets for MeowKit (AI Agent Toolkit for Claude Code), either for production or throwaway prototypes/mocks/etc. Contains essential design guidelines, colors, type, fonts, assets, and UI kit components for prototyping.

The English summary is being prepared. Showing the original description.

ngocsangyem/MeowKit15Updated Jul 28, 2026

Turn a raw idea into ONE honest recommendation: interview one question at a time until confirmed, then give a verdict with trade-offs and a checklist. Not for options or debate.

The English summary is being prepared. Showing the original description.

ngocsangyem/MeowKit15Updated Jul 28, 2026

Browser automation CLI for agents: navigate, click/fill, screenshot, extract data, test apps, Electron/Slack, cloud browsers. NOT for the user's real Chrome profile/cookies (mk:chrome-profile).

The English summary is being prepared. Showing the original description.

ngocsangyem/MeowKit15Updated Jul 28, 2026

Detects the right agent and complexity tier at Phase 0 orient; runs first in every workflow. NOT for runtime agent routing inside a single skill.

The English summary is being prepared. Showing the original description.

ngocsangyem/MeowKit15Updated Jul 28, 2026

Angular v20+ patterns: components, signals, services, forms, routing, HTTP, testing, SSR. Auto-activates on .ts files in Angular projects (angular.json detected).

The English summary is being prepared. Showing the original description.

ngocsangyem/MeowKit15Updated Jul 28, 2026

Design and review durable REST, GraphQL, RPC, or event API contracts: shape, compatibility, pagination, error semantics. Discovers existing consumers first. Not implementation, schema, or release.

The English summary is being prepared. Showing the original description.

ngocsangyem/MeowKit15Updated Jul 28, 2026

See all skills by ngocsangyem

Report a problem with this skill