opencli-adapter-author
できること
このスキルは、OpenCLIツールが特定のウェブサイトと連携できるようにする小さなアダプターを作るか、改善する手助けをします。公開APIやブラウザでの取得など、最も単純で確実な方法を選びます。
使う場面
- ✓ウェブサイトからデータを取得するコマンドがほしく、まだアダプターがないとき。
- ✓既存のOpenCLIアダプターが動かなくなり、改善が必要なとき。
- ✓あるタスクを既存のアダプターがすでに扱えるか確認したいとき。
スキルのリンク
https://github.com/jackwener/OpenCLI/blob/main/skills/opencli-adapter-author/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“このサイトの最新の投稿を一覧にするOpenCLIアダプターを作ってください。まず私のアカウントでテストしてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、まず既存のアダプターを確認し、次にページとそのネットワークリクエストを調べて、データを取得する最も確実な方法を探します。アダプターを書いてテストし、公開APIがあればそれを優先します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
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.
よくある質問
ウェブサイトのアドレスを推測しますか?
いいえ。パラメーターを推測するのではなく、観測したリクエストと取得したレスポンスを使います。
書き込みの操作は安全にテストされますか?
書き込みコマンドには実際の影響があるため、テスト用のアカウントやドライランを使うことを推奨しています。
既存のアダプターを再利用できますか?
はい。まず既存のアダプターを確認し、タスクを扱えるものがあればそれを使います。
詳細
作者による元の説明
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.
repo: jackwener/OpenCLI
人気
- GitHubのスター
- 31k
- ランキング
- #9332
- ライセンス
- Apache-2.0
- 更新日
- 2026/10/26
コメント
- …
このリポジトリの他のスキル
opencli-autofix
31kエージェントが、ウェブサイトの変更後に壊れたOpenCLIアダプターを修復し、コマンドを再試行できるよう支援します。
opencli-browser
31kエージェントが、Chromeを操作してページを開き、読み、サイト内でクリックして、必要な情報を取得できるよう支援します。
opencli-usage
31kエージェントが、ウェブサイトやChrome用のOpenCLIコマンドを見つけて実行し、その結果を正しく読めるよう支援します。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。