Setup
On first use, read setup.md for integration and environment checks.
When to Use
User needs to deploy, host, publish, or relink a web project on Netlify from the terminal. Use this skill for first deploys, preview deploys, production pushes, monorepo paths, and netlify.toml fixes.
Architecture
Memory lives in ~/netlify-deploy/.
Use this local memory only for operational defaults so future deploy requests can start with the right safety assumptions.
CODEBLOCK0
See memory-template.md for setup.
Quick Reference
Load only the file needed for the current task to keep command decisions fast and avoid irrelevant context.
| Topic | File |
|---|
| Setup and integration flow | INLINECODE3 |
| Memory template |
memory-template.md |
| CLI command map |
cli-commands.md |
| Deployment scenarios |
deployment-patterns.md |
| Configuration examples |
netlify-toml.md |
Core Rules
1. Verify Auth and Site Link Before Any Deploy
npx netlify status
If not authenticated, run
npx netlify login and re-check status. If authenticated but not linked, resolve linking before deploy.
2. Use Link-First, Init-Second
git remote get-url origin
npx netlify link --git-remote-url <remote-url>
If the repository is not linked or no matching site exists, fall back to
npx netlify init.
3. Default to Preview Deploys Unless User Asks for Production
npx netlify deploy
Use
npx netlify deploy --prod only when the user explicitly requests production or confirms readiness.
Never force production deploys as a shortcut when validation is still pending.
4. Confirm Build and Publish Paths Before First Production Deploy
npm run build
npx netlify deploy --dir=dist
Use framework defaults only as a starting point. Validate the actual output folder in the current project.
5. Make Monorepo Context Explicit
For monorepos, deploy from the correct subdirectory or set
build.base in
netlify.toml before linking/deploying.
6. Report Actionable Results
After each deploy, return deploy URL, environment (preview or production), and one concrete next step.
Common Traps
These traps are prioritized by how often they cause failed or risky deploys in terminal-first workflows.
| Trap | Consequence | Fix |
|---|
| Running deploy before login check | Command fails with auth errors | Always run npx netlify status first |
Running --prod by default |
Unreviewed changes go live | Start with preview deploy unless user confirms production |
| Wrong publish directory | Site deploys blank or outdated build | Run local build and verify output folder |
| Linking from wrong monorepo folder | Deploys wrong app | Confirm current path and base directory before link/deploy |
| Treating
netlify.toml as optional on complex projects | Inconsistent builds between environments | Commit a minimal, explicit
netlify.toml |
External Endpoints
Only Netlify service endpoints and Netlify documentation endpoints are expected in normal usage of this skill.
| Endpoint | Data Sent | Purpose |
|---|
| https://api.netlify.com | Deploy metadata, site/project identifiers, build outputs via CLI | Authentication, linking, and deployments |
| https://app.netlify.com |
Browser session data when login opens OAuth flow | Interactive authentication and dashboard access |
| https://docs.netlify.com | Documentation requests only | Reference for command and config behavior |
No other data is sent externally.
Security & Privacy
Data that leaves your machine:
- - Project deploy artifacts and metadata are sent to Netlify when running deploy commands.
- Auth/session data is exchanged with Netlify during
npx netlify login.
Data that stays local:
- - Local source files and build scripts remain in your project unless you deploy.
- Skill preferences stay in
~/netlify-deploy/memory.md.
This skill does NOT:
- - Store secrets inside skill files.
- Run undeclared external services beyond Netlify endpoints.
- Modify unrelated repositories or directories.
Trust
By using this skill, deployment data is sent to Netlify services.
Only install if you trust Netlify with your project artifacts and deployment metadata.
Related Skills
Install with
clawhub install <slug> if user confirms:
- -
ci-cd - delivery pipeline design and release automation practices - INLINECODE21 - branch hygiene and release-safe commit workflow
- INLINECODE22 - generic deployment planning across environments
- INLINECODE23 - infrastructure and operational guardrails
Feedback
- - If useful: INLINECODE24
- Stay updated: INLINECODE25
设置
首次使用时,请阅读 setup.md 以完成集成和环境检查。
使用时机
用户需要从终端在 Netlify 上部署、托管、发布或重新关联 Web 项目时使用。此技能适用于首次部署、预览部署、生产环境推送、单仓库路径以及 netlify.toml 修复。
架构
记忆文件存储在 ~/netlify-deploy/ 目录中。
仅将此本地记忆用于操作默认值,以便未来的部署请求能够以正确的安全假设开始。
text
~/netlify-deploy/
- - memory.md # 首选部署模式、默认项目路径和常见构建设置
请参阅 memory-template.md 进行设置。
快速参考
仅加载当前任务所需的文件,以保持命令决策的快速性并避免无关上下文。
memory-template.md |
| CLI 命令映射 | cli-commands.md |
| 部署场景 | deployment-patterns.md |
| 配置示例 | netlify-toml.md |
核心规则
1. 在任何部署前验证身份验证和站点关联
bash
npx netlify status
如果未通过身份验证,请运行 npx netlify login 并重新检查状态。如果已通过身份验证但未关联,请在部署前解决关联问题。
2. 优先使用关联,其次使用初始化
bash
git remote get-url origin
npx netlify link --git-remote-url
如果仓库未关联或没有匹配的站点,则回退到 npx netlify init。
3. 默认使用预览部署,除非用户要求生产环境
bash
npx netlify deploy
仅在用户明确请求生产环境或确认准备就绪时,才使用 npx netlify deploy --prod。
当验证仍处于待定状态时,切勿强制进行生产环境部署作为捷径。
4. 在首次生产部署前确认构建和发布路径
bash
npm run build
npx netlify deploy --dir=dist
仅将框架默认值作为起点。验证当前项目中的实际输出文件夹。
5. 明确单仓库上下文
对于单仓库,在关联/部署前,从正确的子目录部署或在 netlify.toml 中设置 build.base。
6. 报告可操作的结果
每次部署后,返回部署 URL、环境(预览或生产)以及一个具体的下一步操作。
常见陷阱
这些陷阱按其在终端优先工作流中导致失败或风险部署的频率排序。
| 陷阱 | 后果 | 修复 |
|---|
| 在登录检查前运行部署 | 命令因身份验证错误而失败 | 始终先运行 npx netlify status |
| 默认运行 --prod |
未审查的更改上线 | 从预览部署开始,除非用户确认生产环境 |
| 错误的发布目录 | 站点部署空白或过时的构建 | 运行本地构建并验证输出文件夹 |
| 从错误的单仓库文件夹关联 | 部署错误的应用程序 | 在关联/部署前确认当前路径和基础目录 |
| 在复杂项目中认为 netlify.toml 可选 | 环境之间构建不一致 | 提交一个最小且明确的 netlify.toml |
外部端点
在正常使用此技能时,仅预期使用 Netlify 服务端点和 Netlify 文档端点。
| 端点 | 发送的数据 | 目的 |
|---|
| https://api.netlify.com | 部署元数据、站点/项目标识符、通过 CLI 的构建输出 | 身份验证、关联和部署 |
| https://app.netlify.com |
登录打开 OAuth 流程时的浏览器会话数据 | 交互式身份验证和仪表板访问 |
| https://docs.netlify.com | 仅限文档请求 | 命令和配置行为的参考 |
不会向外部发送其他数据。
安全与隐私
离开您机器的数据:
- - 运行部署命令时,项目部署工件和元数据会发送到 Netlify。
- 在 npx netlify login 期间,身份验证/会话数据会与 Netlify 交换。
保留在本地数据:
- - 本地源文件和构建脚本保留在您的项目中,除非您部署。
- 技能偏好设置保留在 ~/netlify-deploy/memory.md 中。
此技能不会:
- - 在技能文件中存储密钥。
- 运行 Netlify 端点之外的未声明外部服务。
- 修改无关的仓库或目录。
信任
使用此技能,部署数据将发送到 Netlify 服务。
仅当您信任 Netlify 处理您的项目工件和部署元数据时才安装。
相关技能
如果用户确认,使用 clawhub install 安装:
- - ci-cd - 交付管道设计和发布自动化实践
- git - 分支卫生和发布安全的提交工作流
- deploy - 跨环境的通用部署规划
- devops - 基础设施和操作护栏
反馈
- - 如果有用:clawhub star netlify-deploy
- 保持更新:clawhub sync