From altevra
Run and debug browser-backed lead pipelines by splitting Codex code work from real Hermes terminal execution, verifying VPN location, and cleaning up Playwright/imperium-crawl resources so Node exits cleanly.
How this skill is triggered — by the user, by Claude, or both
Slash command
/altevra:sandbox-aware-browser-pipelineThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use this when a Node/TypeScript CLI pipeline uses browser automation or `imperium-crawl`/Playwright-style resources and:
Use this when a Node/TypeScript CLI pipeline uses browser automation or imperium-crawl/Playwright-style resources and:
NOT_SAFE_TO_SEND because official evidence/enrichment gates are incomplete.Separate “code brain” from “real browser execution.”
Treat Codex as the coding/diagnostic worker:
codex exec 'Inspect why the enrichment CLI hangs after completion and propose a cleanup fix'
But do not rely on Codex sandbox for real browser pipeline runs. Browser phases should run from a normal Hermes/system terminal, not inside the Codex sandbox, because Chromium/browser sandbox and namespace operations can be blocked there.
Working rule:
Confirm you are in the correct repository before starting Codex.
Codex CLI requires a git repository. If git status reports:
fatal: not a git repository
locate the actual project repo first, then run codex exec from that directory.
Verify VPN/location before real scraping runs.
For location-sensitive official-records/case-search phases, check the public IP/location before running the pipeline.
Example style of check:
curl -s https://ipinfo.io/json
Confirm the city/region/country matches the required target, such as Miami/Florida/US. If the machine is on the wrong endpoint, pause and connect the VPN before running browser phases.
If NetworkManager is unavailable, do not assume nmcli can manage VPN state:
nmcli connection show --active
may return:
Error: NetworkManager is not running.
In that case, inspect which VPN clients exist on the machine, such as openvpn, nordvpn, or other installed tools, and use the available configured client/profile rather than inventing a new setup.
Run real browser pipeline commands from the normal terminal with a timeout.
Use timeouts to distinguish “pipeline work failed” from “pipeline work completed but Node stayed alive.”
Example:
timeout 90 node dist/cli.js enrich --case 2023-015095-CA-01 --phase ocs
timeout 120 node dist/cli.js enrich --case 2023-015095-CA-01 --phase or
Interpret results carefully:
timeout kills the process, suspect leaked browser/session handles.Add CLI cleanup for browser/session resources.
In a Node CLI entrypoint such as src/cli.ts, ensure async commands are awaited and cleanup runs in finally.
The replayed fix pattern was:
Replace plain program.parse() with async parsing:
await program.parseAsync(process.argv)
Wrap CLI execution in try/finally.
In finally, close/reset imperium-crawl browser/session resources:
imperium-crawl/stealth/browser-poolimperium-crawl/sessionsThe goal is that even when OCS/OR phases complete successfully, leftover browser/session handles do not keep Node alive.
Build and test after cleanup changes.
Run the project’s normal verification commands:
npm run build
npm test
Then re-run real browser phases in the normal terminal with timeout to confirm the process exits cleanly.
Do not confuse “pipeline generated files” with “buyer-ready leads.”
For ReVesta-style lead outputs, validate the final gates, not just whether CSV/MD files exist.
A generated CSV can still be NOT_SAFE_TO_SEND if:
0 data rows.0/N leads are buyer-sendable.all_active_case_verified=falseall_buyer_sendable=falseall_required_pipeline_status_done=falseall_required_evidence_links_present=falseReport this as a validation/evidence issue, not as “no leads exist” or “CSV failed.”
Summarize the outcome in operational terms.
When reporting back, separate:
SAFE_TO_SEND or NOT_SAFE_TO_SEND, and why.Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub ceoimperiumprojects/altevra --plugin altevra