Skip to content

feat: add pr-screenshots skill to shared skills#2

Merged
nick-inkeep merged 10 commits intomainfrom
feat/pr-screenshots
Feb 19, 2026
Merged

feat: add pr-screenshots skill to shared skills#2
nick-inkeep merged 10 commits intomainfrom
feat/pr-screenshots

Conversation

@nick-inkeep
Copy link
Contributor

Summary

  • Adds a general-purpose pr-screenshots skill to plugins/shared/skills/
  • Ported from inkeep/skills#1, generalized for any web project
  • Three scripts: Playwright capture with sensitive data masking, Sharp annotation (labels, borders, stitching), and pre-upload secret validation
  • Includes PR body markdown templates

What's included

plugins/shared/skills/pr-screenshots/
├── SKILL.md                         # Skill instructions
├── scripts/
│   ├── capture.ts                   # Playwright screenshot capture + auto-masking
│   ├── annotate.ts                  # Sharp-based image annotation
│   └── validate-sensitive.ts        # Pre-upload sensitive data check
└── references/
    └── pr-templates.md              # PR body markdown templates

End-to-end QA results

All three scripts tested end-to-end:

Script Test Result
capture.ts Capture single route (example.com) Pass
capture.ts Multi-route capture (httpbin.org /, /forms/post) Pass
capture.ts Full-page mode Pass
capture.ts Viewport parsing, arg validation Pass
validate-sensitive.ts Detects OpenAI, Anthropic, Stripe, AWS, GitHub, PEM, JWT, Bearer, DB conn, generic secrets Pass (16/16 patterns)
validate-sensitive.ts Zero false positives on clean text Pass
validate-sensitive.ts Exit code 1 on critical, 0 on warnings/clean Pass
annotate.ts Label mode — correct dimensions (206x189 from 200x150 input) Pass
annotate.ts Stitch mode — correct dimensions (416x186) Pass
annotate.ts Special chars in labels (apostrophe, HTML entities) Pass
annotate.ts Error cases (no args, stitch with 1 image) Pass
Integration Capture → validate → annotate → stitch pipeline Pass

83 total test assertions, 0 failures.

Test plan

  • SKILL.md quality: Frontmatter valid, all sections present, internal links resolve, no Inkeep-specific strings, CLI args match capture.ts
  • capture.ts e2e: Single route, multi-route, full-page mode all produce valid PNGs and .dom-text.txt files
  • annotate.ts e2e: Label mode and stitch mode produce correct PNGs with expected dimensions
  • validate-sensitive.ts e2e: Correctly detects dirty files (exit 1), passes clean files (exit 0)
  • Full pipeline: capture → validate → annotate → stitch works end-to-end against real web pages
  • Code audit: No security issues, proper error handling, browser cleanup in finally blocks

Screenshots generated by the skill itself are uploaded as PR comments below.

nick-inkeep and others added 2 commits February 18, 2026 10:32
Ports the general-purpose pr-screenshots skill from inkeep/skills#1.
Captures, redacts sensitive data, annotates, and embeds screenshots
in GitHub PRs for UI changes.

Includes three scripts:
- capture.ts: Playwright-based screenshot capture with auto-masking
- annotate.ts: Sharp-based image labeling and side-by-side stitching
- validate-sensitive.ts: Pre-upload secret detection

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nick-inkeep
Copy link
Contributor Author

nick-inkeep commented Feb 18, 2026

Demo Screenshots — generated by the skill itself

These screenshots were captured and annotated using the pr-screenshots skill scripts during end-to-end QA testing.

1. Raw capture (capture.ts)

tsx scripts/capture.ts --base-url https://example.com --routes "/" --output-dir ./pr-screenshots

Raw capture — example.com

2. Labeled annotation (annotate.ts)

tsx scripts/annotate.ts --input index.png --label "Capture Demo" --border "#3b82f6" --output capture-demo.png

Labeled capture — blue header

3. Side-by-side stitch (annotate.ts)

tsx scripts/annotate.ts --stitch before.png after.png --labels "Before,After" --output stitch-demo.png

Stitch demo — Before/After comparison

4. Sensitive data validation (validate-sensitive.ts)

tsx scripts/validate-sensitive.ts --dir ./pr-screenshots
✓ index.dom-text.txt: clean
✅ All files clean. Safe to upload.

5. Full pipeline verified

capture.ts → validate-sensitive.ts → annotate.ts (label + stitch)
     ↓              ↓                      ↓
  .png files    exit 0 (clean)      labeled + stitched PNGs
  .dom-text.txt

All 83 test assertions pass. No blocking issues found.

nick-inkeep and others added 8 commits February 18, 2026 10:35
Screenshots generated by the skill itself during end-to-end QA testing:
- raw-capture.png: Raw capture output from capture.ts
- capture-demo.png: Labeled annotation from annotate.ts
- stitch-demo.png: Side-by-side stitch from annotate.ts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ills

Add playwright skill (plugins/eng/skills/playwright/) with 35 browser
automation helpers: console monitoring, network capture, a11y audits,
video recording, performance metrics, responsive screenshots, network
simulation, and state inspection.

Update qa-test skill with cross-skill references to playwright helpers
for structured browser inspection during QA flows.

Update pr-screenshots skill with --pre-script flag and interaction-first
workflow for capturing post-interaction page states.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rename plugins/eng/skills/playwright/ → use-browser/ and update all
cross-skill references in qa-test and pr-screenshots.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rename plugins/shared/skills/pr-screenshots/ → screengrabs/ and update
all internal references (frontmatter, default output dirs, script
defaults, gitignore).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- implement: fix broken dev-browser → use-browser references (6 occurrences),
  add guidance for console/network/a11y helpers in browser verification
- pull-request: add /screengrabs invocation for automated PR screenshots
  when diff touches UI files
- review: add /use-browser for verifying UI fixes with screenshot evidence
- ship: add /screengrabs before PR body writing for UI changes,
  update capability-detection to name /use-browser skill
- docs: add /use-browser and /screengrabs for capturing UI screenshots
  when writing user-facing documentation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5-phase workflow (Triage → Reproduce → Investigate → Fix → Harden) with
Iron Law enforcement (no fixes without root cause investigation), bug
category triage playbooks for 9 categories, MCP tool usage patterns,
hypothesis-test-refine cycles, agent metacognition (loop detection,
confidence calibration, strategy switching), and escalation heuristics.

Also fixes write-skill validator to handle YAML block scalars and filter
prose-like "word/word" patterns from deeply-nested-path warnings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a "Capture Screenshots for Documentation" pattern with Playwright
settings optimized for docs images (1280x720, 2x DPR, PNG, element cropping).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add contextual references to /debug in 5 skills at their natural
failure-handling decision points:

- qa-test: triage root-cause-obvious vs unclear before fixing bugs
- implement: add code defect diagnosis to stuck story handling
- ship: route to /debug in post-implementation review + appendix table
- inspect: add Debugging purpose to depth calibration table
- analyze: add defect diagnosis to skill composition routing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nick-inkeep nick-inkeep merged commit d911340 into main Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant