feat: add Network Troubleshooting skill (.mdc rule)#292
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds ChangesNetwork Troubleshooting Guide
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
rules/network-troubleshoot.mdc (1)
55-67: ⚡ Quick winAdd Windows-native alternatives for Unix-specific commands to keep the rule truly cross-platform.
Several snippets rely on shell semantics/commands (
echo $VAR,grep,/dev/null) that won’t run in PowerShell/CMD. Add Windows equivalents near each section.Also applies to: 76-80, 117-121
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@rules/network-troubleshoot.mdc` around lines 55 - 67, The snippets use Unix-only shell features (echo $HTTP_PROXY, curl -v, grep, /dev/null, openssl s_client) — add Windows PowerShell/CMD equivalents next to each Unix example: show environment variables with PowerShell ($env:HTTP_PROXY, $env:HTTPS_PROXY, $env:ALL_PROXY) and CMD (echo %HTTP_PROXY%), replace curl checks with Invoke-WebRequest or Test-NetConnection / Test-Connection examples and show how to specify a proxy in Invoke-WebRequest, replace grep with Select-String, replace /dev/null with $null, and for SSL/TLS include a PowerShell alternative to openssl s_client (e.g. using Invoke-WebRequest or System.Net.Security.SslStream to fetch cert details and using Get-Date on the certificate) so the blocks containing "echo $HTTP_PROXY", "curl -v", "curl -x", "git config --global --get http.proxy", "openssl s_client" and the grep/curl certificate checks have matching Windows-native commands.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@rules/network-troubleshoot.mdc`:
- Line 90: Replace the unsafe TLS-bypass snippet in the "SSL cert expired" row:
remove the dev guidance that suggests setting NODE_TLS_REJECT_UNAUTHORIZED=0 and
instead instruct renewing the certificate and safer dev options (e.g., install a
local/dev cert into the system or trust store, use a valid self-signed cert
generated for local testing, or use tools that support per-request trust flags
only for ephemeral debugging). Update the table row that currently contains "SSL
cert expired | Renew cert; dev: `NODE_TLS_REJECT_UNAUTHORIZED=0` |" to omit the
NODE_TLS_REJECT_UNAUTHORIZED suggestion and include one-line safer dev
alternatives.
- Around line 3-4: The frontmatter is invalid because globs is empty while
alwaysApply is set to false; update the rule frontmatter so they comply with the
contract by either populating globs with one or more file pattern strings (e.g.,
relevant paths/patterns) or by setting alwaysApply to true if the rule is
intended to apply globally—edit the frontmatter that contains the globs and
alwaysApply keys to implement one of these fixes.
---
Nitpick comments:
In `@rules/network-troubleshoot.mdc`:
- Around line 55-67: The snippets use Unix-only shell features (echo
$HTTP_PROXY, curl -v, grep, /dev/null, openssl s_client) — add Windows
PowerShell/CMD equivalents next to each Unix example: show environment variables
with PowerShell ($env:HTTP_PROXY, $env:HTTPS_PROXY, $env:ALL_PROXY) and CMD
(echo %HTTP_PROXY%), replace curl checks with Invoke-WebRequest or
Test-NetConnection / Test-Connection examples and show how to specify a proxy in
Invoke-WebRequest, replace grep with Select-String, replace /dev/null with
$null, and for SSL/TLS include a PowerShell alternative to openssl s_client
(e.g. using Invoke-WebRequest or System.Net.Security.SslStream to fetch cert
details and using Get-Date on the certificate) so the blocks containing "echo
$HTTP_PROXY", "curl -v", "curl -x", "git config --global --get http.proxy",
"openssl s_client" and the grep/curl certificate checks have matching
Windows-native commands.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3a4bb75b-2bce-4cc6-9830-cd6958704e89
📒 Files selected for processing (2)
README.mdrules/network-troubleshoot.mdc
|
I removed the README listing that triggered the repo-hygiene check and kept only the new rules/network-troubleshoot.mdc file. The current workflow shows action_required, so it may need maintainer approval to run. |
|
Hi 👋 The The check flagged two README entries that already exist on
This PR only adds Could a maintainer either fix those entries on |
|
im updating the lint rules |
480af24 to
9e446e1
Compare
|
Actionable comments posted: 0 |
There was a problem hiding this comment.
Pull request overview
Adds a new universal Cursor rule (rules/network-troubleshoot.mdc) intended to guide AI agents through a structured, cross-platform network debugging workflow (classification → diagnostics → resolution → verification).
Changes:
- Introduces a new network troubleshooting rule with diagnostic command sets for Windows/Linux/macOS.
- Adds an error-pattern classification table and a resolution matrix for common failure modes.
- Includes “quick fix” and verification recipes aimed at common proxy/GFW scenarios.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9e446e1 to
0bebf14
Compare
|
Actionable comments posted: 0 |
0bebf14 to
ca97c0e
Compare
|
Thank you so much — I really appreciate you taking the time to update the lint rules and help this contribution move forward. I just pushed a safety-first revision: removed all full config dumps ( The rule now focuses on read-only diagnostics ( |
| openssl s_client -connect <target-host>:443 -showcerts </dev/null | ||
| echo | openssl s_client -connect <target-host>:443 2>/dev/null | openssl x509 -noout -dates | ||
| curl -vvv https://<target-host> 2>&1 | grep -E "SSL|TLS|certificate|error" | ||
| ``` |
| npm config get registry | ||
| npm ping |
|
Thanks for the review. I pushed a follow-up commit addressing the 5 Copilot comments:
|
|
Just wanted to say thanks again — not just for maintaining this repo, but for actively updating the lint rules and helping this PR get to a mergeable state. It's rare to see a maintainer invest this level of care into a first-time contribution. Really appreciated. |
3837967 to
909e463
Compare
Add a universal network troubleshooting .mdc rule built from 112+ real agent sessions. Systematically diagnoses and resolves ECONNREFUSED, DNS, proxy, SSL/TLS, npm/pip/docker, and firewall errors across Windows, macOS, and Linux. Includes China/GFW-specific scenarios. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Fix frontmatter: add globs pattern '**/*' (was empty with alwaysApply=false) - Remove unsafe NODE_TLS_REJECT_UNAUTHORIZED=0 suggestion, replace with safe alternatives - Add Windows PowerShell equivalents for all Unix-only diagnostic commands
Remove config dumps, TLS bypass examples, persistent global config mutations, hardcoded public probes, and credential-exposing commands. Refocus on read-only diagnostics with user-confirmed advisory only. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Proxy config reads report only whether a value exists, never raw URLs - SSL/TLS commands marked Linux/macOS-only, PowerShell alternative added - SSL cert advisory explicitly forbids TLS verification bypass - Safety rules clarify "without explicit user confirmation" for mutations - npm ping gated to failing registry target or user-approved use Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
909e463 to
02d0951
Compare
|
I think this rule can still meet the goal for the repo, but it needs to stay clearly scoped to safe diagnostics rather than automatic remediation. The useful version is: help an agent collect the failing target/error, classify the likely network issue, run read-only checks against that target, explain the results, and then ask before suggesting or applying any state-changing fix. A few changes would make this safe enough for an awesome-cursorrules entry:
With those boundaries, the rule still accomplishes the intended goal: systematic developer network troubleshooting. It just does so without teaching agents to leak secrets, bypass TLS, or mutate network state while pretending to diagnose. |
|
One broader framing point to avoid overcorrecting this PR: I would not turn this For If the goal is deeper automation, that is probably better handled by helper scripts or a tool-backed skill outside this catalog entry. The rule can still say to prefer trusted project-provided diagnostic scripts when available, but the |
|
Thanks for the clear guidance. I pushed a follow-up revision that scopes the rule down to a safety-first decision guide rather than a full troubleshooting toolkit. Main changes:
I also verified the updated rule with:
Both checks pass now. Please let me know if you’d like this tightened further or if catalog/README placement should be left to maintainers. |
Summary
Add
rules/network-troubleshoot.mdc, a safety-first Cursor rule for developer network failures.The rule is intentionally scoped as a concise decision guide, not a full troubleshooting toolkit or automatic remediation script.
What it does
Safety boundaries
Source repo
https://github.com/CacinieP/network-troubleshoot-skill
The Cursor adapter in the source repo has also been synced to this safety-first version.
Validation
node scripts/check-repo-hygiene.mjs --only rules --changed-files .changed-files.localnode scripts/check-repo-hygiene.mjs --only security --changed-files .changed-files.local