Add eyeball plugin: document analysis with inline source screenshots 🤖🤖🤖#1294
Add eyeball plugin: document analysis with inline source screenshots 🤖🤖🤖#1294aaronpowell merged 6 commits intostagedfrom
Conversation
Eyeball generates Word documents where every factual claim includes a highlighted screenshot from the source material. Supports PDFs, Word docs, and web URLs. Designed for verifying AI-generated document analysis against the original source. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔍 Skill Validator Results2 resource(s) checked | ✅ All checks passed Full output |
There was a problem hiding this comment.
Pull request overview
Adds a new Eyeball Copilot CLI plugin + skill that generates a Word analysis document with inline, highlighted screenshots from source PDFs/Word docs/web pages to support claim verification.
Changes:
- Introduces
eyeball.pytool for document conversion (to PDF), anchor search/highlighting, screenshot generation, and DOCX assembly. - Adds
skills/eyeball/SKILL.mdto define the Copilot workflow and usage instructions. - Registers the plugin/skill in the docs and plugin marketplace metadata.
Show a summary per file
| File | Description |
|---|---|
| skills/eyeball/tools/eyeball.py | Implements conversion/rendering, anchor search + screenshot highlighting, and DOCX output CLI commands. |
| skills/eyeball/SKILL.md | Documents activation + step-by-step workflow for using Eyeball in Copilot CLI. |
| plugins/eyeball/README.md | User-facing plugin overview, setup steps, usage examples, limitations. |
| plugins/eyeball/.github/plugin/plugin.json | Declares plugin metadata (name/version/keywords) and includes the Eyeball skill. |
| docs/README.skills.md | Adds Eyeball to the skills index table. |
| docs/README.plugins.md | Adds Eyeball to the plugins index table. |
| .github/plugin/marketplace.json | Adds Eyeball to the marketplace listing. |
Copilot's findings
Comments suppressed due to low confidence (4)
skills/eyeball/tools/eyeball.py:143
_convert_with_word_windowsswallows all exceptions and returns False, but it doesn't reliably calldoc.Close()/word.Quit()on failure after Word has been launched. This can leave orphaned WINWORD.EXE processes. Use try/finally to ensure COM objects are closed/quit even whenOpen/SaveAsfails.
def _convert_with_word_windows(source_path, output_pdf_path):
"""Convert using Microsoft Word on Windows via win32com."""
try:
import win32com.client
word = win32com.client.Dispatch("Word.Application")
word.Visible = False
doc = word.Documents.Open(os.path.abspath(source_path))
doc.SaveAs(os.path.abspath(output_pdf_path), FileFormat=17) # 17 = PDF
doc.Close()
word.Quit()
return True
except Exception:
return False
skills/eyeball/tools/eyeball.py:176
render_url_to_pdfmanually closes the browser at the end, but ifpage.goto,page.evaluate, orpage.pdfthrows, the browser may not be closed cleanly. Wrap browser usage in try/finally (or use Playwright context managers) so Chromium is always closed on errors/timeouts.
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
page = browser.new_page()
page.goto(url, wait_until="networkidle", timeout=30000)
# Clean up navigation/footer elements for cleaner output
page.evaluate("""
document.querySelectorAll(
'header, footer, nav, [data-testid="header"], [data-testid="footer"], '
+ '.site-header, .site-footer, #cookie-banner, .cookie-consent'
).forEach(el => el.remove());
""")
page.pdf(
path=output_pdf_path,
format="Letter",
print_background=True,
margin={"top": "0.5in", "bottom": "0.5in",
"left": "0.75in", "right": "0.75in"}
)
browser.close()
skills/eyeball/tools/eyeball.py:521
cmd_screenshotopens the PDF before parsing--anchors. Ifjson.loads(args.anchors)(or later code) raises,pdf_doc.close()is never reached. Consider restructuring to parse/validate inputs first and/or wrap PDF usage in try/finally (or a context manager) to guarantee the file handle is closed on errors.
def cmd_screenshot(args):
"""Generate a single screenshot from a PDF."""
pdf_doc = fitz.open(os.path.expanduser(args.source))
anchors = json.loads(args.anchors)
target_page = args.page
padding = args.padding or 40
skills/eyeball/SKILL.md:125
- The build example uses
python3 eyeball.py build ...without specifying a path. Unless the instructions require running from the directory containingeyeball.py, this command will fail. Usepython3 <path-to>/eyeball.py build ...(or explicitly instruct to run from<plugin_dir>/skills/eyeball/tools).
```bash
python3 eyeball.py build \
--source "<path-or-url>" \
--output ~/Desktop/<title>.docx \
--title "Analysis Title" \
--subtitle "Source description" \
- Files reviewed: 7/7 changed files
- Comments generated: 6
- Make PyMuPDF/Pillow/python-docx imports soft so setup-check runs without dependencies installed - Add _check_core_deps() guard at CLI command entry points - Add Windows Word detection in setup-check - Remove references to setup.sh (not included in plugin) - Fix usage docstring to show inline JSON instead of filename - Use consistent <path-to>/eyeball.py paths in SKILL.md Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Fix resource leaks (pdf_doc closed in finally blocks) - Fix Windows Word COM automation (DispatchEx, proper cleanup) - Fix converter order (Word before LibreOffice on Windows) - Add source file existence checks with clear errors - Fix Playwright cache detection for all platforms - Fix setup.sh error handling (pipefail) - Fix AppleScript path injection - Fix highlight padding scaling with DPI - Add pywin32 as Windows dependency - Update README with Windows setup instructions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a new Eyeball plugin/skill that produces Word-based document analyses with inline, highlighted source screenshots by converting sources to PDF, searching for anchor text, and embedding rendered excerpts.
Changes:
- Introduces
eyeball.py(conversion, URL rendering, screenshot highlighting/stitching, and DOCX assembly CLI). - Adds the
eyeballskill definition (SKILL.md) with an end-to-end workflow for using anchors/citations. - Registers the plugin/skill in the docs and marketplace metadata.
Show a summary per file
| File | Description |
|---|---|
skills/eyeball/tools/eyeball.py |
Implements the core conversion/rendering/screenshot/DOCX generation CLI. |
skills/eyeball/SKILL.md |
Defines the skill and provides workflow instructions for citation anchors and build steps. |
plugins/eyeball/README.md |
Documents plugin purpose, installation, and usage. |
plugins/eyeball/.github/plugin/plugin.json |
Declares the plugin metadata and points to the skill. |
docs/README.skills.md |
Adds the Eyeball skill to the skills index. |
docs/README.plugins.md |
Adds the Eyeball plugin to the plugins index. |
.github/plugin/marketplace.json |
Adds Eyeball to the plugin marketplace listing. |
Copilot's findings
Comments suppressed due to low confidence (3)
plugins/eyeball/README.md:37
- The README suggests cloning
https://github.com/dvelton/eyeball.git, which doesn't align with how plugins in this repo are meant to be consumed (via the GitHub Copilot plugin marketplace /awesome-copilot). Consider replacing this with the canonical marketplace install instructions, and (if desired) keep the upstream repo link in a separate “Source” section instead of presenting it as the primary install path.
Install via the Copilot CLI plugin system, or clone the repo:
```bash
git clone https://github.com/dvelton/eyeball.git
**skills/eyeball/SKILL.md:123**
* Similarly, the build command example uses `python3 eyeball.py build ...` without a path. For consistency with the earlier “Tool Location” section (and to avoid command failures), use `<path-to>/eyeball.py build ...` or document that the command must be run from the directory containing `eyeball.py`.
Construct a JSON array of sections and call the build command:
python3 eyeball.py build \
--source "<path-or-url>" \
--output ~/Desktop/<title>.docx \plugins/eyeball/README.md:53
- The README references
setup.sh/setup.ps1, but those scripts aren’t included in this plugin directory in the current PR. Either add the setup scripts, or remove these steps and rely on the manualpip install ...instructions (plus Playwright browser install) to avoid dead-end setup guidance.
### Install dependencies
**macOS / Linux:**
```bash
cd eyeball
bash setup.sh
Windows (PowerShell):
cd eyeball
.\setup.ps1</details>
- **Files reviewed:** 7/7 changed files
- **Comments generated:** 4
- Fix browser leak in render_url_to_pdf (try/finally around Playwright) - Remove setup.sh references from SKILL.md (not bundled in plugin) - Use consistent <path-to>/eyeball.py paths in SKILL.md - Update plugin README install instructions for awesome-copilot - Add Windows pywin32 install step to SKILL.md Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Just got some merge conflicts on here @dvelton |
|
@copilot resolve the merge conflicts in this pull request |
# Conflicts: # .github/plugin/marketplace.json # docs/README.plugins.md # docs/README.skills.md Co-authored-by: dvelton <48307985+dvelton@users.noreply.github.com>
Resolved the merge conflicts in b14575f. The conflicts were in the auto-generated files (marketplace.json, README.plugins.md, README.skills.md). I merged the staged branch and rebuilt these files with |
Agent-Logs-Url: https://github.com/github/awesome-copilot/sessions/048d704a-d78a-4a46-80d9-a155ff1e0d85 Co-authored-by: dvelton <48307985+dvelton@users.noreply.github.com>
|
#codeowner |
|
Warning The ✅ CODEOWNERS has been updated! A PR has been opened (#aw_co1294) to assign @dvelton ownership of the
|
What this adds
Eyeball is a Copilot CLI plugin that generates document analyses as Word files with inline screenshots from the source material. Every factual claim in the analysis includes a highlighted excerpt from the original document, so you can verify each assertion without switching between files or hunting for the right page.
How it works
Source types supported
Plugin contents
plugins/eyeball/- plugin.json and READMEskills/eyeball/- SKILL.md and the eyeball.py toolPrerequisites for users
Python 3.8+ and the following pip packages: pymupdf, pillow, python-docx, playwright. The SKILL.md includes setup instructions.
Source repo
https://github.com/dvelton/eyeball