project-tunnel
Skill0 starsChanged 4 months agoMITView on GitHub
Expose local dev server via Cloudflare Tunnel. Use with /project-tunnel.
In this repository42 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- content-rewriteSkill
- content-writeSkill
- core-auditSkill
- core-bootstrapSkill
- core-commitSkill
- core-explainSkill
- core-finalizeSkill
- core-orchestrateSkill
- core-pullSkill
- core-setupSkill
- core-updateSkill
- design-convertSkill
- design-shipSkill
- design-tokensSkill
- dev-inspectSkill
- dev-learnSkill
- dev-manualSkill
- dev-optimizeSkill
- dev-securitySkill
- dev-shipSkill
- dev-tweakSkill
- game-debugSkill
- game-optimizeSkill
- game-shipSkill
- game-tweakSkill
- marketing-contentSkill
- marketing-researchSkill
- marketing-screenshotsSkill
- project-addSkill
- project-appSkill
- project-memorySkill
- project-planSkill
- project-removeSkill
- project-researchSkill
- project-seedSkill
- project-syncSkill
- project-todoSkill
- team-issuesSkill
- team-outsourceSkill
- team-reviewSkill
- team-verifySkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 7 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Start the dev server with Cloudflare Tunnel for HTTPS access from any device.
- Very specific: line 33
Dependencies: If node_modules does not exist → run npm install first.
- Very specific: line 35
Vite allowedHosts: If Vite project, check whether vite.config has a server.allowedHosts that allows .trycloudflare.com.
- Very specific: line 43
Port 3000: Use curl to detect whether a server is already running:
- Very specific: line 84
Wait until the server is ready using curl (max 20s, first compile can take a while):
- Very specific: line 94
Not ready after 20s → show last 20 lines from /tmp/devserver.log and stop.
- Distinctive: line 100
Check for existing tunnel first:
- Distinctive: line 106
No active tunnel → start a new one:
- Distinctive: line 127
After obtaining the tunnel URL in step 4:
- Very specific: line 130
Check whether next.config already has an allowedDevOrigins array with this hostname
- Very specific: line 131
If not → replace the entire allowedDevOrigins array with only the new hostname (old tunnel hostnames are invalid anyway)
- Distinctive: line 133
Verify that the server is still running after auto-restart:
- Distinctive: line 144
If the server does NOT respond after 15s → restart manually (see step 3)
- Distinctive: line 145
Verify again with curl loop, report tunnel URL
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Project Tunnel
Start the dev server with Cloudflare Tunnel for HTTPS access from any device.
1. Detect framework
Check package.json dependencies:
"vite"→ Vite project"next"→ Next.js project- Otherwise → error: "No supported framework found in package.json"
Start commands:
| Framework | Command |
| Vite | node node_modules/.bin/vite --port 3000 --host |
| Next.js | node node_modules/.bin/next dev -p 3000 |
Important: Always use
node node_modules/.bin/...instead ofnpx.npxwrapper processes sometimes die silently undernohup, while directnodeinvocation is stable.
2. Pre-flight checks
Dependencies: If node_modules does not exist → run npm install first.
Vite allowedHosts: If Vite project, check whether vite.config has a server.allowedHosts that allows .trycloudflare.com. If not → add:
server: {
allowedHosts: [".trycloudflare.com"];
}Port 3000: Use curl to detect whether a server is already running:
curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:3000- 200/3xx → something is running. Check
/tmp/devserver.logfor the project path.- Same project → skip to step 4
- Different project → report which project, kill everything (step 2b), continue to step 3
- 000 (no connection) → free, continue to step 3
2b. Cleanup (when kill is needed)
Kill in three layers to prevent zombie processes:
# Layer 1: port-based
fuser -k 3000/tcp 2>/dev/null
# Layer 2: framework processes (use what applies)
# Next.js:
pkill -f "next dev" 2>/dev/null
pkill -f "next-router-worker" 2>/dev/null
# Vite:
pkill -f "vite" 2>/dev/null
# Layer 3: tunnel
pkill -f cloudflared 2>/dev/null
sleep 2
fuserandsssometimes fail to detect Node.js dev servers because the port is bound in a way that is not visible to these tools. Therefore always also usepkill -fwith the framework-specific process name.
3. Start dev server
nohup [framework command] > /tmp/devserver.log 2>&1 &
echo $! > /tmp/devserver.pidWait until the server is ready using curl (max 20s, first compile can take a while):
for i in $(seq 1 20); do
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:3000 2>/dev/null)
[ "$HTTP_CODE" = "200" ] && echo "ready" && break
sleep 1
doneNot ready after 20s → show last 20 lines from /tmp/devserver.log and stop.
Verification: Always use
curlagainst127.0.0.1:3000, neverssorlsof. These tools do not reliably detect Node.js dev servers.
4. Start tunnel
Check for existing tunnel first:
pgrep -f cloudflared > /dev/null && grep -oE 'https://[a-z0-9-]+\.trycloudflare\.com' /tmp/cloudflared.log 2>/dev/null | head -1No active tunnel → start a new one:
pkill -f cloudflared 2>/dev/null; sleep 1
nohup cloudflared tunnel --url http://localhost:3000 --config /dev/null --metrics 127.0.0.1:0 > /tmp/cloudflared.log 2>&1 &
sleep 10
grep -oE 'https://[a-z0-9-]+\.trycloudflare\.com' /tmp/cloudflared.log | head -1
--config /dev/nullprevents a named tunnel config (~/.cloudflared/config.yml) from breaking the quick tunnel.--metrics 127.0.0.1:0prevents metrics port conflicts.
Report the tunnel URL.
5. Framework-specific tunnel config
Next.js: allowedDevOrigins
Next.js blocks cross-origin requests from unknown origins in dev mode. Without the tunnel hostname in allowedDevOrigins, client components do not hydrate (page stays stuck on loading state).
Important: Next.js does NOT support wildcard subdomain matching (
.trycloudflare.comdoes not work). The full tunnel hostname is required.
After obtaining the tunnel URL in step 4:
- Extract the hostname from the tunnel URL (without
https://) - Check whether
next.configalready has anallowedDevOriginsarray with this hostname - If not → replace the entire
allowedDevOriginsarray with only the new hostname (old tunnel hostnames are invalid anyway) - Wait 5 seconds — Next.js detects config changes and restarts automatically
- Verify that the server is still running after auto-restart:
sleep 5
for i in $(seq 1 15); do
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:3000 2>/dev/null)
[ "$HTTP_CODE" = "200" ] && echo "ready" && break
sleep 1
done- If the server does NOT respond after 15s → restart manually (see step 3)
- Verify again with curl loop, report tunnel URL
Because quick tunnels get a random hostname on each start, this step must be executed every time.
Vite: no action needed
Vite has no origin restriction in dev mode. After step 4 report the tunnel URL directly.
Stop
On request to stop:
fuser -k 3000/tcp 2>/dev/null
# Kill framework processes (use what applies)
pkill -f "next dev" 2>/dev/null
pkill -f "next-router-worker" 2>/dev/null
pkill -f "vite" 2>/dev/null
# Kill tunnel
pkill -f cloudflared 2>/dev/nullDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

