# JS Hello Ops Skill

> JS Eyes Skills 最小样例 — 读取任意标签页的标题。

- Skill: `imjszhang/js-hello-ops-skill` (Agent Skill, multi-file: 10 files)
- Install (CLI): `npx skillmds@latest add imjszhang/js-hello-ops-skill`
- Raw SKILL.md: https://api.skillmd.com/api/skills/imjszhang/js-hello-ops-skill/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: imjszhang (https://skillmd.com/u/imjszhang)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/imjszhang/js-hello-ops-skill

---


# js-hello-ops-skill

JS Eyes Skills **最小 V2 样例** — 一个工具、零副作用，演示
`skill.manifest.json` + `skill.definition.js` + `skill.entry.js` 的最简形态。

## 依赖

- JS Eyes Server 已运行
- 浏览器已装 JS Eyes 扩展并连上服务器
- Node.js >= 22
- （可选）OpenClaw 加载 `js-eyes` 插件并 `tools.alsoAllow: ["js-eyes"]`

## 提供的 AI 工具

| 工具 | 说明 |
|------|------|
| `hello_get_title` | 读取指定标签页的 `title` 与 `url`（底层调 `BrowserAutomation.getPageInfo`） |

## 编程 API

```javascript
const { BrowserAutomation } = require('./lib/js-eyes-client');
const { getTitle } = require('./scripts/hello');

const bot = new BrowserAutomation('ws://localhost:18080');
const { title, url } = await getTitle(bot, { tabId: 123 });
```

## CLI

```bash
# 查看所有命令
node index.js --help
# 或
node cli/index.js --help

# 读取 tabId=123 的标题
node index.js title 123

# 指定浏览器
node index.js title 123 --target firefox
```

## 目录结构

```text
js-hello-ops-skill/
├── SKILL.md                  # 本文件（给 Agent 读）
├── package.json
├── skill.manifest.json       # V2 静态元数据（发现阶段只读此文件）
├── skill.definition.js       # TOOL_DEFINITIONS + capabilities / requirements
├── skill.entry.js            # handlers（发现阶段不会执行）
├── index.js                  # CLI 入口
├── cli/index.js              # CLI 帮助文案
├── scripts/hello.js          # 业务实现
└── lib/
    ├── js-eyes-client.js     # 自包含 WebSocket 客户端
    └── runtimeConfig.js      # 极简 serverUrl 解析
```

## 详细教程

- 开发指南：[docs/dev/js-eyes-skills/authoring.zh.md](../../../docs/dev/js-eyes-skills/authoring.zh.md)
- 部署启用：[docs/dev/js-eyes-skills/deployment.zh.md](../../../docs/dev/js-eyes-skills/deployment.zh.md)
- V1 已移除；迁移说明：[examples/legacy/](../../legacy/)

