Dev Environment Patterns

Dev Environment Patterns is a skill for Claude Code from nxtg-ai/forge-plugin. It costs 105 tokens per session (2,176 once invoked), scanned A, original, MIT.

Guidance for making a local development server reachable from a phone, tablet, or another computer. It explains browser URLs, Vite's development proxy, environment variables, network binding, and WSL2, a Linux environment that runs inside Windows.

In plain words
What is it for?
Use it when a local frontend cannot reach its API or live-update connection from another device, or when configuring Vite for network-based testing.
Why use it?
It addresses failures caused by using localhost from another device, where localhost means that other device rather than the computer running the server. It helps diagnose connection, cross-origin, and WebSocket errors.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the nxtg-forge plugin — 27 skills, 24 commands, 33 agents shipped together

Good fit Use it when a local frontend cannot reach its API or live-update connection from another device, or when configuring Vite for network-based testing.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nxtg-ai/forge-plugin/dev-environment-patterns
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add nxtg-ai/forge-plugin --skill dev-environment-patterns
Clone the repo
git clone --depth 1 https://github.com/nxtg-ai/forge-plugin

Made for: Claude Code.

Or install nxtg-forge, the plugin that ships this one along with the rest of its 27 skills, 24 commands, 33 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Dev Environment Patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/nxtg-ai/forge-plugin/dev-environment-patterns/github.svg)](https://agentmods.dev/skills/nxtg-ai/forge-plugin/dev-environment-patterns)
Your own site
<a href="https://agentmods.dev/skills/nxtg-ai/forge-plugin/dev-environment-patterns"><img src="https://agentmods.dev/badge/skills/nxtg-ai/forge-plugin/dev-environment-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for Dev Environment Patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/nxtg-ai/forge-plugin/dev-environment-patterns"><img src="https://agentmods.dev/badge/skills/nxtg-ai/forge-plugin/dev-environment-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 105 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,176 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00105 $0.02176
Opus 5.5 $0.00042 $0.00870
Sonnet 5.5 $0.00021 $0.00435
Haiku 4.5 $0.00011 $0.00218

Measured 3d ago against content hash 0f8e757f2005, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

Dev Environment Patterns scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

allowed-tools: Read, Grep, Bash(lsof:*), Bash(ss:*), Bash(curl:*), Bash(cat:*)
plugins/nxtg-forge/skills/dev-environment-patterns/SKILL.md · 173 lines

How it starts

The opening of the file, as written. The whole thing — 173 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Development Environment Patterns

Institutional knowledge for local dev-server networking, learned from real forge-ui debugging. All code here mirrors the live config in forge-ui/vite.config.ts and forge-ui/src/services/api-client.ts (ports: UI 5050 → proxies to API/WS 5051).


Pattern: Multi-Device Development Access

Severity: Critical (blocks all functionality from non-localhost devices).

Symptom

API/WS calls fail only when accessed from a phone, tablet, or another PC:

  • Cross-Origin Request Blocked: localhost:5051
  • NetworkError when attempting to fetch resource
  • WebSocket connection failures

Root cause

localhost on the remote device points at that device, not the dev server. Any URL that names localhost (hardcoded or via VITE_API_URL) is unreachable off-machine. The fix is relative URLs proxied by Vite, so the browser only ever talks same-origin to whatever host it loaded the page from.

Correct pattern (matches live source)

// src/services/api-client.ts — env var wins, else relative /api in dev
const getApiBaseUrl = () => {
  if (import.meta.env.VITE_API_URL) return import.meta.env.VITE_API_URL; // prod only
  if (import.meta.env.DEV) return "/api";                                // Vite proxies this
  const host = typeof window !== "undefined" ? window.location.hostname : "localhost";
  return `http://${host}:5051/api`;                                       // prod fallback
};
// vite.config.ts — bind all interfaces + proxy /api, /ws, /terminal to 5051
server: {
  host: "0.0.0.0",     // accept connections from any device
  port: 5050,
  strictPort: true,    // FAIL if taken — does NOT auto-increment
  proxy: {
    "/api":      { target: "http://localhost:5051", changeOrigin: true },
    "/ws":       { target: "ws://localhost:5051", ws: true, changeOrigin: true },
    "/terminal": { target: "ws://localhost:5051", ws: true },
  },
}
# .env — never hardcode localhost. Leave VITE_API_URL UNSET in dev.
# VITE_API_URL=http://localhost:5051/api   # WRONG — breaks every non-local device

Read the full file on GitHub · 173 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago Changed 0f8e757f2005
  2. 1mo ago First seen · 173 lines · 105 tokens per session scan A c720d8b61251

Subscribe to this mod's changes

Dev Environment Patterns is a skill published in the GitHub repository nxtg-ai/forge-plugin (6 stars, last pushed 4d ago), licensed MIT. It adds 105 tokens to every session and 2,176 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.