dev-tweak-serve-package-json
Tweak serve/dev commands in package.json. Use when: (1) User says 'tweak serve', 'dev tweak serve', or 'tweak-serve', (2) User wants to add port-kill before dev/serve (--kill), (3) User wants :net LAN-accessible variants of dev/serve (--net). Flags: --kill adds predev port cleanup, --net adds 0.0.0.0 host variants.
Best use case
dev-tweak-serve-package-json is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Tweak serve/dev commands in package.json. Use when: (1) User says 'tweak serve', 'dev tweak serve', or 'tweak-serve', (2) User wants to add port-kill before dev/serve (--kill), (3) User wants :net LAN-accessible variants of dev/serve (--net). Flags: --kill adds predev port cleanup, --net adds 0.0.0.0 host variants.
Teams using dev-tweak-serve-package-json should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/dev-tweak-serve-package-json/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How dev-tweak-serve-package-json Compares
| Feature / Agent | dev-tweak-serve-package-json | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Tweak serve/dev commands in package.json. Use when: (1) User says 'tweak serve', 'dev tweak serve', or 'tweak-serve', (2) User wants to add port-kill before dev/serve (--kill), (3) User wants :net LAN-accessible variants of dev/serve (--net). Flags: --kill adds predev port cleanup, --net adds 0.0.0.0 host variants.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# dev-tweak-serve-package-json Tweak serving-related commands in package.json. Requires `--kill` and/or `--net` flag. ## Workflow 1. Read the project's package.json 2. Identify all serve/dev commands (scripts that start local servers — `dev`, `serve`, `preview`, `start`, etc.) 3. Detect the port(s) used by each command 4. Detect the framework (Next.js, Astro, Vite, etc.) from package.json dependencies 5. Apply the requested tweaks ## `--kill` flag Add port-killing before serve commands so stale processes don't block startup. ### Pattern For each serve command, detect the port it uses and add a `preXXX` script that kills it: ```json "predev": "lsof -ti :PORT | xargs kill 2>/dev/null; true", "dev": "astro dev", ``` - Use `preXXX` npm lifecycle hook naming (e.g., `predev` for `dev`, `preserve` for `serve`) - The kill command pattern: `lsof -ti :PORT | xargs kill 2>/dev/null; true` - If a `preXXX` script already exists, prepend the kill command to it - If the port is not obvious from the command, check common framework defaults (Astro: 4321, Next.js: 3000, Vite: 5173, etc.) ### Port detection priority 1. Explicit `-p PORT` or `--port PORT` flag in the command 2. Framework default port from dependencies ## `--net` flag Create `:net` suffixed variants of serve commands that bind to `0.0.0.0` for LAN access. ### Pattern For each serve command, create a `COMMAND:net` variant: ```json "dev": "astro dev", "dev:net": "astro dev --host 0.0.0.0", ``` ### Framework-specific host flags | Framework | Flag | | --- | --- | | Astro | `--host 0.0.0.0` | | Next.js | `-H 0.0.0.0` | | Vite / Vitest | `--host 0.0.0.0` | | Webpack Dev Server | `--host 0.0.0.0` | | serve (npm) | `-l tcp://0.0.0.0:PORT` or `--listen tcp://0.0.0.0:PORT` | | http-server | `-a 0.0.0.0` | | Docusaurus | `--host 0.0.0.0` | - Place the `:net` variant immediately after the original command - If the command already has a host flag, replace it with `0.0.0.0` - If `--kill` is also specified, the `:net` variant should also get a matching `preXXX:net` kill script ## Both flags together When both `--kill` and `--net` are specified, apply both tweaks. Example result: ```json "predev": "lsof -ti :4321 | xargs kill 2>/dev/null; true", "dev": "astro dev", "predev:net": "lsof -ti :4321 | xargs kill 2>/dev/null; true", "dev:net": "astro dev --host 0.0.0.0", ``` ## Important - Only modify scripts that actually start servers (dev, serve, preview, start and their variants) - Do not touch build, test, lint, or other non-server scripts - Preserve existing script order — insert new scripts adjacent to their originals - If the argument is missing or invalid, ask the user which flag(s) to apply
Related Skills
subagent-tweaker
Fix, improve, or update existing Claude Code custom agents (subagents). Use when: (1) User reports an agent isn't working well, (2) User wants to adjust agent behavior, tools, or model, (3) User says 'fix agent', 'update agent', 'tweak agent', 'agent not working'. Edits agent frontmatter, tool restrictions, prompts.
kicad-sch-tweak
Edit and create KiCad schematic (.kicad_sch) files. Use when user says 'edit schematic', 'modify kicad', 'add component', 'change resistor value', 'update schematic'. Capabilities: (1) Modify schematics (change values, add/remove components, update connections), (2) Create new schematic content from specs or ASCII diagrams, (3) Analyze structure. KiCad 6+ S-expression format. Generated schematics may need GUI layout adjustment.
dev-wip-package-upstream-wt-dev
Workflow for editing a WIP upstream package (consumed by this project via a sibling `file:../upstream/...` dep) when a fix or feature requires changing the upstream's code. ALWAYS work in a git worktree of the upstream — never on the shared `../upstream/` root checkout — because every consumer using that sibling shares the same on-disk HEAD. Use when: (1) The fix lives in the upstream package's source, not the consumer's, (2) User says 'edit upstream', 'fix upstream', 'patch upstream', 'upstream PR', 'I need to change the upstream framework', 'fix zfb / zdtp upstream', (3) Triaging a consumer-side issue and the root cause is in the upstream library, (4) Bumping the consumer's pin requires landing an upstream PR first.
dev-wip-package-refer
Pattern for consuming an in-progress (WIP) upstream npm/pnpm package from a sibling git checkout via a `file:../{name}/...` relative dep — without publishing the package. Use when: (1) Setting up a consumer project that needs to depend on a local in-development library or framework checked out next to it, (2) User mentions 'file: dep', 'sibling repo', 'upstream package', 'wip package', 'monorepo-style refer', 'how do we consume the upstream', (3) Deciding between this pattern and a published npm version or a `github:` git-URL dep, (4) Setting up a fresh machine that already has a consumer project but the sibling upstream isn't cloned yet, (5) A consumer's CI is failing because the sibling upstream isn't where the `file:` spec expects it.
dev-package-json
Organize and maintain package.json and npm config (.npmrc) for readability and security. Use when: (1) Reorganizing scripts section or adding separators, (2) Extracting multi-process commands into shell scripts, (3) Setting up multi-environment dev commands (local/preview/prod), (4) Handling pnpm "Ignored build scripts" warnings, (5) Configuring .npmrc security (strictDepBuilds, allowBuilds, ignoredBuilds), (6) Managing pnpm via corepack and packageManager field, (7) Adding predev port cleanup. Keywords: package.json, npm scripts, .npmrc, pnpm, build scripts, supply chain, corepack, packageManager, predev, kill port, port in use.
dev-npm-package
Develop npm packages with Node.js and TypeScript following modern best practices. Use when: (1) Creating a new npm package, (2) Setting up package.json exports (dual ESM/CJS or ESM-only), (3) Configuring TypeScript for library authoring (Bundler or Node16 moduleResolution), (4) Building/publishing with tsup or tsc, (5) Creating CLI tools with bin field, (6) Testing with vitest, (7) CI/CD for npm publishing, (8) ESM/CJS interop issues. Keywords: npm package, publish to npm, library development.
zudoesa-articlify
Convert conversation context into an esa article via the zudoesa-writer subagent. ONLY invoke when the user explicitly asks — NEVER proactively propose. Triggers: 'write esa article', 'esa記事', 'esaに書いて', 'articlify for esa', or /zudoesa-articlify. Gathers context, creates a writing brief, delegates to the writer subagent.
zudoesa-apply-voice
Apply Takazudo's esa writing voice and vocabulary rules to text. Use when: (1) User wants to write/rewrite text in Takazudo's esa style, (2) User says 'apply voice', 'esa voice', 'esa文体で', 'esa風に書いて', '文体を適用', (3) User provides text to transform to esa style. Reads writing-style.md and vocabulary-rule.md from takazudo-esa-writing repo and applies the rules.
zudocg-articlify
Convert conversation context into a CodeGrid article via the zudocg-writer subagent. ONLY invoke when the user explicitly asks — NEVER proactively propose. Triggers: 'write codegrid article', 'CodeGrid記事', 'codegridに書いて', 'articlify for codegrid', or /zudocg-articlify. Gathers context, creates a writing brief, delegates to the writer subagent.
zudocg-apply-voice
Apply Takazudo's CodeGrid writing voice and vocabulary rules to text. Use when: (1) User wants to write/rewrite text in Takazudo's CodeGrid style, (2) User says 'apply voice', 'codegrid voice', 'codegrid文体で', 'codegrid風に書いて', '文体を適用', (3) User provides text to transform to CodeGrid style. Reads writing-style.md and vocabulary-rule.md from takazudo-codegrid-writing repo and applies the rules.
zpaper-articlify
Convert conversation context into a zpaper blog article via the zpaper-writer subagent. ONLY invoke when the user explicitly asks — NEVER proactively propose. Triggers: 'write zpaper article', 'zpaper記事', 'zpaperに書いて', 'articlify for zpaper', or /zpaper-articlify. Gathers context, creates a writing brief, delegates to the writer subagent.
zpaper-apply-voice
Apply Takazudo's zpaper blog writing voice and vocabulary rules to text. Use when: (1) User wants to write/rewrite text in Takazudo's zpaper style, (2) User says 'apply voice', 'zpaper voice', 'zpaper文体で', 'zpaper風に書いて', 'ブログ文体を適用', (3) User provides text to transform to zpaper style. Reads writing-style.md and vocabulary-rule.md from the zpaper repo and applies the rules.