From in-optimize
Use when the user is iterating on the LinkedIn comment cleaner — debugging stale selectors, triaging a diagnostic bundle in state/diagnostics/, summarizing a dry-run, or extending the detector/delete logic. Provides the architectural map and the dry-run-only safety rule for the linkedin.com/in/me/recent-activity/comments/ surface.
How this skill is triggered — by the user, by Claude, or both
Slash command
/in-optimize:commentThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
The destructive surface is `linkedin.com/in/me/recent-activity/comments/`. The Playwright driver lives in `src/`; this skill is the map for editing it correctly.
The destructive surface is linkedin.com/in/me/recent-activity/comments/. The Playwright driver lives in src/; this skill is the map for editing it correctly.
state/diagnostics/<ts>-*/ bundle (page.html, comment.html, screenshot.png), propose a selectors.ts + docs/selectors.md + test/fixtures/comments.html patch in one change.state/log.jsonl; report deleted/not-found/skipped/error counts and any pacing signals.Pure logic — no I/O:
pace.ts — token-bucket + jitter, hourly/daily capsscheduler.ts — picks the next id from processed.jsonerrors.ts — typed errors, retry classificationstate.ts — atomic flush of processed.json, append to log.jsonlDOM-facing — Playwright handles only:
commentDetector.ts — extracts { id, urn, permalink, text } per visible commentdelete.ts — clicks the menu, confirms, verifies removalscroll.ts — incremental load + virtualization-awareOrchestration:
runner.ts — main loop, dispatches detector → delete → statecli.ts — flag parsing, mode selection (run | login | probe)Infra:
browser.ts — launches Chromium against .profile/ user-data dir (manual login)humanCursor.ts — bezier-path mouse moves, jitterdiagnose.ts — drops state/diagnostics/<ts>-<reason>/ bundle on selector missEvery LinkedIn selector lives in src/selectors.ts. Three co-changes are mandatory:
src/selectors.ts (preserve the per-surface object structure).docs/selectors.md with why the selector was chosen and the date verified live.test/fixtures/comments.html from a real captured DOM if the comment shape changed.Prefer stable attributes (data-*, aria-*, role-based). Avoid class names — LinkedIn rotates them.
state/log.jsonl — append-only, one JSON per line. Never edit by hand.state/processed.json — id → outcome resume map. Atomic-flushed per action.deleted | not-found | skipped (terminal); error (retryable).MAX_ATTEMPTS_PER_ID = 3 — after that, id is marked skipped.Defaults: ~1 delete / 5–8s, hourly cap 200, daily cap 500. Don't loosen without a stated reason — LinkedIn's rate-limit signatures are subtler than X/Twitter's, and the cap also bounds blast radius if a detector regression deletes the wrong items.
npm run run:cleaner (with or without --dry-run) from this session. The user runs the destructive path themselves; manual login is intentional..profile/ or state/.Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub cocodedk/in-optimizer --plugin in-optimize