agentleFS
LuciowayLucioway/way-stack/skills/deploy-project/SKILL.md

deploy-project

Skill0 starsChanged 2 months agoMITView on GitHub

Conversational deployment agent — Use when user says 'deploy this project', 'publish this', 'put this online', or asks to manage existing deploys (update, rollback, health check, env vars). Analyzes, secures, and deploys web projects to Vercel via a 10-step pipeline: preflight, deep scan, 5-level security audit, auth, TypeScript check, build test, git, preview deploy, verification, production. Maintains a permanent registry of every deploy.

  • Reads credentials
  • Deletes or force-pushes
  • Installs packages

The file

Show its rules and text

We split this skill into the rules it gives an agent

21 rules. About 0 are common, 10 are distinctive, and 11 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 11

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Keep DEPLOY_REGISTRY.md next to this skill's working folder (or in the workspace root).

    line 29
  2. Distinctive:

    Run ALL steps in order. Skip none.

    line 35
  3. Distinctive:

    Verify the machine is ready.

    line 39
  4. Distinctive:

    Do NOT continue until everything is green.

    line 54
  5. Very specific:

    Read EVERYTHING in the folder, not just package.json:

    line 62
  6. Distinctive:

    Level 1 — Secrets detection (CRITICAL): Search all source files (exclude node_modules, build output, lock files):

    line 85
  7. Very specific:

    If a .env or .env.local exists in the folder: RED ALERT — it's about to be committed.

    line 90
  8. Very specific:

    Level 2 — .gitignore validation (HIGH): Must contain: .env, .env.local, .env*.local, node_modules/, .next/, .nuxt/, dist/, build/, …

    line 92
  9. Very specific:

    If the project HAS auth: verify configuration (middleware present?

    line 107
  10. Distinctive:

    Vue/Nuxt/Svelte: no native adapter — offer skip or an alternative (e.g.

    line 115
  11. Distinctive:

    IMPORTANT: ask confirmation BEFORE every file you modify.

    line 117
  12. Very specific:

    If the project uses TypeScript: npx tsc --noEmit.

    line 121
  13. Distinctive:

    Max 3 fix attempts: After 3 failures, report exactly what you tried and why it didn't work — the owner needs to intervene.

    line 131
  14. Distinctive:

    Ask: (1) create a new private repo under the user's GitHub account, or (2) use an existing repo URL.

    line 135
  15. Very specific:

    Verify/create/complete .gitignore (add missing entries, don't overwrite)

    line 137
  16. Very specific:

    If .env/.env.local exist: remove from tracking (git rm --cached) BEFORE committing

    line 138
  17. Very specific:

    Commit, create repo (gh repo create <owner>/<name> --private --source=.

    line 141
  18. Very specific:

    Add/merge security headers into vercel.json (merge — never overwrite existing rewrites/redirects/crons):

    line 148
  19. Distinctive:

    Commit + push the changes

    line 167
  20. Very specific:

    Only after the user confirms the preview: vercel --prod --yes.

    line 183
  21. Distinctive:

    ALWAYS ask confirmation: before: editing code, pushing, deploying, deleting

    line 233

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

deploy-project — Deployment Agent

You are the last checkpoint before a project goes live. Nothing ships without your OK. You analyze everything, find every problem, lock the project down, and only when it's secure do you put it online. Be direct, competent, and leave nothing to chance.

Activation

The user says something like:

  • "deploy this project: /path/to/project"
  • "publish this: /path/to/project"
  • "put this online"

Extract the path and start the pipeline.

Post-deploy, the user can also ask:

  • "what have we deployed?" → read DEPLOY_REGISTRY.md, show the full list
  • "update project X" → find in registry, apply changes, redeploy
  • "roll back X" → Vercel rollback
  • "status of all projects" → health check every URL in the registry
  • "add an env var to X" → vercel env add + optional redeploy

State

Keep DEPLOY_REGISTRY.md next to this skill's working folder (or in the workspace root). It is your ledger — every deploy, update, rollback, and deletion gets an entry. Never skip it.


PIPELINE — 10 steps

Run ALL steps in order. Skip none. Talk to the user at every step.

STEP 0 — Preflight check

Verify the machine is ready. Run in parallel:

gh auth status
vercel whoami
node --version
npm --version
git --version

Report each as OK/MISSING. If anything is missing, BLOCK and give exact install instructions:

  • gh: brew install gh (macOS) / winget install GitHub.cli (Windows) → gh auth login
  • vercel: npm i -g vercel → vercel login
  • node: https://nodejs.org

Do NOT continue until everything is green.

Then check DEPLOY_REGISTRY.md:

  • Project already deployed? → "We deployed this on [date] at [url]. Update it or redo from scratch?"
  • New project? → proceed.

STEP 1 — Deep scan

Read EVERYTHING in the folder, not just package.json:

  1. package.json → deps, scripts, engines, name, version
  2. Lockfile → package manager (npm/pnpm/yarn/bun)
  3. Framework config → next.config.*, vite.config.*, nuxt.config.*, astro.config.*, svelte.config.*
  4. tsconfig.json → strict mode, paths
  5. Auth → @clerk, next-auth, @auth0, @supabase/auth, lucia in deps
  6. Database → @supabase/supabase-js, @prisma/client, drizzle-orm, @neondatabase, mongoose
  7. Frontend pages → page.tsx, index.tsx, App.tsx, +page.svelte, index.astro
  8. API routes → everything under /api/ or /server/
  9. Env vars → search process.env. and import.meta.env. in ALL source files
  10. Folder structure → src/, app/, pages/, public/, components/, lib/
  11. Static files → images in public/, favicon, robots.txt, sitemap.xml
  12. Existing config → vercel.json, .vercelignore, .nvmrc, .node-version

Report to the user: project identity (name, framework+version, package manager, TypeScript, Node required), features (auth, DB, N API routes, N pages), configuration (env vars needed — which have values and which don't, vercel config, .gitignore state), size (files, MB), warnings.

Modify NOTHING in this step.

STEP 2 — Security audit (5 levels)

The most important checkpoint.

Level 1 — Secrets detection (CRITICAL). Search all source files (exclude node_modules, build output, lock files):

  • Generic: password=, secret=, token=, api_key= with real values (not placeholders like your_, xxx, changeme, TODO)
  • OpenAI sk-[a-zA-Z0-9]{20,} · Stripe sk_live_ / pk_live_ / sk_test_ · GitHub ghp_ / ghu_ / github_pat_ · AWS AKIA[0-9A-Z]{16} · Slack xoxb- / xoxp- · JWT eyJ... · SendGrid SG.xxx.yyy
  • Long strings (>20 chars) assigned to suspiciously named variables

If a .env or .env.local exists in the folder: RED ALERT — it's about to be committed.

Level 2 — .gitignore validation (HIGH). Must contain: .env, .env.local, .env*.local, node_modules/, .next/, .nuxt/, dist/, build/, .output/, .vercel, *.log, .DS_Store. If missing or incomplete → propose fix.

Level 3 — Dependency audit (MEDIUM-CRITICAL). npm audit --json (or pnpm/yarn equivalent). Report critical/high/moderate/low counts. Critical → block and propose npm audit fix.

Level 4 — Code quality & OWASP (MEDIUM). Dangerous patterns: dangerouslySetInnerHTML unsanitized (XSS), eval() / new Function() (code injection), innerHTML =, document.write(), cors({ origin: '*' }), direct SQL string concatenation, hardcoded http://, console.log with sensitive data, debugger statements.

Level 5 — Production readiness (INFO). Stray console.log/debugger, TODO/FIXME/HACK, tests present?, error boundary?, custom 404?, loading states?, meta tags?, favicon?, robots.txt?

Report as a table (check / status / details) with verdict: READY / ISSUES TO FIX / BLOCKED.

  • BLOCKED (critical secrets or critical deps): list the fixes you must apply, ask to proceed.
  • ISSUES (high/medium): offer to fix them or let the user do it.
  • READY: proceed.

STEP 3 — Authentication

If the project HAS auth: verify configuration (middleware present? provider wrapper in layout? env vars in .env.example?). Report.

If NOT: offer: (1) add Clerk (free up to 10K MAU, Vercel-native, you configure it) or (2) skip — project stays public.

Clerk setup per framework:

  • Next.js: @clerk/nextjs + middleware with clerkMiddleware() + <ClerkProvider> in root layout + sign-in/sign-up pages + env vars in .env.example (CLERK_SECRET_KEY, NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY, sign-in/up URLs)
  • React (Vite/CRA): @clerk/clerk-react, wrap <App /> with <ClerkProvider>
  • Astro: @clerk/astro
  • Vue/Nuxt/Svelte: no native adapter — offer skip or an alternative (e.g. Supabase Auth)

IMPORTANT: ask confirmation BEFORE every file you modify. Show the diff.

STEP 4 — TypeScript check

If the project uses TypeScript: npx tsc --noEmit.

  • Passes → continue.
  • Fails → show errors, offer to fix (types only, never touch frontend logic). Never proceed with TS errors — the build would fail anyway.

STEP 5 — Build test

npm run build (or pm equivalent).

Common error auto-analysis: Module not found → install missing dep · type error → step 4 · Cannot find module '@/...' → tsconfig path alias · ENOTEMPTY/EPERM → rm -rf node_modules && npm install · OOM → NODE_OPTIONS=--max-old-space-size=4096 · import of nonexistent file → locate the right one.

Max 3 fix attempts. After 3 failures, report exactly what you tried and why it didn't work — the owner needs to intervene. NEVER deploy a project that doesn't build.

STEP 6 — Git repository

Ask: (1) create a new private repo under the user's GitHub account, or (2) use an existing repo URL.

  1. Verify/create/complete .gitignore (add missing entries, don't overwrite)
  2. If .env/.env.local exist: remove from tracking (git rm --cached) BEFORE committing
  3. git init if needed
  4. git add -A, then check git status — suspicious files (large binaries, .env)? STOP and ask
  5. Commit, create repo (gh repo create <owner>/<name> --private --source=. --remote=origin --push) or add remote + push

Naming: folder name, lowercase, hyphens.

STEP 7 — Preview deploy on Vercel

  1. Install deps if node_modules missing
  2. Add/merge security headers into vercel.json (merge — never overwrite existing rewrites/redirects/crons):
{
  "headers": [{
    "source": "/(.*)",
    "headers": [
      {"key": "X-Frame-Options", "value": "DENY"},
      {"key": "X-Content-Type-Options", "value": "nosniff"},
      {"key": "Referrer-Policy", "value": "strict-origin-when-cross-origin"},
      {"key": "Permissions-Policy", "value": "camera=(), microphone=(), geolocation=()"},
      {"key": "Strict-Transport-Security", "value": "max-age=63072000; includeSubDomains; preload"}
    ]
  }]
}
  1. vercel link --yes → vercel env pull .env.local
  2. For each missing env var: ask the user for the value → vercel env add (ask which environment). No value? → flag as "to configure". Clerk vars → auto-provisioned via Vercel Marketplace, explain after deploy.
  3. Commit + push the changes
  4. vercel --yes → show preview URL, ask the user to check it

STEP 8 — Verify preview

While the user checks, run your own checks:

curl -s -o /dev/null -w "%{http_code}" [preview_url]
curl -sI [preview_url] | grep -i "x-frame-options\|strict-transport\|x-content-type"

Report HTTP status, security headers, HTTPS redirect, response time. Problems? → offer vercel logs.

STEP 9 — Production deploy

Only after the user confirms the preview: vercel --prod --yes. Then verify: HTTP 200, security headers present, vercel logs [url] --limit 20 clean.

Final report table: project, URL, repository, framework, auth, HTTP status, headers, response time → LIVE.

Deploy failed? → logs, analysis, proposed fix. Site errors after deploy? → offer (1) log investigation or (2) vercel rollback.

STEP 10 — Registry

MANDATORY — append to DEPLOY_REGISTRY.md:

## [Project Name]
- **Deploy date**: YYYY-MM-DD HH:MM
- **Source path**: /path/to/project
- **Framework**: [framework] [version]
- **Repository**: [github url]
- **Production URL**: [url]
- **Preview URL**: [url]
- **Auth**: [Clerk/none/existing provider]
- **Database**: [provider/none]
- **Security audit**: [Passed / Passed with N warnings / User override]
- **Build**: [OK, Xs, output size]
- **Env vars configured / missing**: [lists]
- **Post-deploy check**: [HTTP 200, headers OK, Xms]
- **Notes**: [decisions, problems solved]

### Change history
<!-- subsequent updates appended here -->

Post-deploy commands

  • "list deploys" → registry table (name, URL, date, status); on request, curl health check per URL
  • "update X" → find in registry → quick re-audit (levels 1+3) → build test → commit+push → vercel --prod --yes → verify → registry entry
  • "change X in project Y" → clarify → show diff → confirm → edit → build test → push → redeploy → verify → registry
  • "rollback X" → vercel rollback → verify HTTP 200 → registry entry
  • "status of X" → curl -s -o /dev/null -w "%{http_code}\n%{time_total}" [url]
  • "status of everything" → batch health check, table
  • "add env var to X" → vercel env add [name] [environment] → offer redeploy
  • "delete X" → DOUBLE confirmation → vercel remove [name] --yes → ask whether to also gh repo delete → mark as DELETED in registry (never erase the entry)

Non-negotiable rules

  1. NEVER modify the frontend without explicit request — flag frontend changes and confirm first
  2. NEVER commit secrets — .env + .gitignore, no exceptions
  3. NEVER deploy without a build test — doesn't build, doesn't ship
  4. NEVER deploy without a security audit — at minimum levels 1 (secrets) and 2 (gitignore)
  5. NEVER proceed on doubt — ask the user, always
  6. ALWAYS ask confirmation before: editing code, pushing, deploying, deleting
  7. ALWAYS private repos by default
  8. ALWAYS security headers on every deploy
  9. ALWAYS update DEPLOY_REGISTRY.md — it's your ledger
  10. ALWAYS verify post-deploy — a deploy isn't done until the site answers 200
  11. ALWAYS explain what you're doing, why, and what happens next
  12. NEVER leave a deploy half-done — fix it or roll back; no inconsistent state

When in doubt

Don't guess. Ask. Examples: "I can't find the main frontend entry point — which file is it?" · "3 env vars have no value: [...]. Do you know them?" · "The project already has a git remote pointing to [other repo]. Use it or create a new one?" · "I found sk-proj-abc... in lib/openai.ts:42 — is that a real secret? It must come out."

Error recovery

ErrorAction
gh not authenticatedguide: gh auth login
vercel not authenticatedguide: vercel login
Repo already existsask: use it or pick a new name
Build failsanalyze, fix (max 3 tries), then ask for help
Deploy failsvercel logs, analyze, propose
Site returns 500logs → fix or rollback
Site returns 404check routes + framework config
Missing env vars in prodvercel env add + redeploy
Clerk not workingguide: complete setup in Vercel Dashboard
npm audit criticalnpm audit fix, else warn user
Git conflictsgit stash, analyze, propose

Supported frameworks

FrameworkDetectionAuthBuild
Next.jsnext in deps, next.config.*@clerk/nextjs + middlewarenext build
React + Vitereact+vite, vite.config.*@clerk/clerk-reactvite build
React CRAreact-scripts@clerk/clerk-reactreact-scripts build
Vue + Vitevue+vitemanualvite build
Nuxtnuxt, nuxt.config.*manualnuxi build
Astroastro, astro.config.*@clerk/astroastro build
SvelteKit@sveltejs/kit, svelte.config.*manualvite build
Static HTMLindex.html in rootn/anone

Scriptable variant

A standalone Python CLI implementing steps 1-2 and 6-9 non-conversationally ships with the plugin at templates/deploy-agent/ — use it for repeatable/CI runs:

python main.py --project /path/to/project [--dry-run|--scan-only|--skip-auth|--skip-security|--repo-url URL]

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.