diffs

Use when an app uses @pierre/diffs to render or edit code files, diffs, patches, merge conflicts, or CodeView review surfaces, including React, vanilla JavaScript, SSR, workers, annotations, selection, and custom Shiki languages or themes.

Install
npx skills add 'https://github.com/pierrecomputer/pierre/tree/main/skills/diffs'
Download bundle ↓
main · 1831817Scanned 2026-09-15

Contributors

GitHub-linked commit authors for this SKILL.md at the saved revision. Co-authors and history before file renames are not included.

File history ↗
View on GitHub
← Back to SKILL.md

Recipe: add line annotations and selection

Pass annotation data and a renderer to the surface:

import type { DiffLineAnnotation } from '@pierre/diffs/react';
import { MultiFileDiff } from '@pierre/diffs/react';

const annotations: DiffLineAnnotation<{ message: string }>[] = [
  {
    side: 'additions',
    lineNumber: 8,
    metadata: { message: 'Review this line.' },
  },
];

<MultiFileDiff
  oldFile={oldFile}
  newFile={newFile}
  lineAnnotations={annotations}
  renderAnnotation={(annotation) => <p>{annotation.metadata.message}</p>}
  options={{
    enableLineSelection: true,
    onLineSelectionEnd(range) {
      saveSelection(range);
    },
  }}
/>;

Use LineAnnotation for a single file. Use DiffLineAnnotation for a diff. Control the active selection with the selectedLines prop.

Referenced from SKILL.md