MCP HubMCP Hub
스킬 목록으로 돌아가기

pierre-guard

backnotprop
업데이트됨 2 days ago
7 조회
5,598
382
5,598
GitHub에서 보기
메타aidesign

정보

이 기술은 Plannotator의 코드 리뷰 UI와 Shadow DOM을 사용하는 `@pierre/diffs` 패키지 간의 통합을 보호합니다. DiffViewer 컴포넌트를 수정하거나, 패키지를 업데이트하거나, 섀도우 경계를 넘는 CSS/선택자를 변경할 때 사용하세요. 이 기술은 변경 사항이 diff 렌더러의 문서화되지 않은 내부 구조와의 취약한 계약을 깨뜨리지 않도록 검증하는 데 도움이 됩니다.

빠른 설치

Claude Code

추천
기본
npx skills add backnotprop/plannotator -a claude-code
플러그인 명령대체
/plugin add https://github.com/backnotprop/plannotator
Git 클론대체
git clone https://github.com/backnotprop/plannotator.git ~/.claude/skills/pierre-guard

Claude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요

문서

Pierre Integration Guard

Plannotator's code review UI wraps @pierre/diffs — an open-source diff renderer that uses Shadow DOM. The integration is concentrated in a single file but relies on undocumented internals (shadow DOM selectors, CSS variable names, grid layout assumptions). This skill helps verify changes don't break that contract.

Source of Truth

Always verify against the upstream repo or local .d.ts files — don't rely on memory of the API shape.

What We Import

import { FileDiff } from '@pierre/diffs/react';
import { getSingularPatch, processFile } from '@pierre/diffs';

These are the only three imports. DiffViewer.tsx is the only file that touches Pierre.

API Surface to Guard

1. Component Props (FileDiff)

Read the current prop types from node_modules/@pierre/diffs/dist/react/index.d.ts or the upstream source. The props we use:

PropTypeNotes
fileDiffFileDiffMetadataFrom getSingularPatch() or processFile()
optionsFileDiffOptions<T>See options table below
lineAnnotationsDiffLineAnnotation<T>[]{ side, lineNumber, metadata }
selectedLinesSelectedLineRange | null{ start, end, side }
renderAnnotation(ann) => ReactNodeCustom inline annotation renderer
renderHoverUtility(getHoveredLine) => ReactNodeThe + button on hover (deprecated upstream — watch for removal)

2. Options Object

OptionValue We PassRisk
themeType'dark' | 'light'Low — standard enum
unsafeCSSCSS stringHigh — targets internal selectors
diffStyle'split' | 'unified'Low — standard enum
diffIndicators'bars'Low
hunkSeparators'line-info'Low
enableLineSelectiontrueLow
enableHoverUtilitytrueMedium — deprecated prop
onLineSelectionEndcallbackMedium — signature could change

3. Shadow DOM Selectors (via unsafeCSS)

These are the selectors we inject CSS rules against. They target data-* attributes inside Pierre's shadow DOM. If Pierre renames or removes any of these, our styling breaks silently.

Currently used:

  • :host — shadow root
  • [data-diff] — root diff container
  • [data-file] — file wrapper
  • [data-diffs-header] — header bar
  • [data-error-wrapper] — error display
  • [data-virtualizer-buffer] — virtual scroll buffer
  • [data-file-info] — file metadata row
  • [data-column-number] — line number gutter
  • [data-diffs-header] [data-title] — title (we hide it)
  • [data-diff-type='split'] — split layout mode
  • [data-overflow='scroll'] / [data-overflow='wrap'] — overflow mode

4. CSS Variables We Override

We override these --diffs-* variables to theme Pierre:

  • --diffs-bg, --diffs-fg — base colors
  • --diffs-dark-bg, --diffs-light-bg — theme-specific backgrounds
  • --diffs-dark, --diffs-light — theme-specific foregrounds

5. CSS Variables We Inject (Custom)

We set these on a wrapper div outside the shadow DOM, relying on CSS custom property inheritance:

  • --split-left, --split-right — control the split pane grid ratio

The unsafeCSS grid override references these: grid-template-columns: var(--split-left, 1fr) var(--split-right, 1fr). The 1fr fallback ensures the layout is safe if the variables aren't set.

6. Grid Layout Assumption

Pierre's split view uses CSS Grid with grid-template-columns: 1fr 1fr. We override this for the resizable split pane. If Pierre changes its layout engine (e.g., to flexbox or a different grid structure), the override will stop working.

How to verify: In the upstream source, search for grid-template-columns in the diff component styles.

Verification Checklist

When reviewing changes that touch the Pierre integration, check:

Props & Types

  • Read the current .d.ts files to confirm prop names and types haven't changed
  • Check if renderHoverUtility is still supported (it's deprecated — may be removed)
  • Verify DiffLineAnnotation still uses side: 'deletions' | 'additions' (not 'old' | 'new')
  • Confirm SelectedLineRange shape: { start, end, side? }

Shadow DOM Selectors

  • Grep the upstream source for each data-* attribute we target in unsafeCSS
  • If upgrading the package version, diff the old and new CSS/HTML output for renamed attributes
  • Test both split and unified views — selectors are layout-dependent

CSS Variables

  • Grep upstream for --diffs-bg, --diffs-fg, and other variables we override
  • Verify the variable names haven't been renamed or removed
  • Check that !important is still needed (Pierre may change specificity)

Theme Compliance

  • New UI elements must use theme tokens (bg-border, bg-primary, etc.), not hardcoded colors like bg-blue-500
  • The existing ResizeHandle component in packages/ui/components/ResizeHandle.tsx sets the visual convention — match it

Build & Runtime

  • Run bun run dev:review and verify the diff renders in both split and unified modes
  • Check the browser console for Pierre warnings (e.g., parseLineType: Invalid firstChar)
  • Test with add-only and delete-only files (Pierre doesn't render split grid for these)
  • If changing UI code, remember build order: bun run --cwd apps/review build && bun run build:hook

When Upgrading @pierre/diffs

  1. Check the upstream changelog / commit history at https://github.com/pierrecomputer/pierre
  2. Diff the .d.ts files between old and new versions:
    # Before upgrading, snapshot current types
    cp -r node_modules/@pierre/diffs/dist /tmp/pierre-old
    # After upgrading
    diff -r /tmp/pierre-old node_modules/@pierre/diffs/dist
    
  3. Search for renamed/removed data attributes in the new version
  4. Run through the full verification checklist above
  5. Test the resizable split pane — it depends on grid layout internals

GitHub 저장소

backnotprop/plannotator
경로: .agents/skills/pierre-guard
0
agentsclaude-codecode-reviewcodexobsidianopencode

연관 스킬

content-collections

메타

이 스킬은 콘텐츠 콜렉션(Content Collections)을 위한 프로덕션 검증된 설정을 제공합니다. 콘텐츠 콜렉션은 Markdown/MDX 파일을 Zod 검증이 포함된 타입 안전한 데이터 콜렉션으로 변환해주는 TypeScript 최우선 도구입니다. 블로그, 문서 사이트 또는 콘텐츠 중심의 Vite + React 애플리케이션을 구축할 때 타입 안전성과 자동 콘텐츠 검증을 보장하기 위해 사용하세요. Vite 플러그인 구성과 MDX 컴파일부터 배포 최적화 및 스키마 검증에 이르기까지 모든 것을 다룹니다.

스킬 보기

polymarket

메타

이 스킬은 개발자들이 Polymarket 예측 시장 플랫폼을 활용한 애플리케이션을 구축할 수 있도록 지원하며, 거래 및 시장 데이터를 위한 API 통합 기능을 포함합니다. 또한 WebSocket을 통한 실시간 데이터 스트리밍을 제공하여 실시간 거래와 시장 활동을 모니터링할 수 있습니다. 이를 통해 거래 전략을 구현하거나 실시간 시장 업데이트를 처리하는 도구를 생성하는 데 활용할 수 있습니다.

스킬 보기

creating-opencode-plugins

메타

이 스킬은 개발자들이 명령어, 파일, LSP 작업 등 25개 이상의 이벤트 유형에 연결되는 OpenCode 플러그인을 만들 수 있도록 돕습니다. JavaScript/TypeScript 모듈을 위한 플러그인 구조, 이벤트 API 명세, 구현 패턴을 제공합니다. OpenCode AI 어시스턴트의 라이프사이클을 사용자 정의 이벤트 기반 로직으로 가로채거나, 모니터링하거나, 확장해야 할 때 사용하세요.

스킬 보기

sglang

메타

SGLang은 RadixAttention 프리픽스 캐싱을 활용하여 JSON, 정규식, 에이전트 워크플로우를 위한 고속 구조화 생성에 특화된 고성능 LLM 서빙 프레임워크입니다. 특히 반복되는 프리픽스가 있는 작업에서 상당히 빠른 추론 속도를 제공하여 복잡한 구조화 출력 및 다중 턴 대화에 이상적입니다. 제약 디코딩이 필요하거나 광범위한 프리픽스 공유가 있는 애플리케이션을 구축할 때는 vLLM과 같은 대안보다 SGLang을 선택하십시오.

스킬 보기