Skip to content

Spoon94/skill-vault / opencli

opencli

Verified

OpenCLI 全能助手 - 把任意网站/Electron 应用变成 `opencli <site> <command>` 的统一操作面。当 agent 要读写已登录网站、驱动真实浏览器、抓取页面、填表点击、修复失效适配器、给新站点写适配器、或把搜索/查询路由到最佳数据源时,都用这个 skill。这是合并了 5 个官方 opencli 子技能(usage/browser/adapter-author/autofix/smart-search)的统一入口,按任务类型路由到对应章节或 reference。

FileKindSize
SKILL.mdskill md20.9 KB
references/adapter-author.mdmarkdown3.7 KB
references/adapter/adapter-template.mdmarkdown21.2 KB
references/adapter/api-discovery.mdmarkdown17.0 KB
references/adapter/coverage-matrix.mdmarkdown5.5 KB
references/adapter/deep-recon.mdmarkdown10.3 KB
references/adapter/field-conventions.mdmarkdown5.2 KB
references/adapter/field-decode-playbook.mdmarkdown7.1 KB
references/adapter/jsdom-fixture-pattern.mdmarkdown7.9 KB
references/adapter/output-design.mdmarkdown4.7 KB
references/adapter/site-memory.mdmarkdown10.7 KB
references/adapter/site-memory/bilibili.mdmarkdown3.6 KB
references/adapter/site-memory/eastmoney.mdmarkdown3.8 KB
references/adapter/site-memory/gmail.mdmarkdown2.8 KB
references/adapter/site-memory/tonghuashun.mdmarkdown2.4 KB
references/adapter/site-memory/xueqiu.mdmarkdown2.8 KB
references/adapter/site-recon.mdmarkdown4.5 KB
references/adapter/strategy-selection.mdmarkdown2.3 KB
references/adapter/success-rate-pitfalls.mdmarkdown9.3 KB
references/adapter/typed-errors.mdmarkdown12.6 KB
references/autofix.mdmarkdown12.2 KB
references/browser.mdmarkdown4.2 KB
references/search/sources-ai.mdmarkdown3.1 KB
references/search/sources-info.mdmarkdown968 B
references/search/sources-media.mdmarkdown1.2 KB
references/search/sources-other.mdmarkdown935 B
references/search/sources-shopping.mdmarkdown795 B
references/search/sources-social.mdmarkdown1.2 KB
references/search/sources-tech.mdmarkdown1.1 KB
references/search/sources-travel.mdmarkdown506 B
references/smart-search.mdmarkdown5.9 KB

references/adapter/output-design.md

View on GitHub
# Output Design

adapter 的 `columns` 不是随便列。要让下游(用户、其他 adapter 合并、agent 后续分析)都能直接读。

---

## 核心约定

### 1. 命名

**camelCase,全英文**:

| 好 | 差 |
|----|---|
| `marketCap` | `market_cap` / `市值` / `MarketCap` |
| `change24hPct` | `change_percentage_24h` / `涨跌幅24h` / `changePct_24h` |
| `bondCode` | `bond_code` / `BOND_CODE` |
| `pubTime` | `publish_time` / `pubdate` |

原则:
- 缩写:`pct`(百分比)/ `pe`(市盈率)/ `pb`(市净率)/ `ytm`(到期收益率)/ `id`
- 时间后缀:`Time`(具体时刻)/ `Date`(日期)/ `Ts`(unix 秒)
- 百分比一律 `Pct` 结尾,数值是"已乘 100"形式(`2.5` 表示 2.5%,不是 `0.025`)
- 数量后缀:`Count`(整数计数)/ `Total`(累计值)

### 2. 类型

| 字段类 | JS 类型 | 格式 |
|--------|---------|------|
| 价格 / 金额 | `number` | 原始小数,别除 1000 别取整 |
| 百分比 | `number` | 已 × 100(`2.5` = 2.5%) |
| 计数 / rank | `number` | 正整数 |
| 代码 / id / symbol | `string` | 股票代码 `'600000'` 保留前导 0 |
| 名称 / 标题 | `string` | 去首尾空白 |
| 时间 | `string` ISO(`'2024-01-15T10:30:00Z'`)或 `number` unix 秒 | 不要本地字符串 `'2024/1/15'` |
| 布尔 | `boolean` | 不用 `0/1` |
| URL | `string` | 绝对路径,相对路径要拼 host |

**特殊**:
- 缺失用 `null`,不用 `0` / `''`(0 和空字符串有业务含义,别混)
- 枚举 → string,不要 int 代号(`'listed'` 比 `0` 清楚)

### 3. 顺序

固定三段:

```
[识别列 ...] [业务数字 ...] [metadata ...]
```

**识别列**(前 1-3 列):`rank / symbol / code / bondCode / name / title / id`

**业务数字**(中间):价格、涨跌幅、成交量、市值等业务语义

**metadata**(最后 1-3 列):`pubTime / updateTime / source / url`

### 4. 必有列(按类型)

| adapter 类型 | 必须包含 |
|-------------|---------|
| 排行 / 列表 | `rank` + 识别列 + 业务数字 |
| 时序 / K 线 | `date`(或 `ts`)+ 数值 |
| 详情(单对象) | 识别列 + 业务字段 |
| 新闻 / 公告 | `title` + `pubTime` + `url` |

### 5. 控量

**单条 ≤ 15 列**。超了就得考虑:
- 拆成多个 adapter(列表版 + 详情版)
- 次要字段合进 `extras: {...}` 对象
- 只有少数用户关心的字段默认隐藏(靠参数开关)

---

## 对齐邻居 adapter

写新 adapter 前先看同站点现有 adapter 怎么命名:

```bash
grep -h "columns:" clis/<site>/*.js
```

复用同类列名。比如 `clis/eastmoney/convertible.js` 用 `bondCode / bondName / stockCode / stockName`,新写 eastmoney 某个涉及股票代码的 adapter 就沿用 `stockCode / stockName`,不要发明 `securityId / securityName`。

---

## 常见错误

| 错 | 对 |
|----|---|
| `columns: ['id', 'name', 'data.price']`(点路径) | 把 `data.price` 在 func 里打平成 `price` |
| `{date: '2024-01-15 10:30'}`(空格 + 非 ISO) | `'2024-01-15T10:30:00Z'` 或 `Date.toISOString()` |
| `{pct: '2.5%'}`(字符串 + 单位) | `{changePct: 2.5}` 纯数字 |
| `{volume: '1.2万'}` | `{volume: 12000}` |
| `{code: 600000}`(整数丢前导 0) | `{code: '600000'}` string,或 `String(code).padStart(6, '0')` |
| columns 和 func 返回的 keys 对不上 | 列出的每个 key 必须在返回对象里,顺序也一致 |

---

## description 字段

adapter `description` 是用户第一眼看到的,写清楚:

1. **数据是什么**:`"A 股涨幅排行"` vs `"大盘指数分时"`
2. **默认行为**:`"默认按涨幅排序,前 20 条"`
3. **重要参数**:`"支持 market 参数切换沪深/北证"`

不要:
- `"get data"` — 废话
- `"查询 xxx 数据"` — 也是废话
- 塞完整 URL / 字段代号列表 — 留给 help

一行 30 字左右够了。

---

## args 命名

- `limit` 而不是 `count / num / n / size`
- `sort` 而不是 `sort_by / order_by / sortKey`
- `market` 而不是 `exchange / platform / type`
- `symbol` / `code` / `query` 根据业务选,保持和邻居 adapter 一致
- 布尔参数用 `enableX / includeX`,默认 false 免得用户改变认知负担

`help` 文案给**所有合法值**,别让用户猜:

```javascript
{ name: 'sort', type: 'string', default: 'turnover', help: '排序:turnover / change / drop / price / premium' }
```

---

## 示例对比

**差的**:

```javascript
columns: ['股票代码', 'name', 'PRICE', 'change%', 'vol', 'time']
```

问题:中英混、大小写乱、百分号字符串、缩写不统一。

**好的**:

```javascript
columns: ['rank', 'stockCode', 'stockName', 'price', 'changePct', 'volume', 'updateTime']
```

识别列在前,metadata 在后,命名统一 camelCase。
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall