opencli-adapter-author
Fungsinya
Skill ini membantu membuat atau memperbaiki adapter kecil yang memungkinkan alat OpenCLI bekerja dengan situs web tertentu. Skill memilih metode paling sederhana yang andal, seperti API publik atau pengambilan lewat browser.
Kapan dipakai
- ✓Saat Anda ingin perintah yang mengambil data dari situs web dan belum ada adapter untuknya.
- ✓Ketika adapter OpenCLI yang ada berhenti berfungsi dan perlu diperbaiki.
- ✓Saat Anda ingin memeriksa adapter mana yang sudah mencakup suatu tugas.
Link skill
https://github.com/jackwener/OpenCLI/blob/main/skills/opencli-adapter-author/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
“Bangun adapter OpenCLI yang menampilkan postingan terbaru dari situs ini, dan uji dulu di akun saya.”
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent memeriksa adapter yang ada terlebih dahulu, lalu melihat halaman dan permintaan jaringannya untuk menemukan cara paling andal mendapatkan data. Agent menulis adapter, mmengujinya, dan memilih API publik jika tersedia.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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.
Pertanyaan umum
Apakah agent menebak alamat situs web?
Tidak. Agent memakai permintaan dan respons yang benar-benar diamati, bukan menebak parameter.
Apakah tindakan tulis diuji dengan aman?
Perintah tulis memiliki efek nyata, sehingga skill menyarankan akun uji atau dry run.
Bisakah adapter yang ada dipakai ulang?
Bisa. Agent memeriksa adapter yang ada terlebih dahulu dan memakainya jika sudah mencakup tugasnya.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 31k
- Peringkat
- #9332
- Lisensi
- Apache-2.0
- Diperbarui
- 26/10/2026
Komentar
- …
Skill lain dari repositori ini
opencli-autofix
31kMembantu agent Anda memperbaiki adapter OpenCLI yang rusak setelah situs web berubah, lalu mencoba perintahnya kembali.
opencli-browser
31kMembantu agent Anda mengendalikan Chrome untuk membuka halaman, membacanya, mengklik situs, dan mengambil informasi yang dibutuhkan.
opencli-usage
31kMembantu agent Anda mencari dan menjalankan perintah OpenCLI untuk situs web dan Chrome, serta membaca hasilnya dengan benar.
Skill serupa
diffs
394kMemungkinkan agent Anda menghasilkan diff perubahan yang nyata dan dapat dibagikan sebagai tautan viewer atau file gambar, bukan ringkasan yang ditulis manual.
coding-agent
394kMembantu agent Anda menyerahkan pekerjaan pemrograman besar ke Codex, Claude Code, atau OpenCode di latar belakang, lalu memeriksa kemajuannya.
gh-issues
394kMembantu agent Anda menemukan issue GitHub, memilih yang dikerjakan, dan membuka pull request perbaikan, termasuk tindak lanjut komentar tinjauan.