tcpwatch Electron (Project Skill)
What this is
This skill documents project-specific workflows and expectations for the tools/tcpwatch Go CLI and the Electron app in tools/tcpwatch/app.
Change checklist (must follow)
When you implement a change (code, packaging, workflow, docs):
- •
Update docs
- •Update
README.mdfor quick-start / high-level user-facing changes. - •Update
USER_GUIDE.mdfor detailed user-facing behavior, troubleshooting, and permissions.
- •Update
- •
Keep contracts in sync
- •If IPC changes, update both:
- •
tools/tcpwatch/app/electron/preload.cjs(exposed API) - •
tools/tcpwatch/app/src/renderer/types.ts(TypeScript typings)
- •
- •If IPC changes, update both:
- •
Validate locally (when feasible)
- •From
tools/tcpwatch/app:- •
npm run typecheck - •
npm run build:electron
- •
- •If UI/build outputs moved, verify packaging inputs include the correct renderer output folder (currently
renderer-dist).
- •From
Repo conventions worth remembering
- •Renderer build output is
tools/tcpwatch/app/renderer-dist(to avoid collisions with electron-builder outputdist). - •Packet capture uses
tshark.- •Capture filters use
tshark -f(BPF). Display filters would be-Y(Wireshark filter syntax). - •"Expert Information" analysis reads Wireshark expert fields via
tshark(e.g._ws.expert.*). - •If the UI has a port filter, capture should be scoped accordingly (currently
tcp port <port>). - •Split output
index.jsonincludes per-stream endpoints and best-effort reverse-DNS hostnames.- •Reverse DNS can be disabled with
TCPWATCH_RDNS=0. - •Tuning:
TCPWATCH_RDNS_TIMEOUT_MSandTCPWATCH_RDNS_CONCURRENCY.
- •Reverse DNS can be disabled with
- •Splitting supports a snaplen truncation setting (default
200bytes/packet;0disables) viaeditcap -s. - •Captures UI can import external
.pcap/.pcapngfiles by auto-splitting and generatingindex.json.- •Also supports drag & drop onto the Captures page.
- •Captures UI can also run Analyze (Claude +
mcpcapMCP tools) using.github/prompts/packet-analysis.md. - •DNS UI can extract DNS traffic to a new
dns.pcapngand run Analyze using.github/prompts/dns-analysis.md.- •In packaged builds, the prompt is bundled under
process.resourcesPath/prompts/packet-analysis.md. - •In packaged builds, the DNS prompt is bundled under
process.resourcesPath/prompts/dns-analysis.md. - •In packaged builds, user config can live under
app.getPath('userData')(e.g..envand.mcp.json).
- •In packaged builds, the prompt is bundled under
- •Capture filters use
Release / packaging
- •See
.github/specs/tcpwatch-release.mdfor the release checklist and tag/version rules.