Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ By adding selected `.mdc` files to `.cursor/rules/`, you can use these rules dir
- [Cloudflare Email to Telegram](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/cloudflare-email-telegram-cursorrules-prompt-file.mdc) - Setting up email-to-Telegram forwarding via Cloudflare Email Routing and Workers using the mail2tg CLI.
- [Netlify](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/netlify-official-cursorrules-prompt-file.mdc) - Official deployment platform integration.
- [Vercel](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/vercel-deployment-cursorrules-prompt-file.mdc) - Deployment with serverless functions, Edge Runtime, middleware, caching, CI/CD, and production-ready configuration.
- [HTML To Link](rules/html-to-link-deploy.mdc) - Deploy HTML projects to a live public URL without server setup. Supports anonymous temporary pages and authenticated managed deployments.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use the canonical GitHub URL for the rule link.

The repository checklist requires README rule links to use canonical GitHub URLs. Replace the relative path with the full github.com/PatrickJS/awesome-cursorrules/blob/main/rules/html-to-link-deploy.mdc URL.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` at line 238, Update the HTML To Link entry in the README rule
checklist to replace the relative rules/html-to-link-deploy.mdc link with the
canonical GitHub URL for that rule, preserving the existing link text and
description.


### Build Tools and Development

Expand Down
107 changes: 107 additions & 0 deletions rules/html-to-link-deploy.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
---
description: Deploy HTML projects to a live public URL via htmlto.link - packages, uploads, and returns a shareable link without server setup
globs:
alwaysApply: false
Comment on lines +1 to +4

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Populate globs with a non-empty HTML pattern.

With alwaysApply: false and an empty globs value, this rule may not be selected for HTML projects. Add the repository-supported HTML glob pattern, such as **/*.html.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rules/html-to-link-deploy.mdc` around lines 1 - 4, Update the frontmatter for
the HTML deployment rule by replacing the empty globs value with the
repository-supported non-empty HTML pattern, such as **/*.html, while preserving
alwaysApply: false and the existing description.

---

# HTML To Link - Instant HTML Deployment

You have the ability to deploy the current project to a live public URL using HTML To Link (https://htmlto.link).

## When to use

When the user asks to:
- Deploy, publish, or host the current project/page
- Get a shareable link for the current work
- Put the current HTML/site online
- Share the current page with others

## Deployment workflow

1. Read `.htmltolink.json` from the project root if it exists.
- If it contains `shareUrl` + `updateToken`: update that existing page.
- If it contains `shareUrl` + `versionNo` (authenticated): update that managed page.
- Otherwise: create a new deployment.
Comment on lines +21 to +24

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Do not reuse expired anonymous deployments.

The configuration stores expiresAt, but this branch reuses any shareUrl plus updateToken without checking expiry. After 24 hours, it should fall back to a new deployment and replace the stale configuration.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rules/html-to-link-deploy.mdc` around lines 21 - 24, Update the existing-page
reuse logic for shareUrl and updateToken to validate expiresAt before reusing an
anonymous deployment. When expiresAt is reached or passed, create a new
deployment instead and replace the stale configuration; preserve reuse only for
unexpired deployments.


2. Package the project into a ZIP archive. **Always exclude**:
- `.htmltolink.json` (contains credentials)
- `node_modules`, `.git`, `.next`, `dist`, `.cache`, `.turbo`
- `.env`, `.env.*`, `*.pem`, `*.key` (secrets)

3. Call the deploy API:

```bash
curl -X POST "https://htmlto.link/api/skill/deploy" \
-F "file=@<zip-file-path>" \
-F "entry_file=index.html" \
-F "title=<project-name>"
Comment on lines +35 to +37

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Map the file and inspect the relevant range.
wc -l rules/html-to-link-deploy.mdc
cat -n rules/html-to-link-deploy.mdc | sed -n '1,140p'

Repository: PatrickJS/awesome-cursorrules

Length of output: 3988


Use the resolved entry file instead of hard-coding index.html. The rule says to ask when the entry HTML file is ambiguous, but all deploy examples still send entry_file=index.html, which will misdeploy projects whose entry file has a different name. Update these requests to use the selected entry file (or a placeholder that must be filled in).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rules/html-to-link-deploy.mdc` around lines 35 - 37, Update the deployment
request examples to pass the resolved or selected entry HTML file in the
entry_file form field instead of hard-coding index.html. Preserve the existing
project-name and zip-file placeholders, and use a clearly fillable entry-file
placeholder where the value is determined interactively.

```

For authenticated users (when `HTML_TO_LINK_TOKEN` env var exists):
```bash
curl -X POST "https://htmlto.link/api/skill/deploy" \
-H "Authorization: Bearer $HTML_TO_LINK_TOKEN" \
-F "file=@<zip-file-path>" \
-F "entry_file=index.html" \
-F "title=<project-name>" \
-F "share_url=<existing-shareUrl>"
```

For anonymous updates (reusing project-owned temporary page):
```bash
curl -X POST "https://htmlto.link/api/skill/deploy" \
-F "file=@<zip-file-path>" \
-F "entry_file=index.html" \
-F "title=<project-name>" \
-F "share_url=<shareUrl from .htmltolink.json>" \
-F "update_token=<updateToken from .htmltolink.json>"
```

4. After success, create or update `.htmltolink.json` in the project root:

Anonymous mode:
```json
{
"shareUrl": "https://htmlto.link/xxxxxxxx",
"updateToken": "<from API response>",
"temporary": true,
"expiresAt": "<from API response>"
}
```

Authenticated mode:
```json
{
"shareUrl": "https://htmlto.link/xxxxxxxx",
"versionNo": "<from API response>"
}
```

5. Ensure `.gitignore` contains `.htmltolink.json`.

6. Return **only** the final share URL to the user. Never expose `updateToken`.
Comment on lines +60 to +82

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Protect the deployment token before persisting it.

.htmltolink.json contains updateToken, yet .gitignore is updated only afterward. Ensure the ignore rule exists before writing the file, and handle any previously tracked copy because adding a pattern does not remove it from Git’s index.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rules/html-to-link-deploy.mdc` around lines 60 - 82, Update the deployment
flow so the `.gitignore` entry for `.htmltolink.json` is created or verified
before writing that file, and remove any previously tracked copy from Git’s
index while preserving it locally. Apply this ordering to the anonymous-mode
`updateToken` persistence without exposing the token in user output.


## Important rules

- Never display or log the `updateToken` value to the user.
- Never include `.htmltolink.json` in the upload ZIP.
- If the entry HTML file is ambiguous, ask the user which file to use.
- Anonymous deployments last 24 hours; updating resets the timer.
- The API returns JSON with `shareUrl`, and optionally `updateToken`, `expiresAt`, `versionNo`.

## MCP Server (alternative)

For native tool integration, users can add the MCP server instead:

```json
{
"mcpServers": {
"htmltolink": {
"command": "npx",
"args": ["-y", "htmltolink-mcp"]
}
}
}
```

GitHub: https://github.com/licc168/htmltolink-mcp
Loading