diegomarino/claude-toolshed/dev-setup
Claude Code and agent skill by diegomarino/claude-toolshed
- community
Checking that the SKILL.md file is still in the repository.
Generate dev server lifecycle scripts (start/stop/status/ports) from detected project structure
Install
npx vskill@latest install diegomarino/claude-toolshed/dev-setupSKILL.md
/dev-setup
User request: "$ARGUMENTS"
Task
Detect the project's structure, propose a dev environment configuration, and generate bash scripts for managing servers, Chrome profiles, and worktree port isolation.
Process
Step 0: Ensure dependencies
Resolve plugin path:
If the script exits with an error, show the missing dependency message to the user and stop. Warnings about optional tools can be shown but should not block execution.
Route: upgrade
If $ARGUMENTS starts with "upgrade":
Read references/upgrade-route.md and follow the steps there.
Route: health
If $ARGUMENTS starts with "health":
- Resolve plugin path (same as upgrade route)
- Run the health check script:
``bash bash "$SKILL_DIR/reference/dev-setup-health.sh" ``
- Print the output to the user. Then stop — do not continue to Step 1.
Step 1: Resolve project root
If $ARGUMENTS is a non-empty path, use it as the project root. Otherwise use the current directory ($PWD).
Important: Claude's Bash tool does not preservecdbetween calls. Prefix every subsequent Bash command in Steps 2-5 withcd "$PROJECT_ROOT" &&to ensure all detection runs in the correct directory.
Step 2: Detect package manager
Run the following detection in Bash:
Step 3: Detect services and ports
First check if package.json exists:
If NODE=false, skip the python3 snippet and the concurrently check in Step 4 — set CONCURRENTLY=false and note "not a Node project".
Scope note: Service detection, runner options, andpackage.jsonscript generation (Steps 3-9) assume a Node/JS project. For non-Node stacks (cargo,go, etc.), onlydev-post-checkout.sh(dependency install) is generated reliably. Tell the user: "Service management scripts for [stack] are not yet supported — only dependency install was generated. You can add custom start/stop scripts to<SCRIPT_DIR>/manually."
Read package.json scripts for entries matching dev:*, start, serve, preview:
Read existing port assignments from env files:
Try Context7 first. If resolve-library-id returns no match or query-docs returns no relevant result, use the WebFetch fallback URL instead.
If vite.config.* exists, resolve current Vite port API:
- Use Context7:
resolve-library-id "vite"→query-docs "dev server port configuration" - Fallback (
WebFetch):https://vitejs.dev/config/server-options.html
If docker-compose.yml exists:
- Use Context7:
resolve-library-id "docker compose"→query-docs "ports mapping" - Fallback (parse directly — no docs needed):
grep -A2 'ports:' docker-compose.yml
Step 4: Detect existing scripts and runtime tools
If shellcheck is missing (STATUS=missing), warn the user: "Required tool shellcheck not found. Run /dev-setup health for install instructions."
Step 5: Detect Chrome and gtr config
Set GTR="yes" if GTR_BINARY=found, GTR="no" otherwise. Do not ask the user — presence in PATH is the decision.
If .gtrconfig exists, use Context7 to validate hook syntax:
Try Context7 first. If resolve-library-id returns no match or query-docs returns no relevant result, use the WebFetch fallback URL instead.
resolve-library-id "git-worktree-runner"→query-docs "postCreate hook env vars WORKTREE_PATH BRANCH"- Fallback:
WebFetch https://github.com/coderabbitai/git-worktree-runner
Step 6: Propose configuration — Call A
Summarize the detected project in 2-3 lines (package manager, services found, tools available), then call AskUserQuestion with these 4 questions:
Constraint: Each call supports 1-4 questions with 2-4 options each.
Store the user's answers as:
SELECTED_SERVICES— array of selected labelsRUNNER— selected labelCHROME— selected labelSCRIPT_DIR— selected label (strip trailing slash for filesystem use)
Step 7: Propose configuration — Call B (conditional)
Only run Call B if `CHROME = "Yes — create profile".`
If not, skip to Step 8.
Store answers as:
CHROME_PROFILE_NAME— profile name extracted from label (e.g. "myapp" from "myapp :19222"), or if "Other": ask user for profile name (string, no spaces) and CDP port (number) separatelyCHROME_CDP_WT_PORT— port extracted from label (e.g. "19222")
Script Conventions
Apply these patterns to ALL generated scripts.
Strict mode
All standalone scripts: set -euo pipefail Sourced utilities (dev-read-ports.sh, dev-session-name.sh): NO strict mode — it would bleed into the caller shell.
Port reading (dev-read-ports.sh) and session naming (dev-session-name.sh)
Both are sourced utilities — no `set -euo pipefail` (would bleed into caller). See reference files for full pattern. Key behaviors:
_read_env VAR DEFAULTreads from.wt-ports.env → .env → .env.example(first match wins)dev_session_namereturnsb-<branch>(normalized lowercase, hyphens)- Adapt exported port vars to match
SELECTED_SERVICES(don't hardcode all 4 from reference)
Output format — ALL status/lifecycle scripts
Emit KEY=value lines, no ANSI color, one line per entity:
Port variable naming
All vars ending in _WT_PORT are worktree-isolated service ports written to .wt-ports.env per worktree. Config/range vars use PORT_ prefix (e.g. PORT_MIN, PORT_MAX).
| Service | Env var | |
|---|---|---|
| API server | API_WT_PORT | |
| Web/Vite | WEB_WT_PORT | |
| Storybook | STORYBOOK_WT_PORT | |
| ttyd | TTYD_WT_PORT | |
| Chrome CDP | CHROME_CDP_WT_PORT |
Port allocator (dev-allocate-ports.sh)
Standalone script that allocates N consecutive free ports from a safe pool (20000-29999). Uses lsof -nP -iTCP:"$port" -sTCP:LISTEN to verify availability. Two modes:
- Allocate:
bash dev-allocate-ports.sh 4→ prints 4 consecutive free ports - Validate:
bash dev-allocate-ports.sh 4 --validate 23847 23848 23849 23850→ checks ports, suggests replacements if occupied
See $SKILL_DIR/reference/dev-allocate-ports.sh for the full pattern.
Worktree port allocator (dev-wt-ports.sh)
Calls dev-allocate-ports.sh to get a block of free ports, then writes them to .wt-ports.env. Must use $WORKTREE_PATH and $BRANCH env vars (set by git gtr postCreate hook), not $PWD.
Step 8: Generate bash scripts
Using the user's answers (SELECTED_SERVICES, RUNNER, CHROME, SCRIPT_DIR, GTR) and the convention patterns above, generate each script. Throughout this section, <SCRIPT_DIR> refers to the $SCRIPT_DIR value collected in Step 6 — replace it with the actual path (e.g. tools/dev) everywhere it appears. For every file:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/dev-setup/skills/dev-setup/SKILL.md
Popularity
- Repository stars
- 44
- Repository forks
- 4
- 7-day trend score
- 19
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 18 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/diegomarino/claude-toolshed/dev-setup)