Network Troubleshooting
This skill provides a concise, safety-first decision guide for diagnosing developer network failures. Diagnostics must stay read-only and target-scoped — this is not an automated remediation toolkit.
Safety Boundaries
These boundaries apply to every step of the workflow below and must never be relaxed, even if asked:
- Prefer read-only diagnostics and trusted project-provided diagnostic scripts.
- Use the failing host, URL, registry, or service as the default probe target — do not probe unrelated hosts.
- Ask before probing unrelated external services.
- Never print proxy URLs, credentials, tokens, auth headers, package index URLs, registry hostnames from config, or raw config values in shared output.
- Internal hosts and URLs may be collected for target-scoped local diagnostics, but replace them with placeholders before sharing logs or reports unless the user explicitly approves including them.
- Never dump local configuration from npm, pnpm, yarn, pip, Git, Docker, shell, OS proxy, VPN, or certificate stores.
- Never disable, bypass, or skip TLS or certificate verification (no
-k/--insecure, no NODE_TLS_REJECT_UNAUTHORIZED=0, no verify=False), even temporarily "just to test."
- Never change OS networking, DNS, proxy, package manager, Git, Docker, shell, VPN, or trust-store settings without explicit user approval for the exact action being taken.
Workflow
- Collect — Capture the exact error text, the failing command, the target host/URL/port, OS/shell, proxy/VPN context, and whether the failure affects one target or many.
- Classify — Match the symptom against the error classification table below to form a hypothesis.
- Diagnose — Run only read-only checks scoped to the failing target, starting with the smallest relevant check.
- Explain — Interpret each diagnostic result in plain language before suggesting any fix.
- Advise — Present remediation options as choices; wait for explicit user approval before changing any state.
- Verify — After an approved change, re-run the original failing command or an equivalent target-scoped check.
Error Classification
| Error Pattern |
Likely Category |
ECONNREFUSED, ERR_CONNECTION_REFUSED, Connection refused |
Target service or port is not listening |
ECONNRESET, socket hang up, Connection reset |
Connection dropped by target, proxy, firewall, or middlebox |
ETIMEDOUT, ERR_CONNECTION_TIMED_OUT, timed out |
Routing, firewall, proxy, or target availability |
ENOTFOUND, EAI_NONAME, ERR_NAME_NOT_RESOLVED, getaddrinfo |
DNS or hostname issue |
ERR_PROXY_CONNECTION_FAILED, proxy tunnel errors, HTTP 407 |
Proxy configuration or proxy authentication |
UNABLE_TO_VERIFY_LEAF_SIGNATURE, CERT_HAS_EXPIRED, self signed, ERR_CERT_* |
TLS certificate or local trust issue |
HTTP 403 |
Authorization, IP allowlist, CORS, or policy block |
HTTP 502, 503, 504 |
Upstream service, gateway, CDN, or transient server issue |
npm ERR! network, package install timeout, pip timeout |
Package registry, proxy, DNS, or network path issue |
fatal: unable to access, Git fetch/push timeout |
Git remote, proxy, DNS, TLS, or network path issue |
Safe Target-Scoped Checks
Choose the smallest relevant check and explain what it does before running it. Always substitute the specific failing <target-host>, <port>, and <path> — never a broader or unrelated target.
Connectivity
Linux/macOS:
ping -c 4 <target-host>
curl -v telnet://<target-host>:<port> --connect-timeout 5
Windows PowerShell:
Test-Connection -ComputerName <target-host> -Count 4
Test-NetConnection -ComputerName <target-host> -Port <port>
DNS
Linux/macOS:
nslookup <target-host>
dig <target-host>
Windows PowerShell:
Resolve-DnsName <target-host>
HTTP
Linux/macOS:
curl -vvv -o /dev/null -w "HTTP %{http_code}\nTime: %{time_total}s\nDNS: %{time_namelookup}s\nConnect: %{time_connect}s\nTLS: %{time_appconnect}s\n" https://<target-host>/<path>
curl -I https://<target-host>/<path>
Windows PowerShell:
$uri = "https://<target-host>/<path>"
try {
$resp = Invoke-WebRequest -Uri $uri -Method Head -TimeoutSec 10
"HTTP status: $([int]$resp.StatusCode)"
} catch [Net.WebException] {
if ($_.Exception.Response) {
"HTTP status: $([int]$_.Exception.Response.StatusCode)"
} else {
"HTTP request failed: $($_.Exception.Message)"
}
}
TLS
Linux/macOS:
openssl s_client -connect <target-host>:<port> -servername <target-host> -showcerts </dev/null
echo | openssl s_client -connect <target-host>:<port> -servername <target-host> 2>/dev/null | openssl x509 -noout -subject -issuer -dates
Windows PowerShell — check the certificate and HTTP status separately so a non-2xx response is never mislabeled as a certificate failure:
try {
$req = [Net.HttpWebRequest]::Create("https://<target-host>:<port>/<path>")
$req.Method = "HEAD"
$req.Timeout = 5000
try {
$resp = $req.GetResponse()
} catch [Net.WebException] {
$resp = $_.Exception.Response
if ($req.ServicePoint.Certificate) {
$cert = $req.ServicePoint.Certificate
"Cert subject: $($cert.Subject)"
"Cert expires: $($cert.GetExpirationDateString())"
}
if ($resp) {
"HTTP status: $([int]$resp.StatusCode) $($resp.StatusDescription)"
$resp.Close()
} else {
"TLS/network error: $($_.Exception.Message)"
}
return
}
$cert = $req.ServicePoint.Certificate
if ($cert) {
"Cert subject: $($cert.Subject)"
"Cert expires: $($cert.GetExpirationDateString())"
}
"HTTP status: $([int]$resp.StatusCode) $($resp.StatusDescription)"
$resp.Close()
} catch {
"TLS/network error: $($_.Exception.Message)"
}
Proxy and Package Managers
- Avoid raw config reads for proxy, package manager, Git, Docker, or OS network configuration.
- Report only whether relevant settings appear present when this can be checked without printing values.
- If the available command would print a URL, token, internal hostname, auth header, or full config value, do not run it.
- Only perform package registry probes when the failed operation already targeted that registry, or after the user approves that exact probe target.
User-Approved Remediation Options
Present these as choices for the user to approve — never apply them automatically.
| Diagnosis |
Safe Advice |
| Target service is not listening |
Check whether the local or remote service is running and whether the expected port is correct. |
| DNS lookup fails |
Check the hostname, hosts-file expectations, DNS service status, or approved DNS changes. |
| Proxy appears required or unavailable |
Ask whether the user wants to start or adjust the proxy/VPN, then verify only the approved target. |
| TLS certificate expired |
Renew or replace the certificate, fix system time, install a trusted local development CA, or update the trust store. Never bypass TLS verification. |
| TLS unknown CA |
Import the correct CA into the appropriate trust store after the user confirms the source and scope. |
HTTP 407 |
Ask the user to confirm proxy authentication requirements before changing credentials or tool settings. |
HTTP 403 |
Check authentication, API key scope, IP allowlist, CORS policy, or service policy. |
HTTP 502/503/504 |
Treat as upstream or gateway instability; check status pages when approved and retry with backoff. |
| Package install timeout |
Discuss approved registry, proxy, or network-path options without printing or changing stored config values. |
| Git network failure |
Discuss approved remote URL, proxy, credential, TLS, or network-path options without changing global Git settings automatically. |
| Docker pull failure |
Discuss approved registry mirror, proxy, or daemon settings as a user-approved configuration change. |
Verification
- After any user-approved change, re-run the original failing command whenever possible.
- If a smaller check is needed instead, keep it scoped to the same failing host, URL, registry, or service.
- Always explain what each diagnostic result means before recommending the next step.
1---2name: network-troubleshooting3description: Systematic, safety-first diagnosis of developer network failures such as connection refused, DNS resolution errors, TLS certificate problems, proxy failures, and package registry timeouts. Use when a command fails with a network-shaped error (curl, npm, pip, git, docker), when a service is unreachable, or when the user asks to debug connectivity, DNS, TLS, or proxy issues.4---5
6# Network Troubleshooting
7
8This skill provides a concise, safety-first decision guide for diagnosing developer network failures. Diagnostics must stay read-only and target-scoped — this is not an automated remediation toolkit.
9
10## Safety Boundaries
11
12These boundaries apply to every step of the workflow below and must never be relaxed, even if asked:
13
14- Prefer read-only diagnostics and trusted project-provided diagnostic scripts.
15- Use the failing host, URL, registry, or service as the default probe target — do not probe unrelated hosts.
16- Ask before probing unrelated external services.
17- Never print proxy URLs, credentials, tokens, auth headers, package index URLs, registry hostnames from config, or raw config values in shared output.
18- Internal hosts and URLs may be collected for target-scoped local diagnostics, but replace them with placeholders before sharing logs or reports unless the user explicitly approves including them.
19- Never dump local configuration from npm, pnpm, yarn, pip, Git, Docker, shell, OS proxy, VPN, or certificate stores.
20- Never disable, bypass, or skip TLS or certificate verification (no `-k`/`--insecure`, no `NODE_TLS_REJECT_UNAUTHORIZED=0`, no `verify=False`), even temporarily "just to test."
21- Never change OS networking, DNS, proxy, package manager, Git, Docker, shell, VPN, or trust-store settings without explicit user approval for the exact action being taken.
22
23## Workflow
24
251. **Collect** — Capture the exact error text, the failing command, the target host/URL/port, OS/shell, proxy/VPN context, and whether the failure affects one target or many.
262. **Classify** — Match the symptom against the error classification table below to form a hypothesis.
273. **Diagnose** — Run only read-only checks scoped to the failing target, starting with the smallest relevant check.
284. **Explain** — Interpret each diagnostic result in plain language before suggesting any fix.
295. **Advise** — Present remediation options as choices; wait for explicit user approval before changing any state.
306. **Verify** — After an approved change, re-run the original failing command or an equivalent target-scoped check.
31
32## Error Classification
33
34| Error Pattern | Likely Category |
35|---|---|
36| `ECONNREFUSED`, `ERR_CONNECTION_REFUSED`, `Connection refused` | Target service or port is not listening |
37| `ECONNRESET`, `socket hang up`, `Connection reset` | Connection dropped by target, proxy, firewall, or middlebox |
38| `ETIMEDOUT`, `ERR_CONNECTION_TIMED_OUT`, `timed out` | Routing, firewall, proxy, or target availability |
39| `ENOTFOUND`, `EAI_NONAME`, `ERR_NAME_NOT_RESOLVED`, `getaddrinfo` | DNS or hostname issue |
40| `ERR_PROXY_CONNECTION_FAILED`, proxy tunnel errors, HTTP `407` | Proxy configuration or proxy authentication |
41| `UNABLE_TO_VERIFY_LEAF_SIGNATURE`, `CERT_HAS_EXPIRED`, `self signed`, `ERR_CERT_*` | TLS certificate or local trust issue |
42| HTTP `403` | Authorization, IP allowlist, CORS, or policy block |
43| HTTP `502`, `503`, `504` | Upstream service, gateway, CDN, or transient server issue |
44| `npm ERR! network`, package install timeout, `pip` timeout | Package registry, proxy, DNS, or network path issue |
45| `fatal: unable to access`, Git fetch/push timeout | Git remote, proxy, DNS, TLS, or network path issue |
46
47## Safe Target-Scoped Checks
48
49Choose the smallest relevant check and explain what it does before running it. Always substitute the specific failing `<target-host>`, `<port>`, and `<path>` — never a broader or unrelated target.
50
51### Connectivity
52
53Linux/macOS:
54
55```bash
56ping -c 4 <target-host>
57curl -v telnet://<target-host>:<port> --connect-timeout 5
58```
59
60Windows PowerShell:
61
62```powershell
63Test-Connection -ComputerName <target-host> -Count 4
64Test-NetConnection -ComputerName <target-host> -Port <port>
65```
66
67### DNS
68
69Linux/macOS:
70
71```bash
72nslookup <target-host>
73dig <target-host>
74```
75
76Windows PowerShell:
77
78```powershell
79Resolve-DnsName <target-host>
80```
81
82### HTTP
83
84Linux/macOS:
85
86```bash
87curl -vvv -o /dev/null -w "HTTP %{http_code}\nTime: %{time_total}s\nDNS: %{time_namelookup}s\nConnect: %{time_connect}s\nTLS: %{time_appconnect}s\n" https://<target-host>/<path>
88curl -I https://<target-host>/<path>
89```
90
91Windows PowerShell:
92
93```powershell
94$uri = "https://<target-host>/<path>"
95try {
96 $resp = Invoke-WebRequest -Uri $uri -Method Head -TimeoutSec 10
97 "HTTP status: $([int]$resp.StatusCode)"
98} catch [Net.WebException] {
99 if ($_.Exception.Response) {
100 "HTTP status: $([int]$_.Exception.Response.StatusCode)"
101 } else {
102 "HTTP request failed: $($_.Exception.Message)"
103 }
104}
105```
106
107### TLS
108
109Linux/macOS:
110
111```bash
112openssl s_client -connect <target-host>:<port> -servername <target-host> -showcerts </dev/null
113echo | openssl s_client -connect <target-host>:<port> -servername <target-host> 2>/dev/null | openssl x509 -noout -subject -issuer -dates
114```
115
116Windows PowerShell — check the certificate and HTTP status separately so a non-2xx response is never mislabeled as a certificate failure:
117
118```powershell
119try {
120 $req = [Net.HttpWebRequest]::Create("https://<target-host>:<port>/<path>")
121 $req.Method = "HEAD"
122 $req.Timeout = 5000
123 try {
124 $resp = $req.GetResponse()
125 } catch [Net.WebException] {
126 $resp = $_.Exception.Response
127 if ($req.ServicePoint.Certificate) {
128 $cert = $req.ServicePoint.Certificate
129 "Cert subject: $($cert.Subject)"
130 "Cert expires: $($cert.GetExpirationDateString())"
131 }
132 if ($resp) {
133 "HTTP status: $([int]$resp.StatusCode) $($resp.StatusDescription)"
134 $resp.Close()
135 } else {
136 "TLS/network error: $($_.Exception.Message)"
137 }
138 return
139 }
140 $cert = $req.ServicePoint.Certificate
141 if ($cert) {
142 "Cert subject: $($cert.Subject)"
143 "Cert expires: $($cert.GetExpirationDateString())"
144 }
145 "HTTP status: $([int]$resp.StatusCode) $($resp.StatusDescription)"
146 $resp.Close()
147} catch {
148 "TLS/network error: $($_.Exception.Message)"
149}
150```
151
152### Proxy and Package Managers
153
154- Avoid raw config reads for proxy, package manager, Git, Docker, or OS network configuration.
155- Report only whether relevant settings appear present when this can be checked without printing values.
156- If the available command would print a URL, token, internal hostname, auth header, or full config value, do not run it.
157- Only perform package registry probes when the failed operation already targeted that registry, or after the user approves that exact probe target.
158
159## User-Approved Remediation Options
160
161Present these as choices for the user to approve — never apply them automatically.
162
163| Diagnosis | Safe Advice |
164|---|---|
165| Target service is not listening | Check whether the local or remote service is running and whether the expected port is correct. |
166| DNS lookup fails | Check the hostname, hosts-file expectations, DNS service status, or approved DNS changes. |
167| Proxy appears required or unavailable | Ask whether the user wants to start or adjust the proxy/VPN, then verify only the approved target. |
168| TLS certificate expired | Renew or replace the certificate, fix system time, install a trusted local development CA, or update the trust store. Never bypass TLS verification. |
169| TLS unknown CA | Import the correct CA into the appropriate trust store after the user confirms the source and scope. |
170| HTTP `407` | Ask the user to confirm proxy authentication requirements before changing credentials or tool settings. |
171| HTTP `403` | Check authentication, API key scope, IP allowlist, CORS policy, or service policy. |
172| HTTP `502`/`503`/`504` | Treat as upstream or gateway instability; check status pages when approved and retry with backoff. |
173| Package install timeout | Discuss approved registry, proxy, or network-path options without printing or changing stored config values. |
174| Git network failure | Discuss approved remote URL, proxy, credential, TLS, or network-path options without changing global Git settings automatically. |
175| Docker pull failure | Discuss approved registry mirror, proxy, or daemon settings as a user-approved configuration change. |
176
177## Verification
178
179- After any user-approved change, re-run the original failing command whenever possible.
180- If a smaller check is needed instead, keep it scoped to the same failing host, URL, registry, or service.
181- Always explain what each diagnostic result means before recommending the next step.