Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
lovstudio avatar

Lovstudio Project Port

  • 10 installs
  • Updated August 4, 2026
  • lovstudio/dev-skills

Helps with ai & agent building tasks.

About

lovstudio-project-port is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.

  • lovstudio-project-port
  • AI & Agent Building
  • AI-coding skill

Lovstudio Project Port by the numbers

  • 10 all-time installs (skills.sh)
  • +2 installs in the week ending Aug 2, 2026 (Skillselion tracking)
  • Ranked #11,959 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/lovstudio/dev-skills --skill lovstudio-project-port

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs10
Last updatedAugust 4, 2026
Repositorylovstudio/dev-skills

What it does

Helps with ai & agent building tasks.

Files

SKILL.mdMarkdownGitHub ↗

Project Port Generator

为项目生成稳定唯一的端口号(范围 3000-8999),同一项目名永远返回相同端口。

端口生成算法

def generate_port(project_name: str) -> int:
    hash_value = sum(ord(c) * (i + 1) for i, c in enumerate(project_name))
    return 3000 + (hash_value % 6000)

使用场景

1. 查询项目端口

用户询问端口时,直接计算并告知:

项目 "lovstudio" 的端口号是:7965

2. 更新项目配置

检测并更新项目中的端口配置文件:

文件配置方式
.env / .env.localPORT=<port>
package.jsonscripts 中的 --port <port>
vite.config.tsserver.port: <port>
next.config.js通常使用 .env

更新时优先使用 .env 方式,最小侵入性。

3. 启动开发服务器

PORT=$(scripts/hashport.sh) pnpm dev

脚本

运行 scripts/hashport.sh [project-name] 生成端口:

# 使用当前目录名
./scripts/hashport.sh
# 输出: 7965

# 指定项目名
./scripts/hashport.sh my-project
# 输出: 5123

端口冲突处理

若端口被占用: 1. 提示用户哪个进程占用了端口 2. 建议使用 lsof -i :<port> 查看 3. 可追加后缀生成备用端口:generate_port("project-dev")

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.