跳到正文
cccskills
免费在 GitHub 公开

opencli-adapter-author

Helps build or improve reusable OpenCLI website commands in JavaScript. It uses observed page behavior, captured requests, and existing adapters to guide implementation, then checks definitions and tests real command behavior and failure handling.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

Build or improve an OpenCLI JS adapter using observed site behavior, existing adapters and browser API evidence. For ad-hoc browser interaction, see opencli-browser.

查看安装方法

适用场景

  • Turning repeated website tasks into OpenCLI commands
  • Improving an existing website adapter
  • Investigating API requests before implementation
  • Checking adapter definitions and testing error handling

包含的文件(19)

  • SKILL.md4.0 KB
  • references/adapter-template.md21.2 KB
  • references/api-discovery.md17.0 KB
  • references/coverage-matrix.md5.5 KB
  • references/deep-recon.md10.3 KB
  • references/field-conventions.md5.2 KB
  • references/field-decode-playbook.md7.1 KB
  • references/jsdom-fixture-pattern.md7.9 KB
  • references/output-design.md4.7 KB
  • references/site-memory.md10.7 KB
  • references/site-memory/bilibili.md3.6 KB
  • references/site-memory/eastmoney.md3.8 KB
  • references/site-memory/gmail.md2.8 KB
  • references/site-memory/tonghuashun.md2.4 KB
  • references/site-memory/xueqiu.md2.8 KB
  • references/site-recon.md4.5 KB
  • references/strategy-selection.md2.3 KB
  • references/success-rate-pitfalls.md9.3 KB
  • references/typed-errors.md12.6 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Adapter authoring

Choose the simplest implementation that reliably performs the requested task. Use an existing site adapter when it already covers the capability:

opencli list search --site example
opencli example search --help -f json

list returns {ok:true,data:{commands,total,nextOffset?}}; use --offset to continue, --limit to adjust page size. Detailed arguments belong in command help.

Evidence available to you

opencli browser open https://example.com --session research
opencli browser state --diagnostics --session research
opencli browser network --session research
opencli browser network --static --session research
opencli browser network --detail RequestKey --session research

Network captures describe observed requests. Static analysis adds candidates from loaded scripts without executing them. Inspect source locations, unresolved expressions and capture provenance. Replay read requests when useful and compare business data with the page. Write commands have real effects, including when run through adapter test; use a suitable test account or a supported dry-run.

Prefer public APIs with a stable contract when available. Browser fetch, captured responses, page state and semantic UI interactions are also valid choices. Select based on the task and observed reliability. Do not guess endpoint parameters or hide failed operations behind empty success results.

JS interface

Adapters are ordinary files under ~/.opencli/clis/<site>/<command>.js or repository clis/<site>/. There is no draft directory, promotion step or required memory file.

opencli adapter init example/search

The existing cli({...}) interface is unchanged: func(args) for Node execution, func(page, args) with browser: true. Reuse neighboring adapters and shared helpers. Return business data; the CLI adds the JSON success envelope. Throw a typed error with an actionable hint for failures. Use access: 'read'|'write' accurately. columns controls human table exports; JSON preserves nested results.

import { cli, Strategy } from '@jackwener/opencli/registry';

cli({
  site: 'example', name: 'search', description: 'Search example items',
  access: 'read', strategy: Strategy.PUBLIC, browser: false,
  args: [{ name: 'query', positional: true, required: true }],
  func: async (args) => {
    const response = await fetch(`https://example.com/api/search?q=${encodeURIComponent(args.query)}`);
    if (!response.ok) throw new Error(`Search failed: HTTP ${response.status}`);
    return response.json();
  },
});

Check and exercise

opencli adapter check example/search
opencli example search 'query'
opencli adapter test example/search --args '{"query":"query"}'

check validates definitions without executing adapters. test executes the normal CLI and optionally compares an existing fixture. --write-fixture, --update-fixture and --no-fixture control optional expectations; no row-shape or site-memory gate is imposed. --trace retain-on-failure helps diagnose browser execution.

For repository changes, cover the core behavior and failure paths with focused production-path tests, typecheck and build. Verify IDs, fields, units, pagination and empty/error semantics relevant to the task. Do not automatically replay a write with an unknown outcome; inspect state first.

Optional references

Read only what is useful for the current task: references/adapter-template.md for adapter patterns, api-discovery.md for request investigation, output-design.md for result fields, field-decode-playbook.md for opaque fields, and deep-recon.md for difficult private protocols. Site notes and fixtures are optional knowledge aids; older reference checklists are not mandatory workflows.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Diagnose OpenCLI commands broken by website changes, collect execution traces, patch the adapter that connects to the site, and retry. After a verified repair, prepares a GitHub issue for submission with user approval.

中文简介正在准备中。当前显示英语简介。

  • Repair commands broken by website layout changes
  • Adapt to changed API responses
  • Distinguish empty results from adapter failures
jackwener/OpenCLI3万2026年10月17日 更新

Uses OpenCLI to inspect and interact with Chrome pages, including logged-in websites. Agents can fill forms, extract page data, inspect captured network requests, take screenshots, and manage Chrome tabs, groups, and windows.

中文简介正在准备中。当前显示英语简介。

  • Filling forms and clicking controls on logged-in websites
  • Extracting page text and taking screenshots
  • Inspecting network requests for API investigation
jackwener/OpenCLI3万2026年10月17日 更新

Helps agents find and use OpenCLI commands for websites and Chrome. It guides command discovery, input checks, result interpretation, and error recovery so agents can select suitable browser tools or reusable website commands.

中文简介正在准备中。当前显示英语简介。

  • Finding OpenCLI commands for a specific website
  • Checking command inputs and output formats
  • Diagnosing Chrome connection problems
jackwener/OpenCLI3万2026年10月17日 更新

Routes OpenCLI searches to sources suited to the topic, language, or requested website. It starts with one AI source when none is specified, adds specialist sources as needed, and reports search terms and usage counts.

中文简介正在准备中。当前显示英语简介。

  • Researching a topic on a specified website
  • Choosing sources for Chinese or English research
  • Finding original posts, products, or job listings
jackwener/OpenCLI3万2026年10月17日 更新

查看 jackwener 的全部技能

报告此技能的问题