Commit b8bcd696 authored by 谢宇轩's avatar 谢宇轩

fix: update root cmd

parent be725014
......@@ -7,6 +7,8 @@ description: Harvest and archive news articles from configured sources (Reuters,
Fetch latest articles from configured news sources, archive them to Obsidian vault with Chinese summaries + original text. Supports browser-based (Chromium CDP), direct HTTP, and per-source **recipe** (`helpers/<id>.md`) fetching — a recipe declares the selectors/scroll/URL-filter spec and takes precedence over the legacy fetchers. Deduplicates via per-day registry with a sliding window.
> **Skill root** = the directory containing this `SKILL.md` (its absolute path is shown in the skill listing as `(file: <path>/SKILL.md)` — strip `/SKILL.md`). This is almost never your CWD. Prefix every command below with `cd "<skill-root>" &&`, or scripts fail with `MODULE_NOT_FOUND`.
## Quick Reference
| Task | Command |
......@@ -31,7 +33,7 @@ Fetch latest articles from configured news sources, archive them to Obsidian vau
| Detect available CDP browsers | `node scripts/ensure-chromium.js --list` |
| Launch login window (set port + profile) | `node scripts/ensure-chromium.js --login [--url <url>]` |
> **All commands assume `cd <skill-root>` first** (the directory containing this `SKILL.md`). Scripts live in the `scripts/` subfolder — **always prefix with `scripts/`**, e.g. `node scripts/harvest.js`, never `node harvest.js` (that fails with `MODULE_NOT_FOUND`).
> **All commands must be prefixed with `cd "<skill-root>" &&`** — see *Skill root* above. Scripts live in the `scripts/` subfolder — always reference them as `node scripts/harvest.js`, never `node harvest.js` (that fails with `MODULE_NOT_FOUND`).
Config file: `config.json` (auto-generated from `references/config-template.json` on first run — see First-Run Setup / Configuration below)
......@@ -42,7 +44,7 @@ Config file: `config.json` (auto-generated from `references/config-template.json
**Pre-flight gate — run this ONE command at the start of a task.** If it prints `OK`, the skill is already configured: **skip straight to Workflow** and do not re-check vault/source/config. Only if it prints `UNCONFIGURED` do the onboarding below.
```bash
node -e "const c=require('./config.json'); console.log(c.vaultPath==='/path/to/your/obsidian/vault'?'UNCONFIGURED':'OK')" 2>/dev/null || echo "UNCONFIGURED (no config.json)"
cd "<skill-root>" && node -e "const c=require('./config.json'); console.log(c.vaultPath==='/path/to/your/obsidian/vault'?'UNCONFIGURED':'OK')" 2>/dev/null || echo "UNCONFIGURED (no config.json)"
```
This is the only config check needed per run — don't re-verify vault writability or re-list sources mid-task.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment