Skill: ivangdavila/netlify-deploy (version 1.0.0)

--- name: Netlify Deploy slug: netlify-deploy version: 1.0.0 homepage: https://clawic.com/skills/netlify-deploy description: Deploy and manage Netlify sites with npx netlify, including auth, linking, preview deploys, production releases, and config checks. changelog: Initial release with authentication checks, link-or-create flow, and safer preview-to-production deployment guidance. metadata: {"clawdbot":{"emoji":"NET","requires":{"bins":["npx","git"],"config":["~/netlify-deploy/"]},"os":["linux","darwin","win32"]}} --- ## 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. ```text ~/netlify-deploy/ `- memory.md # Preferred deploy mode, default project path, and common build settings ``` 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 | `setup.md` | | 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 ```bash 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 ```bash 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 ```bash 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 ```bash 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 - `git` - branch hygiene and release-safe commit workflow - `deploy` - generic deployment planning across environments - `devops` - infrastructure and operational guardrails ## Feedback - If useful: `clawhub star netlify-deploy` - Stay updated: `clawhub sync`

path: cli-commands.md
content: # Netlify CLI Commands

## Authentication

```bash
npx netlify login
npx netlify status
npx netlify logout
```

## Site Linking

```bash
npx netlify link
npx netlify link --git-remote-url <url>
npx netlify init
npx netlify unlink
```

## Deployments

```bash
npx netlify deploy
npx netlify deploy --prod
npx netlify deploy --dir=dist
npx netlify deploy --message="release note"
npx netlify deploy:list
```

## Environment Variables

```bash
npx netlify env:list
npx netlify env:set KEY value
npx netlify env:get KEY
npx netlify env:import .env
```

## Build and Validation

```bash
npx netlify build
npx netlify build --dry
```

## Debugging

```bash
npx netlify --version
npx netlify status --verbose
npx netlify help deploy
```

## Dashboard Shortcuts

```bash
npx netlify open
npx netlify open:admin
npx netlify open:site
```


path: deployment-patterns.md
content: # Netlify Deployment Patterns

## Decision Flow

```text
Authenticated?
|- No -> npx netlify login
`- Yes -> Linked?
   |- No -> Try link by git remote
   |  |- Success -> preview deploy
   |  `- Fail -> npx netlify init
   `- Yes -> deploy mode?
      |- Preview -> npx netlify deploy
      `- Production -> npx netlify deploy --prod
```

## First-Time Deploy

1. `npx netlify status`
2. `npx netlify login` if needed
3. `npx netlify init`
4. Build locally (`npm run build` or project equivalent)
5. `npx netlify deploy` then optionally `--prod`

## Existing Site + Existing Repo

1. `git remote get-url origin`
2. `npx netlify link --git-remote-url <url>`
3. Run preview deploy and verify URL

## Monorepo Pattern

- Deploy from target package directory, or
- Set in `netlify.toml`:

```toml
[build]
  base = "packages/web"
  command = "npm run build"
  publish = "dist"
```

## Production Promotion Pattern

1. Preview deploy
2. Validate URL and smoke checks
3. Promote with `npx netlify deploy --prod`
4. Share production URL with commit context

## Error Recovery

- Auth error -> `npx netlify login`
- Site not linked -> link or init flow
- Publish directory missing -> rebuild and verify output folder
- Build failure -> run local build first, fix, redeploy


path: memory-template.md
content: # Memory Template - Netlify Deploy

Create `~/netlify-deploy/memory.md` with this structure:

```markdown
# Netlify Deploy Memory

## Status
status: ongoing
version: 1.0.0
last: YYYY-MM-DD
integration: pending

## Context
- Preferred deploy mode: preview first
- Default project path:
- Typical package manager:
- Typical publish directory:

## Project Notes
- repo-or-site-name: short operational notes

## Constraints
- Required approval gates before `--prod`
- Any environment variable or branch rules

## Notes
- Observed preferences from real usage

---
*Updated: YYYY-MM-DD*
```

## Status Values

| Value | Meaning | Behavior |
|-------|---------|----------|
| `ongoing` | Still learning defaults | Keep collecting deploy patterns |
| `complete` | Core defaults known | Execute with minimal clarification |
| `paused` | User postponed setup details | Use safe defaults and avoid extra setup prompts |
| `never_ask` | User does not want setup questions | Operate with explicit per-task confirmations |


path: netlify-toml.md
content: # netlify.toml Quick Reference

## Minimal Config

```toml
[build]
  command = "npm run build"
  publish = "dist"
```

## SPA Fallback

```toml
[[redirects]]
  from = "/*"
  to = "/index.html"
  status = 200
```

## Context Overrides

```toml
[context.production]
  command = "npm run build"

[context.deploy-preview]
  command = "npm run build:preview"
```

## Environment Variables

```toml
[build.environment]
  NODE_VERSION = "20"

[context.production.environment]
  NODE_ENV = "production"
```

## Monorepo Base Directory

```toml
[build]
  base = "apps/web"
  command = "npm run build"
  publish = "dist"
```

## Common Framework Publish Directories

- Vite / React: `dist`
- Vue: `dist`
- Astro: `dist`
- SvelteKit static adapter: `build`
- Static HTML: project root or configured directory

## Validation Command

```bash
npx netlify build --dry
```

Use this before first production deploy to catch config issues early.


path: setup.md
content: # Setup - Netlify Deploy

Read this when the user first asks to deploy with Netlify and project context is still unknown.

## Integration First

In the first exchange, confirm activation behavior:
- Should this skill activate whenever they mention Netlify deploys?
- Should production deploys always require explicit confirmation?
- Is there a default repository or folder to assume?

Store integration preferences in main memory.

## Environment Discovery

Before proposing commands, establish:
- Package manager in use (npm, pnpm, yarn)
- Build command and publish directory
- Whether the project is a monorepo or single app
- Whether the site is already linked in Netlify

## Safe First Execution

For initial command flow:
1. `npx netlify status`
2. `git remote get-url origin` (if repo exists)
3. `npx netlify link --git-remote-url <remote>` or `npx netlify init`
4. `npx netlify deploy` (preview first)

Use production deploy only after explicit user confirmation.

## What to Persist

In `~/netlify-deploy/memory.md`, keep:
- Preferred default deploy mode (preview first or prod-first by request)
- Frequent project paths and common publish directories
- Team-specific release constraints (for example: required preview review)

## Completion Signal

Setup is effectively complete once auth works, site linking is reliable, and one preview deploy succeeds with a valid URL.


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)