Cursor rule
.cursor/rules/deploy.mdcBuild → verify artifact → deploy → wait → smoke deployment pipeline. Platform-agnostic (MCP or CLI), with configurable timeout, retry with exponential backoff, and integrated health-check. The deploy half of CI/CD: run after build to push to production.
Cursor rules
Quality
77/100
Scores the file, not the repository.Length
894 words
18 headings · 8 code blocksRepository
119
— · pushed 1 days agoLast changed
3 days ago
First indexed 3 days ago.123456# Deploy78> **HARD GATE** — Do not deploy without running tests first. Run `test` or your CI suite before this skill.9>10> **HARD GATE** — Use this skill from a CI/CD pipeline or post-merge on `main`/`master`. Never deploy from a feature branch.11>12> **HARD GATE** — The deploy skill orchestrates deployment; the `smoke-test` skill validates post-deploy health. Chain them: `deploy → smoke-test`.1314Orchestrate a full build-to-deployment pipeline: build the artifact, verify it exists and is non-empty, invoke a platform deploy tool (MCP or CLI), poll until the deploy completes or times out, then run a baseline smoke test against the live URL.1516## Pipeline Stages1718```19build → verify artifact → deploy → wait/retry → smoke20```2122| Stage | Description | Failure mode |23|-------|-------------|-------------|24| Build | Execute the project's build command | Non-zero exit: report build error |25| Verify | Check artifact exists and is non-empty | Missing/empty: report artifact path |26| Deploy | Invoke platform deploy tool (MCP, Vercel CLI, rsync, etc.) | Non-zero exit: report deploy error |27| Wait | Poll deploy status every 30s up to `DEPLOY_TIMEOUT` (default 5 min) | Timeout: report exceeded |28| Smoke | `curl -sSf $DEPLOY_URL` as baseline health check | Non-200: report failure |2930## Process3132### 1. Detect build command3334Read project manifest files in order to determine the build command:3536| Manifest | Build command |37|----------|--------------|38| `package.json` | `npm run build` (or `scripts.build` value) |39| `Cargo.toml` | `cargo build --release` |40| `pyproject.toml` / `setup.py` | Depends on build backend (`poetry build`, `pip install -e .`, etc.) |41| `Makefile` | `make build` or first target named `build` |42| `AGENTS.md` / `CLAUDE.md` | Look for `build:` in project commands section |4344If no manifest is found, prompt the user with: "No detected build command. Pass `--build 'npm run build'` or specify the command."4546### 2. Build the artifact4748```bash49npm run build50```5152Or the detected command from step 1. If the build fails, exit non-zero and report the build output.5354### 3. Verify the artifact5556```bash57ARTIFACT_DIR="${ARTIFACT_DIR:-dist}"58if [ ! -d "$ARTIFACT_DIR" ] || [ -z "$(ls -A "$ARTIFACT_DIR" 2>/dev/null)" ]; then59 echo "FAIL: build artifact not found at $ARTIFACT_DIR"60 exit 161fi62```6364Configurable via `$ARTIFACT_DIR` environment variable (default: `dist/`).6566### 4. Deploy to platform6768Platform-agnostic — supports multiple deployment targets via environment variables:6970| Platform | Env var | Example |71|----------|---------|---------|72| Vercel | `VERCEL_TOKEN`, `VERCEL_PROJECT_ID` | `vercel deploy --prod --token $VERCEL_TOKEN` |73| Netlify | `NETLIFY_AUTH_TOKEN`, `NETLIFY_SITE_ID` | `netlify deploy --prod --auth $NETLIFY_AUTH_TOKEN --dir $ARTIFACT_DIR` |74| Platform MCP | MCP tool call | `mcp deploy` via your platform MCP server |75| rsync/SSH | `DEPLOY_SSH_USER`, `DEPLOY_SSH_HOST`, `DEPLOY_SSH_PATH` | `rsync -avz $ARTIFACT_DIR/ $DEPLOY_SSH_USER@$DEPLOY_SSH_HOST:$DEPLOY_SSH_PATH` |76| Custom | `DEPLOY_COMMAND` | Run any deploy command string |7778The deploy tool is selected by which environment variables are set. If none are configured:7980```bash81echo "No deploy target configured. Set one of: VERCEL_TOKEN, NETLIFY_AUTH_TOKEN, DEPLOY_SSH_USER+DEPLOY_SSH_HOST, DEPLOY_COMMAND, or MCP deploy tool."82exit 183```8485### 5. Wait and poll status8687After invoking the deploy command, poll for completion:8889See [REFERENCE.md](REFERENCE.md)9091Use exponential backoff for retries on transient failures:9293See [REFERENCE.md](REFERENCE.md)9495### 6. Baseline smoke test9697See [REFERENCE.md](REFERENCE.md)9899For comprehensive health-checking, chain to the `smoke-test` skill:100101```bash102# After deploy success103bash scripts/run-smoke.sh "$DEPLOY_URL"104```105106### 7. Three-independent-facts verification (e45s15)107108Before declaring deploy success, verify **three independent facts** — build artifact, platform accept, live/registry reachability. See [REFERENCE.md](REFERENCE.md#three-independent-facts).109110## Verify111112→ verify: `command -v curl >/dev/null 2>&1 && test -f skills/smoke-test/SKILL.md`113114---115116# Deploy — Reference117118## Configuration119120| Variable | Default | Description |121|----------|---------|-------------|122| `ARTIFACT_DIR` | `dist` | Build output directory |123| `DEPLOY_URL` | *(required)* | Live URL for smoke test |124| `DEPLOY_TIMEOUT` | `300` | Max wait for deploy completion (seconds) |125| `DEPLOY_POLL_INTERVAL` | `30` | Polling interval (seconds) |126| `RETRY_MAX` | `3` | Max deploy retry attempts |127| `BUILD_COMMAND` | *(auto-detect)* | Override build command |128129130---131132## Verification133134→ verify: `test -f deploy/SKILL.md && grep -q 'name: deploy' deploy/SKILL.md && echo OK`135→ verify: `grep -qi 'build\|artifact\|deploy\|smoke' deploy/SKILL.md && echo OK`136→ verify: `grep -ci 'package.json\|Cargo.toml\|Makefile\|manifest' deploy/SKILL.md | awk '{if($1>=1) print "OK"; else print "FAIL"}'`137→ verify: `grep -ci 'timeout\|poll\|status\|retry\|backoff' deploy/SKILL.md | awk '{if($1>=2) print "OK"; else print "FAIL"}'`138→ verify: `grep -q 'curl.*DEPLOY_URL\|smoke\|health' deploy/SKILL.md && echo OK`139140---141142## Reference block 1143144```bash145DEPLOY_TIMEOUT="${DEPLOY_TIMEOUT:-300}" # seconds (default 5 minutes)146DEPLOY_POLL_INTERVAL="${DEPLOY_POLL_INTERVAL:-30}" # seconds147148start_time=$(date +%s)149while true; do150 elapsed=$(( $(date +%s) - start_time ))151 if [ "$elapsed" -ge "$DEPLOY_TIMEOUT" ]; then152 echo "FAIL: deploy status polling timed out after ${DEPLOY_TIMEOUT}s"153 exit 1154 fi155156 status=$(get_deploy_status) # platform-specific status check157 if [ "$status" = "ready" ] || [ "$status" = "done" ]; then158 echo "Deploy completed in ${elapsed}s"159 break160 fi161162 sleep "$DEPLOY_POLL_INTERVAL"163done164```165166---167168## Reference block 2169170```bash171RETRY_MAX="${RETRY_MAX:-3}"172base_delay=2173for attempt in $(seq 1 "$RETRY_MAX"); do174 if deploy_command; then175 break176 fi177 if [ "$attempt" -eq "$RETRY_MAX" ]; then178 echo "FAIL: deploy failed after ${RETRY_MAX} attempts"179 exit 1180 fi181 sleep $(( base_delay * 2 ** (attempt - 1) ))182done183```184185---186187## Reference block 3188189```bash190DEPLOY_URL="${DEPLOY_URL:?DEPLOY_URL must be set}"191if curl -sSf "$DEPLOY_URL" > /dev/null 2>&1; then192 echo "OK: $DEPLOY_URL responds with HTTP 200"193else194 echo "FAIL: $DEPLOY_URL is not responding with HTTP 200"195 exit 1196fi197```198
Also in danielvm-git/bigpowers
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| danielvm-git/bigpowers.cursor/rules/align-grid.mdc · 119 | Cursor rules | lint-formatdo-notagent-behaviour | 65/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/assess-impact.mdc · 119 | Cursor rules | testtesting-strategydeployment | 66/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/audit-code.mdc · 119 | Cursor rules | setuptestlint-formatstyle+4 | 66/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/audit-plan.mdc · 119 | Cursor rules | buildteststylegit | 74/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/build-epic.mdc · 119 | Cursor rules | buildgit | 58/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/change-request.mdc · 119 | Cursor rules | no sections | 48/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/commit-message.mdc · 119 | Cursor rules | lint-formatstyletypesgit+3 | 82/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/compose-workflow.mdc · 119 | Cursor rules | styledo-notagent-behaviour | 65/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/context7-mcp.mdc · 119 | Cursor rules | style | 54/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/deepen-architecture.mdc · 119 | Cursor rules | testtesting-strategydo-not | 57/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/define-language.mdc · 119 | Cursor rules | lint-formatdo-not | 65/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/delegate-task.mdc · 119 | Cursor rules | git | 62/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/develop-tdd.mdc · 119 | Cursor rules | teststylearchtesting-strategy+5 | 85/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/diagnose-root.mdc · 119 | Cursor rules | no sections | 39/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/dispatch-agents.mdc · 119 | Cursor rules | git | 54/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/edit-document.mdc · 119 | Cursor rules | no sections | 39/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/elaborate-spec.mdc · 119 | Cursor rules | test | 58/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/enforce-first.mdc · 119 | Cursor rules | no sections | 50/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/evolve-skill.mdc · 119 | Cursor rules | no sections | 50/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/execute-plan.mdc · 119 | Cursor rules | do-not | 51/100 | 3 days ago |
Diff against .cursor/rules/align-grid.mdc Diff against .cursor/rules/assess-impact.mdc Diff against .cursor/rules/audit-code.mdc Diff against .cursor/rules/audit-plan.mdc Diff against .cursor/rules/build-epic.mdc Diff against .cursor/rules/change-request.mdc Diff against .cursor/rules/commit-message.mdc Diff against .cursor/rules/compose-workflow.mdc Diff against .cursor/rules/context7-mcp.mdc Diff against .cursor/rules/deepen-architecture.mdc Diff against .cursor/rules/define-language.mdc Diff against .cursor/rules/delegate-task.mdc Diff against .cursor/rules/develop-tdd.mdc Diff against .cursor/rules/diagnose-root.mdc Diff against .cursor/rules/dispatch-agents.mdc Diff against .cursor/rules/edit-document.mdc Diff against .cursor/rules/elaborate-spec.mdc Diff against .cursor/rules/enforce-first.mdc Diff against .cursor/rules/evolve-skill.mdc Diff against .cursor/rules/execute-plan.mdc
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 3 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago |
