Skip to content

Add HTML To Link deployment rule#335

Open
licc168 wants to merge 2 commits into
PatrickJS:mainfrom
licc168:main
Open

Add HTML To Link deployment rule#335
licc168 wants to merge 2 commits into
PatrickJS:mainfrom
licc168:main

Conversation

@licc168

@licc168 licc168 commented Jul 20, 2026

Copy link
Copy Markdown

Value To Cursor Users

Adds a deployment rule that lets Cursor agents publish HTML projects to a live public URL in one step — no server, no DNS, no build pipeline. Useful for AI-generated pages, client demos, and quick previews.

Added Or Changed Files

  • rules/html-to-link-deploy.mdc — New rule: deploy workflow with anonymous and authenticated modes
  • README.md — Added entry under Hosting and Deployments section

Quality Checklist

  • The contribution includes original rule content, or clearly credits the source.
  • New rule files use a descriptive kebab-case filename, such as 'react-typescript.mdc'.

Summary by CodeRabbit

  • New Features

    • Added guidance for deploying HTML projects to a public URL through htmlto.link.
    • Supports anonymous temporary pages and authenticated managed deployments.
    • Documents project packaging, deployment configuration, secure credential handling, and sharing the resulting link.
  • Documentation

    • Added the HTML To Link deployment entry to the Hosting and Deployments documentation.
    • Included optional MCP server configuration instructions.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds an HTML To Link deployment rule covering project packaging, authenticated and anonymous deployment, credential handling, persisted configuration, and MCP usage. The README now lists the rule under Hosting and Deployments.

Changes

HTML To Link deployment

Layer / File(s) Summary
HTML deployment rule and catalog entry
rules/html-to-link-deploy.mdc, README.md
Defines when and how to deploy HTML projects, including ZIP exclusions, authentication modes, configuration updates, secret-handling constraints, anonymous expiry behavior, API response fields, and an alternative MCP server configuration. Adds the rule to the README’s Hosting and Deployments list.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: patrickjs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers value and changed files, but it omits required Summary, Contribution Type, and most checklist/maintainer sections. Add a Summary, choose a Contribution Type, and complete the remaining checklist and maintainer notes, including rule frontmatter and README link details.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately describes the main change: adding an HTML To Link deployment rule.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 5

🧹 Nitpick comments (1)
rules/html-to-link-deploy.mdc (1)

96-102: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Pin the MCP package version.

npx -y htmltolink-mcp downloads and executes an unpinned release, reducing reproducibility and increasing supply-chain risk. Pin a reviewed version and, where possible, verify its integrity.

🤖 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 96 - 102, Update the htmltolink
MCP server configuration under mcpServers.htmltolink so the npx argument
references a specific reviewed htmltolink-mcp version instead of an unpinned
package; preserve the existing -y behavior and verify the package integrity if
the configuration supports it.
🤖 Prompt for all review comments with 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.

Inline comments:
In `@README.md`:
- 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.

In `@rules/html-to-link-deploy.mdc`:
- Around line 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.
- Around line 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.
- Around line 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.
- Around line 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.

---

Nitpick comments:
In `@rules/html-to-link-deploy.mdc`:
- Around line 96-102: Update the htmltolink MCP server configuration under
mcpServers.htmltolink so the npx argument references a specific reviewed
htmltolink-mcp version instead of an unpinned package; preserve the existing -y
behavior and verify the package integrity if the configuration supports it.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2161d6d1-1179-4670-9ccc-6eef036de548

📥 Commits

Reviewing files that changed from the base of the PR and between b044f95 and c65f363.

📒 Files selected for processing (2)
  • README.md
  • rules/html-to-link-deploy.mdc

Comment thread README.md
- [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.

Comment on lines +1 to +4
---
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

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.

Comment on lines +21 to +24
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.

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.

Comment on lines +35 to +37
-F "file=@<zip-file-path>" \
-F "entry_file=index.html" \
-F "title=<project-name>"

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.

Comment on lines +60 to +82
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`.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant