opencli-adapter-author
Skill này làm gì
Skill này giúp tạo hoặc cải thiện một bộ chuyển đổi nhỏ, cho phép công cụ OpenCLI làm việc với một trang web cụ thể. Nó chọn cách đơn giản và đáng tin cậy nhất, như API công khai hoặc tải qua trình duyệt.
Khi nào nên dùng
- ✓Khi bạn muốn một lệnh lấy dữ liệu từ một trang web và chưa có bộ chuyển đổi nào.
- ✓Khi một bộ chuyển đổi OpenCLI hiện có ngừng hoạt động và cần được cải thiện.
- ✓Khi bạn muốn kiểm tra xem bộ chuyển đổi nào đã có sẵn bao quát tác vụ.
Liên kết skill
https://github.com/jackwener/OpenCLI/blob/main/skills/opencli-adapter-author/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Xây dựng một bộ chuyển đổi OpenCLI liệt kê các bài đăng mới nhất của trang này, và thử trên tài khoản của tôi trước.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent kiểm tra các bộ chuyển đổi có sẵn trước, rồi xem trang và các yêu cầu mạng để tìm cách lấy dữ liệu đáng tin cậy nhất. Nó viết bộ chuyển đổi, kiểm thử, và ưu tiên API công khai khi có sẵn.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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.
Câu hỏi thường gặp
Nó có đoán địa chỉ trang web không?
Không. Nó dùng các yêu cầu đã quan sát và phản hồi đã ghi lại, thay vì đoán tham số.
Các thao tác ghi có được kiểm thử an toàn không?
Lệnh ghi có tác dụng thật, nên skill khuyên dùng tài khoản thử nghiệm hoặc chạy khô.
Nó có tái sử dụng bộ chuyển đổi có sẵn không?
Có. Nó kiểm tra các bộ chuyển đổi có sẵn trước và dùng một bộ nếu bộ đó đã bao quát tác vụ.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 31k
- Vị trí xếp hạng
- #9332
- Giấy phép
- Apache-2.0
- Cập nhật
- 26/10/2026
Bình luận
- …
Thêm skill từ kho mã này
opencli-autofix
31kGiúp agent của bạn sửa một bộ chuyển đổi OpenCLI bị hỏng sau khi trang web thay đổi, rồi thử lại lệnh.
opencli-browser
31kGiúp agent của bạn điều khiển Chrome để mở trang, đọc nội dung, bấm qua các trang web và thu thập thông tin cần thiết.
opencli-usage
31kGiúp agent của bạn tìm và chạy các lệnh OpenCLI cho trang web và Chrome, và đọc đúng kết quả của chúng.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.