-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add HTML To Link deployment rule #335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Populate With 🤖 Prompt for AI Agents |
||
| --- | ||
|
|
||
| # 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 🤖 Prompt for AI Agents |
||
|
|
||
| 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 🤖 Prompt for AI Agents |
||
| ``` | ||
|
|
||
| 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win Protect the deployment token before persisting it.
🤖 Prompt for AI Agents |
||
|
|
||
| ## 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 | ||
There was a problem hiding this comment.
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.mdcURL.🤖 Prompt for AI Agents