Skip to content
cccskills
FreePublished on 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.

OriginalShow the original description

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.

See how to install

Good for

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

Files included (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 (original)

Review the instructions the agent will receive before you install.

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.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

opencli-autofix

FreeSummary

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/OpenCLI30.4KUpdated Oct 17, 2026

opencli-browser

FreeSummary

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/OpenCLI30.4KUpdated Oct 17, 2026

opencli-usage

FreeSummary

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/OpenCLI30.4KUpdated Oct 17, 2026

smart-search

FreeSummary

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/OpenCLI30.4KUpdated Oct 17, 2026

See all skills by jackwener

Report a problem with this skill