본문으로 건너뛰기
Skillpedia
일반 코딩31k · #9333

opencli-autofix

하는 일

이 스킬은 웹사이트가 바뀌어 작동을 멈춘 OpenCLI 명령을 고칩니다. 추적 기록을 모으고, 어댑터 파일을 업데이트한 뒤 명령을 다시 실행합니다.

사용하는 경우

  • ✓웹사이트가 레이아웃이나 데이터를 바꿔서 OpenCLI 명령이 실패할 때.
  • ✓사이트 업데이트 후 명령이 빈 결과를 반환할 때.
  • ✓검증된 수정 후 OpenCLI 어댑터를 고치고 상위 프로젝트에 보고하고 싶을 때.

스킬 링크

https://github.com/jackwener/OpenCLI/blob/main/skills/opencli-autofix/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/jackwener/OpenCLI/blob/main/skills/opencli-autofix/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 사이트의 OpenCLI 명령이 결과를 반환하지 않게 됐어요. 원인을 진단하고 어댑터를 고친 뒤 다시 실행해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 먼저 실패가 로그인이나 연결 문제인지 확인합니다. 그런 문제는 내가 직접 해야 합니다. 다른 실패라면 어댑터 파일만 패치하고, 다시 시도하며, 문제가 남으면 세 번의 수리 라운드 후 멈춥니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

OpenCLI AutoFix — Automatic Adapter Self-Repair

When an opencli command fails because a website changed its DOM, API, or response schema, automatically diagnose, fix the adapter, and retry — don't just report the error.

Safety Boundaries

Before starting any repair, check these hard stops:

  • AUTH_REQUIRED (exit code 77) — STOP. Do not modify code. Tell the user to log into the site in Chrome.
  • BROWSER_CONNECT (exit code 69) — STOP. Do not modify code. Tell the user to run opencli doctor.
  • CAPTCHA / rate limiting — STOP. Not an adapter issue.

Scope constraint:

  • Only modify the file at adapterSourcePath in the trace summary.md front matter — this is the authoritative adapter location (may be clis/<site>/ in repo or ~/.opencli/clis/<site>/ for npm installs)
  • Never modify src/, extension/, tests/, package.json, or tsconfig.json

Retry budget: Max 3 repair rounds per failure. If 3 rounds of diagnose → fix → retry don't resolve it, stop and report what was tried.

Prerequisites

opencli doctor    # Verify extension + daemon connectivity

When to Use This Skill

Use when opencli <site> <command> fails with repairable errors:

  • SELECTOR — element not found (DOM changed)
  • EMPTY_RESULT — no data returned (API response changed)
  • API_ERROR / NETWORK — endpoint moved or broke
  • PAGE_CHANGED — page structure no longer matches
  • COMMAND_EXEC — runtime error in adapter logic
  • TIMEOUT — page loads differently, adapter waits for wrong thing

Before Entering Repair: "Empty" ≠ "Broken"

EMPTY_RESULT — and sometimes a structurally-valid SELECTOR that returns nothing — is often not an adapter bug. Platforms actively degrade results under anti-scrape heuristics, and a "not found" response from the site doesn't mean the content is actually missing. Rule this out before committing to a repair round:

  • Retry with an alternative query or entry point. If opencli xiaohongshu search "X" returns 0 but opencli xiaohongshu search "X 攻略" returns 20, the adapter is fine — the platform was shaping results for the first query.
  • Spot-check in a normal Chrome tab. If the data is visible in the user's own browser but the adapter comes back empty, the issue is usually authentication state, rate limiting, or a soft block — not a code bug. The fix is opencli doctor / re-login, not editing source.
  • Look for soft 404s. Sites like xiaohongshu / weibo / douyin return HTTP 200 with an empty payload instead of a real 404 when an item is hidden or deleted. The snapshot will look structurally correct. A retry 2-3 seconds later often distinguishes "temporarily hidden" from "actually gone".
  • "0 results" from a search is an answer. If the adapter successfully reached the search endpoint, got an HTTP 200, and the platform returned results: [], that is a valid answer — report it to the user as "no matches for this query" rather than patching the adapter.

Only proceed to Step 1 if the empty/selector-missing result is reproducible across retries and alternative entry points. Otherwise you're patching a working adapter to chase noise, and the patched version will break the next working path.

Step 1: Collect Trace Context

Run the failing command with failure-retained trace enabled:

opencli <site> <command> [args...] --trace retain-on-failure 2>trace-error.yaml

On failure, stderr contains the normal error envelope plus a small trace block:

ok: false
error:
  code: SELECTOR
  message: "Could not find element: .old-selector"
trace:
  schemaVersion: 1
  opencliVersion: "..."
  traceId: "..."
  dir: "/path/to/.opencli/profiles/default/traces/..."
  summaryPath: "/path/to/.opencli/profiles/default/traces/.../summary.md"
  receiptPath: "/path/to/.opencli/profiles/default/traces/.../receipt.json"

Read summaryPath first. It is the LLM-oriented entry point and includes front matter:

---
schemaVersion: 1
opencliVersion: "..."
traceId: "..."
status: failure
site: "example"
command: "example/search"
adapterSourcePath: "/path/to/clis/example/search.js"
errorCode: "SELECTOR"
errorMessage: "Could not find element: .old-selector"
---

The artifact directory contains:

summary.md      # start here
receipt.json    # machine-readable trace receipt
trace.jsonl     # full redacted timeline
network.jsonl   # redacted network events
console.jsonl   # redac
자주 묻는 질문

로그인 문제도 고치나요?

아닙니다. 로그인과 연결 오류는 수리를 멈추고, 에이전트가 나에게 조치를 요청합니다.

수리 시도는 몇 번 하나요?

각 실패마다 진단, 수정, 재시도를 최대 세 라운드까지 합니다.

어떤 파일을 바꿀 수 있나요?

추적 기록에 표시된 단일 어댑터 파일만 바꿀 수 있습니다. 핵심 소스 파일과 테스트 파일은 건드리지 않습니다.

상세 정보

작성자의 원본 설명

Automatically fix broken OpenCLI adapters when commands fail. Load this skill when an opencli command fails — it guides you through collecting a trace artifact, patching the adapter, retrying, and filing an upstream GitHub issue after a verified fix. Works with any AI agent.

repo: jackwener/OpenCLI

인기도

GitHub 스타
31k
순위
#9333
라이선스
Apache-2.0
업데이트
2026. 10. 26.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬