3.2 KiB
CONTRACT — seo-account-mgmt
- date: 2026-07-10 | flow: feat | branch: feature/seo-account-mgmt
- status: active
REQUEST (verbatim — IMMUTABLE)
"J'aimerais qu'on rajoute quand meme une option au skill pour juste connecter
le compte. du style un argument au skill seo pour fiare un truc du genre /set
seo-connect ou quelque chjose comme cas. Et aussi pouvoir clean la liste des
compte deja enregister. pouvoir supprimer des compte ou tout supprimer"
— design proposal validated by user ("go pour l'un puis l'autre oui"):
/seo connect [label] / /seo accounts / /seo forget <label> /
/seo forget --all; tokenstore remove+clear verbs; fetch.sh forget dispatch;
new connect.sh wrapper (sources env internally, usable from any project);
Makefile delegates to it; SKILL.md arg routing + STEP 0 fix; forget output
must state local removal ≠ Google revocation (myaccount.google.com/permissions).
CLARIFICATIONS
none — request complete (design pre-validated in conversation).
ACCEPTANCE CRITERIA
python3 lib/seo-data/tokenstore.py remove --file F --label Xdeletes only label X (others preserved), prints{"status":"ok","removed":true|false}, never prints a refresh token; atomic write + fcntl lock as set.python3 lib/seo-data/tokenstore.py clear --file Fempties the store (subsequent list →"accounts": []), JSON ok, same write discipline.- Fail-open preserved on new verbs: bad usage →
{"status":"error",...}+ exit 2; unexpected error → degraded JSON (existing _cli try/except covers). fetch.sh forget --label X/forget --alldispatch to remove/clear within the existing contract (JSON stdout, exit 0 ok, exit 2 bad usage);fetch.sh forgetwith no/invalid flag → exit 2 + JSON.- New
lib/seo-data/connect.sh: sources${SEO_DATA_ENV_FILE:-~/.claude/.env}internally (set -a, never echoed), picks venv python else system, execs connect.py with passed args; with no creds exits nonzero with the "Set GOOGLE_OAUTH_CLIENT_ID/SECRET" gate message (deterministic, offline). - Makefile
seo-connectdelegates to connect.sh (env-sourcing duplication fromcaa5bedremoved); venv creation + pip install kept before. skills/seo/SKILL.mdroutesconnect [label]/accounts/forget <label>|--allBEFORE the audit flow (audit/seo <url>unchanged); forget path includes the Google revocation notice (myaccount.google.com/permissions); STEP 0 no longer proposes baremake seo-connectas the only path (connect.sh tilde path offered).lib/seo-data/README.mddocuments connect.sh, forget verbs, revocation note.lib/seo-data/seo-data.test.shcovers: remove keeps others / removed:false on missing label / clear empties / redaction on remove / forget via fetch.sh (JSON + exit codes, bad usage 2) / connect.sh offline negative path; plus wiring locks (connect.sh sources vault, Makefile delegates, SKILL routes, README documents). Whole suite +make testgreen.- No commit attribution trailers; tilde paths for engine calls in SKILL.md.
FILE SCOPE
lib/seo-data/tokenstore.py, lib/seo-data/fetch.sh, lib/seo-data/connect.sh (new), lib/seo-data/seo-data.test.sh, lib/seo-data/README.md, Makefile, skills/seo/SKILL.md