TEMPLATE.
npm run new-skill -- <id>copies this directory and replaces__SKILL_ID__. Do not open a pull request that addsskills/_templateas a product skill. Delete every TEMPLATE note, replacehttps://example.com/login, and write the real success state before review.
Complete with an Ego Lite session: <one-sentence goal>. If ego-browser is missing or not logged in, soft-fail (exit code 2); do not force-launch a browser.
Do the task through Ego Lite. If ego-browser is missing or the site is logged out, soft-fail with exit 2. Do not drive a browser any other way.
Install Ego first
Install Ego Litefirst, ensure that ego-browser is available in PATH. If missing, soft-fail / tell the user to install it,do notswitch to Playwright, Puppeteer, or a cloud browser.
Install Ego Lite and put ego-browser on PATH. If it is missing, soft-fail and tell the user. Do not switch to Playwright, Puppeteer, or a cloud browser.
Before each action: login gate (mandatory)
Agent Before uploading, downloading, or changing the pageyou must run:
node scripts/check-login.mjs
# 需要把窗口留给人登录时:
node scripts/check-login.mjs --keep
| Exit code | Meaning | What the agent does |
|---|---|---|
0 |
Logged in | Tell the user login_tip and continue |
2 |
Not logged in / no ego-browser | Show how_to_login / how_to_login_zh,Stop. Have a person log in to Ego and run again |
1 |
Other errors | Report the JSON error; do not pretend it succeeded |
See references/login.mdfor details. Do not do a separate cookie-healthcheck. Do not fill in passwords on the user's behalf, do not paste cookies, do not auto-scan QR codes.
Repository root:node skills/__SKILL_ID__/scripts/check-login.mjs。
This template still returns exit code 1 and TEMPLATE error when the binary exists. Switch to a real ego-browser nodejs probe before saying the skill is usable.wechat-channels-video and youtube-video split this step into launch-check.mjs / run-check.mjs; keep testable decisions in scripts/lib/pure.mjs,ego-deps.mjs only holds the ego global object.
Input
The caller provides the path and copy. This skilldoes nothard-code ~/… or any personal/product directory. Examples use only /tmp/... or /absolute/path/to/video.mp4。
Publishing type or download type (state clearly before opening a PR)
- Publishing type: The caller provides an absolute local video path. The skill does not download videos and does not bundle yt-dlp / gallery-dl. Specify the success state below (under review, private link + processing status, entered content management or a "published successfully" message, or saved as draft). Do not automatically click "Publish" when a person needs to scan a QR code.
- WeChat Channels: Save as draft only; do not click "Publish".
- Download type: Keep separate from the publishing type. Only save content already visible in the current Ego login session.
Success state
Replace this sentence with the observable result. Until you do, this template has not succeeded at a real task.
Tests
npm test
npm test Use glob to include skills/*/scripts/test/*.test.mjs. c8 counts scripts/lib/**/*.mjs(excluding ego-deps.mjs); line coverage must be at least 80%.