AGENT SKILL
local-site-preview
Start a local web server for a local website or static HTML site so it can be previewed in a browser. Use when the user wants to preview, host, serve, or open a local site on localhost.
- License 许可
- MIT
- 最近更新
- 2026-09-11
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- local-site-preview
- description
- Start a local web server for a local website or static HTML site so it can be previewed in a browser. Use when the user wants to preview, host, serve, or open a local site on localhost.
02 资源文件 13
- 参考文档docs/DETECTION-RULES.md544 B
- 参考文档docs/UPGRADE-FROM-V1.md386 B
- 脚本profile/PowerShell-Profile-Snippet.ps1659 B
- 参考文档README.md1.7 KB
- 脚本scripts/start_local_site.py1.5 KB
- 脚本scripts/start-local-site.cmd294 B
- 脚本scripts/start-local-site.sh739 B
- 脚本scripts/Start-LocalSite.ps112.1 KB
- 脚本scripts/Start-LocalSite.ps1.backup-20260906-0251299.5 KB
- 脚本scripts/Start-LocalSite.ps1.backup-before-direct-node-20260906-02594111.3 KB
- 脚本scripts/Start-LocalSite.ps1.backup-node25-webstorage-20260910-23522111.2 KB
- 脚本scripts/Start-LocalSite.ps1.backup-static-port-20260906-15460311.2 KB
- 其他VERSION6 B
03 SKILL.md 正文
Local Site Preview
Use this skill when a local website needs to be served through localhost.
Primary use: static HTML
For a static HTML site, use the included PowerShell script:
./scripts/Start-LocalSite.ps1
The script accepts:
- a folder containing
index.html - a direct path to
index.html - an optional port
Default port: 8000.
Start a site
.\scripts\Start-LocalSite.ps1 -Path "C:\path\to\site"
Use a custom port
.\scripts\Start-LocalSite.ps1 -Path "C:\path\to\site" -Port 8001
Required behavior
The script must:
- Resolve the supplied path.
- If the path points to a file such as
index.html, use its parent directory. - Confirm that the target directory exists.
- Change to the website directory.
- Print the localhost URL.
- Never automatically open a browser.
- Start Python's local HTTP server.
- Leave the server running until the user presses
Ctrl+C. - Do not deploy the site or modify any external service.
Expected output:
Serving: C:\path\to\site
Open: http://localhost:8000
Stop: Ctrl+C
Usage from PowerShell or VS Code Terminal
Run the script directly:
& "C:\path\to\local-site-preview\scripts\Start-LocalSite.ps1" -Path "C:\path\to\website"
Or add a wrapper function to the user's PowerShell profile:
function Start-LocalSite {
param(
[Parameter(Mandatory = $true, Position = 0)]
[string]$Path,
[Parameter(Position = 1)]
[int]$Port = 8000
)
& "C:\path\to\local-site-preview\scripts\Start-LocalSite.ps1" `
-Path $Path `
-Port $Port
}
Then use:
Start-LocalSite "C:\path\to\website"
or:
Start-LocalSite "C:\path\to\website" 8003
Agent behavior
When this skill is invoked by an AI coding agent:
- Do not deploy anything.
- Do not push or commit code.
- Do not modify hosted services.
- Do not open the browser automatically.
- Prefer the bundled script for static HTML.
- If Python is unavailable, report that clearly instead of silently installing software.
- If the selected port is already occupied, tell the user and suggest another port.
04 同仓库更多 Skills
Test-SiteRoutes
暂无简介
★ 0
Test-Project
暂无简介
★ 0
Start-Project
暂无简介
★ 0
Search-MyStack
暂无简介
★ 0
Open-VercelProject
暂无简介
★ 0
Open-ProjectStack
暂无简介
★ 0