Skip to content

feat(skills): add pi-kuri-plugin — npm-installable pi.dev skill package#175

Open
thetrebor wants to merge 8 commits into
justrach:mainfrom
thetrebor:feat/pi-kuri-plugin
Open

feat(skills): add pi-kuri-plugin — npm-installable pi.dev skill package#175
thetrebor wants to merge 8 commits into
justrach:mainfrom
thetrebor:feat/pi-kuri-plugin

Conversation

@thetrebor

@thetrebor thetrebor commented Jun 1, 2026

Copy link
Copy Markdown

Summary

Adds a standalone pi.dev skill plugin for Kuri browser automation, with a Pi
extension (pi-kuri.ts) that registers Kuri browser tools directly for agents,
a CLI wrapper, and two-tier documentation.

Changes

pi-kuri-plugin (npm package)

  • skills/pi-kuri-plugin/ — standalone npm package with kuri-skill CLI wrapper
  • package.json with pi.extensions + pi.skills manifest for auto-discovery
  • pi-kuri.ts — Pi extension registering all Kuri tools (kuri_navigate,
    kuri_snap, kuri_screenshot, kuri_text, kuri_evaluate, kuri_click,
    kuri_type, kuri_fill, kuri_select, kuri_scroll, kuri_markdown,
    kuri_links, kuri_cookies, kuri_audit, kuri_new_tab, kuri_page_info,
    kuri_console_errors, kuri_screenshot_site)
  • Extension features: CDP retry (auto-retry on 502), settle_ms param,
    auto tab_id resolution, text fallback on SPAs, console error diagnostics
  • SKILL.md — pi agent skill (two-tier design: core + advanced on demand)
  • scripts/kuri.js — Node.js CLI wrapper using built-in fetch (no deps)
  • references/ADVANCED.md — symlink to canonical advanced reference (no drift)
  • README.md — install, config, and quick start docs
  • OWNER.md — maintainer's guide for publishing to pi.dev (npm workflow,
    version convention, troubleshooting)

Two-tier skill documentation

  • skills/pi-kuri-skills.md — core operations (navigate, screenshot, snap, extract)
  • skills/pi-kuri-advanced.md — companion advanced reference (click, type,
    scroll, JS eval, cookies, audit, HAR)
  • Plugin's references/ADVANCED.md is a symlink to the canonical file

CLI fixes (from Copilot review)

  • Action arg parsing now dispatches by subcommand schema (scroll, evaluate,
    close-tab all parse correctly)
  • Fixed endpoint mismatch: CLI calls /page/info (server endpoint)
  • Removed double-encoding in cmdTabNew
  • Cleaned unused imports, switched to POSIX command -v

Other

  • Update readme.md to reference both new skill files
  • Ignore package-lock.json generated from pi-kuri-plugin

Robert Maefs added 3 commits June 1, 2026 14:00
…vanced

Add a pair of pi.dev-format skill files alongside the existing upstream
kuri-skill.md. The new files follow a two-tier design that keeps agent
context lean while making all capabilities discoverable.

pi-kuri-skills.md (core):
- Section 1: Setup — health check, server start instructions, tab listing
- Section 2: Core operations — navigate, page-info, screenshot, text,
  markdown, links, accessibility snapshot with interactive refs
- Section 3: Compact capability table hinting at advanced companion
- Tips, browser path reference, custom project skills guidance

pi-kuri-advanced.md (companion reference):
- Mouse: click, right-click, double-click, hover
- Keyboard: type, fill, select
- Scrolling with direction and amount control
- JavaScript evaluation with common expression examples
- Cookies listing with security flags
- Security audit (headers, cookies, HTTPS, mixed content)
- HAR recording for API discovery
- Tab and session management, multi-session orchestration
- Experimental kuri-browser CLI documentation
- Four common workflow patterns with full curl examples
- Quick parameter reference table and full endpoint map (~80 endpoints)

README updated to reference both new files.
Add a standalone pi.dev plugin directory with everything needed for
npm distribution and pi agent auto-discovery:

pi-kuri-plugin/
├── SKILL.md                  # Pi agent skill (two-tier design)
├── package.json              # npm metadata + pi.skills + bin entry
├── README.md                 # Install/use docs
├── scripts/
│   └── kuri.js               # CLI wrapper (bin: kuri-skill)
└── references/
    └── ADVANCED.md           # On-demand advanced reference

Key features:
- bin entry: 'kuri-skill' command available after npm install -g
- pi.skills field for auto-discovery by pi agent
- No external dependencies (uses Node 18+ built-in fetch)
- Disentangled from mh/milhouse — uses kuri binary directly
- SKILL.md content synchronized with pi-kuri-skills.md
- ADVANCED.md content synchronized with pi-kuri-advanced.md
- README documents install, config, and quick start
Copilot AI review requested due to automatic review settings June 1, 2026 18:00
@thetrebor thetrebor marked this pull request as draft June 1, 2026 18:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a pi.dev-friendly Kuri skill set plus an npm-installable plugin that exposes a kuri-skill CLI for driving Kuri’s HTTP server.

Changes:

  • Added core + advanced Pi skill documentation (skills/pi-kuri-skills.md, skills/pi-kuri-advanced.md) and referenced them from the repo readme.
  • Introduced skills/pi-kuri-plugin/ npm package with a Node.js CLI wrapper (scripts/kuri.js) and bundled skill/reference docs.
  • Added ignore rules for plugin lockfile/module artifacts.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
skills/pi-kuri-skills.md Adds core (tier-1) Pi skill docs for Kuri via kuri-skill CLI
skills/pi-kuri-plugin/scripts/kuri.js Implements kuri-skill CLI wrapper around Kuri HTTP endpoints
skills/pi-kuri-plugin/references/ADVANCED.md Adds advanced (tier-2) reference doc bundled with plugin
skills/pi-kuri-plugin/package.json Defines npm package metadata + kuri-skill bin + pi auto-discovery
skills/pi-kuri-plugin/SKILL.md Adds plugin skill entrypoint doc for pi.dev
skills/pi-kuri-plugin/README.md Documents install/usage/config for plugin consumers
skills/pi-kuri-plugin/.npmignore Excludes lockfile and node_modules from published package
skills/pi-kuri-advanced.md Adds advanced Pi skill reference at repo-level (non-plugin)
readme.md Links new Pi Kuri skill/plugin artifacts from repo docs
.gitignore Ignores plugin package-lock.json

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread skills/pi-kuri-plugin/scripts/kuri.js
Comment thread skills/pi-kuri-plugin/scripts/kuri.js Outdated
Comment thread skills/pi-kuri-plugin/references/ADVANCED.md Outdated
Comment on lines +129 to +137
if (!isKuriInstalled() && !isBuiltLocally()) {
const installScript =
"curl -fsSL https://raw.githubusercontent.com/justrach/kuri/main/install.sh | sh";
hints.suggestions.push({
action: "install_kuri",
install_url: "https://github.com/justrach/kuri",
install_script: installScript,
detail: "Kuri is not installed. Use the one-line install script, or build from source."
});
Comment thread skills/pi-kuri-plugin/scripts/kuri.js
Comment thread skills/pi-kuri-plugin/scripts/kuri.js Outdated
Comment thread skills/pi-kuri-plugin/scripts/kuri.js
Comment thread skills/pi-kuri-plugin/SKILL.md
Sandcastle Smoke Test added 5 commits June 1, 2026 14:17
Major improvements to the pi-kuri Pi extension:

- Retry wrapper: CDP-fragile endpoints (page/info, screenshot,
  evaluate, text, markdown, links) auto-retry up to 3 times
  with exponential backoff on transient 502 failures.
- settle_ms param on kuri_screenshot: configurable settle delay
  before capture for heavy JS pages.
- Auto tab_id resolution: kuri_markdown and kuri_links now
  auto-discover the current session tab when none is provided.
- kuri_text fallback: if raw text extraction returns empty,
  falls back to aria-label traversal of interactive elements.
- kuri_console_errors: new diagnostic tool that intercepts
  console.error/warn and returns the last 30 entries for
  diagnosing broken pages.
… auto-resolve, text fallback, console_errors
, justrach#6, justrach#7, justrach#8

- justrach#1: Fix action arg parsing — dispatch by subcommand schema instead
  of naive sequential fill. click, type, fill, select, scroll, evaluate,
  close-tab each parse positional args correctly.
- justrach#2: Fix endpoint mismatch — CLI now calls /page/info (server endpoint)
  instead of /page-info, removing degraded /tabs fallback.
- justrach#5: Use POSIX 'command -v' instead of non-portable 'which'.
- justrach#6: Remove unused imports (mkdirSync, createWriteStream, get).
- justrach#7: Remove double-encoding via encodeURI in cmdTabNew.
- justrach#8: Replace duplicate ADVANCED.md copy with symlink to canonical
  pi-kuri-advanced.md to prevent drift.
Covers:
- Directory layout and file purposes
- How pi.dev auto-discovers packages from npm
- Step-by-step publish workflow (version bump, smoke test, npm publish)
- Maintaining skill docs in sync (symlink approach)
- Version convention and real-world pi.dev package examples
- Troubleshooting common issues
…link needed

- Add "extensions": ["./pi-kuri.ts"] to package.json pi manifest so
  pi install auto-registers the Kuri tools alongside the skill.
- Remove manual ln -s instructions from README.md, SKILL.md, and OWNER.md.
- Update OWNER.md to document the auto-registration flow.
@thetrebor thetrebor marked this pull request as ready for review June 1, 2026 18:40
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.

2 participants