Reflect solution

From NikiforovAll/claude-code-rules · View interactive version

Reflect solution is an AI agent skill from the GitHub repository NikiforovAll/claude-code-rules. Summarize WHAT WAS SHIPPED in a Claude Code session as a self-contained HTML slide deck — the elevator pitch (problem, solution, decisions, artifacts, verification, gaps), not a play-by-play of tool calls or debugging detours. Defaults to the current in-context session; optionally accepts a session

How to use this skill

Skill file

/reflect-solution — solution recap deck

Produce a single-file HTML slide deck summarizing the outcome of a Claude Code session: what shipped, why, and how it was verified. Audience: someone who wants the elevator pitch, not the journey.

Sibling to /reflect. Where /reflect looks at wrong turns, this skill looks at what was delivered. Tool-call churn, retries, dead-ends, and reversals are excluded unless they shaped a final decision.

Self-contained. This skill ships its own working starter (assets/template.html) — fonts, CSS tokens, all six content blocks, IntersectionObserver, keyboard nav, theme toggle. The agent's job is to fill the template with extracted content, not to rebuild the scaffolding from scratch.

When to use

Session JSONLs live under: ~/.claude/projects/<encoded-cwd>/<session-id>.jsonl

What to extract (menu, not template)

Outcome-focused. Drop the journey. An item belongs in the deck only if it would matter in a PR description.

The deck structure should fit the session — not the other way around. Pick from the menu below; skip what's irrelevant; add what isn't listed if the session calls for it. A 3-slide deck is fine. So is 8. Don't pad to hit a count, don't force a section just because it's in the list.

Common sections (use what fits):

Other sections that may earn a slide if the session reveals them: stakeholders, deadlines, related tickets/PRs, performance numbers, before/after diff, architecture sketch, a punchline pull-quote.

Always omit: session metadata footer (id, date, turn count). The deck is about the solution, not the session.

Voice and language

The audience is technical (engineers, reviewers). Write like a commit message or a postmortem, not a launch announcement.

Problem statement

This is the most important slide. A reader who only sees this slide should understand what was wrong before the session started. Treat it like the "Background" section of a bug ticket.

Good: The deck template hard-coded a 7-section taxonomy. Sessions with no decisions or no followups produced empty slides. Agents had no guidance on when to drop a section.

Bad: We wanted to make the deck more flexible and adaptable so that it could elegantly handle a wider variety of sessions and deliver a more polished experience.

Honesty rules

Output

Resolve a temp dir from the environment, in this preference order:

  1. $TMPDIR (Unix/macOS)
  2. $TMP or $TEMP (Windows / Git Bash)
  3. /tmp as fallback

Create <temp>/reflect-solution/ (mkdir -p). Write the deck as <temp>/reflect-solution/<slug>.html.

Slug rules — kebab-case, derived from the solution (not the session id):

Open with start "" <path> (Git Bash on Windows).


How to render — fill the template, don't rebuild

The starter at assets/template.html is a working deck: light theme by default (with a dark toggle persisted in localStorage), full slide shell, all six content blocks pre-styled, keyboard nav (↑/↓/Space/PageUp/PageDown/Home/End/j/k), touch swipe, IntersectionObserver reveals, nav rail, and prefers-reduced-motion respect.

Workflow

  1. Read assets/template.html and assets/viewport-base.css.
  2. Copy the template to your temp output path as the deck's starting point.
  3. Inline the full contents of assets/viewport-base.css into the <style> block where the abridged base styles live (the comment marks the spot). Don't link to it — the deck must be a single self-contained HTML file.
  4. Replace the {{...}} placeholders with extracted content.
  5. Duplicate / remove body-slide <section> elements as needed for your taxonomy. Keep one slide per taxonomy section by default; split if a section overflows density limits (see below). Update the nav rail <a> list to match.
  6. Pick the right content block per slide (see catalog) — don't default to bullets.
  7. Validate density and font/style rules before saving.

Light theme is the default

<html data-theme="light">. Do NOT change this. The dark theme exists as a user-toggleable option (button bottom-right, key persists in localStorage). Both themes are wired; just leave them alone.

Content block catalog (copy from template, fill in)

| Block | Class | When |

|---|---|---|

| Bullets | <ul class="bullets"> | 4–6 substantial parallel items. Each <li> leads with <b>…</b> — then a sentence. Mono em-dash marker auto-rendered. |

| Artifact grid | <div class="artifacts"> w/ .artifact cards | Files created/modified. 2-col grid. Each card: .tag.added/.modified/.removed, .path (mono), .purpose (sans). Banned: bulleted list of file paths. |

| Decision rows | <div class="decisions"> w/ .decision rows | Locked-in choices + rejected alternatives. Two columns ("Chose" / "Rejected") with reason underneath. |

| Code/output | <pre class="codeblock"> | Real command + output (8–10 lines max). .ln spans for line numbers. |

| Pull-quote | <div class="pullquote"> | One italic Newsreader sentence + mono attribution. For Title subtitle or a punchline slide. |

| Two-column prose | <div class="cols2"> | Dense paragraphs. Use for Problem when there's a story to tell. |

Slide shell (every body slide)

<section class="slide" id="sN">
  <div class="eyebrow reveal"><span class="num">0N</span> SECTION</div>
  <h2 class="title reveal"><em>Italic part</em> <span class="roman">roman tail.</span></h2>
  <div class="hairline reveal"></div>
  <div class="body">
    <!-- one of the content blocks above -->
  </div>
  <div class="hairline reveal"></div>
  <div class="footer reveal">
    <span>EYEBROW · CONTEXT</span>
    <span class="right">project / status</span>
  </div>
</section>

The eyebrow + numbered title hairline anchors the top, the bottom hairline + footer rail anchors the bottom. Both are mandatory — they prevent the "floating bullets in a void" failure mode.

Title slide

Distinct layout (no eyebrow, no body):

<section class="slide title-slide" id="s0">
  <div class="pitch reveal"><em>Italic pitch</em> <span class="roman">roman tail.</span></div>
  <div class="meta reveal">SOLUTION RECAP <span class="sep">·</span> PROJECT-OR-CONTEXT</div>
</section>

Density (avoid empty slides)

The biggest failure mode is sparse slides — 3 short bullets in the upper third, the rest of the viewport empty. Counter it:

Typography rules

The template hard-codes these — don't override:

Animation guidance

See assets/animation-patterns.md for the slim crib sheet (entrance variants, what NOT to do, common breakage). The default .reveal class with stagger is already wired in template.html.

CSS gotcha

Do not negate CSS functions directly. right: -clamp(...) is silently ignored. Use right: calc(-1 * clamp(...)).


Files in this skill

Workflow

Default (no args) — recap current session:

  1. From conversation memory, walk the taxonomy: title, problem, solution, artifacts, decisions, verification, followups. Drop everything that's journey-not-outcome.
  2. For each section, pick a content block. If a section has thin content, switch block types or merge.
  3. Resolve temp dir, derive slug.
  4. Read assets/template.html and assets/viewport-base.css.
  5. Copy the template to <temp>/reflect-solution/<slug>.html. Inline viewport-base.css into the <style> block. Replace placeholders. Add/remove body slides. Update nav rail.
  6. Open with start "" <path>.

Explicit session — /reflect-solution <id-or-path>:

  1. Resolve to a JSONL path (if just an id, look under ~/.claude/projects/<encoded-cwd>/<id>.jsonl).
  2. Run scripts/analyze_session.py <path>. Skill is forked, so the compressed transcript is safe in context.
  3. Extract the taxonomy from the transcript yourself.
  4. Fallback to JSONL when transcript is lossy. Transcript truncates tool args/results and long messages. When detail matters (full file lists, full diff, full user goal statement), Read the JSONL directly with offset/limit scoped to the relevant turn.
  5. Steps 2–6 from the default workflow.

Notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.