Communityコーディング&開発github.com

html-pages

Build a web page, small tool, calculator or game as ONE self-contained HTML file that previews in the files panel.

html-pages とは?

html-pages is a Cursor agent skill that build a web page, small tool, calculator or game as ONE self-contained HTML file that previews in the files panel.

対応~Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/adarshthakur79/agentdesk/tree/HEAD/skills/html-pages

Installed? Explore more コーディング&開発 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Self-contained HTML pages

Create the file with workspace_create_file (no sandbox needed), for example index.html. The user opens it from the files panel, where it is previewed inside a locked-down frame.

Rules for the preview frame

  • The page runs in an iframe that allows scripts but is isolated from the app: localStorage, sessionStorage and cookies can throw errors there. Keep state in JavaScript variables; if you use storage anyway, wrap it in try/catch.
  • Put everything in ONE file: HTML, a <style> block and a <script> block. Do not rely on CDN scripts, web fonts or remote images (they may not load). Use system fonts, CSS shapes, inline SVG or emoji instead.
  • No network calls from the page (fetch to other sites) and no forms that submit somewhere.

Steps

  1. Decide what the page must do in one sentence, then write the whole file in one workspace_create_file call.
  2. Start with <!DOCTYPE html>, <meta charset="utf-8"> and <meta name="viewport" content="width=device-width, initial-scale=1">.
  3. Make it responsive (flexbox or grid, relative units) and readable: good contrast, sensible spacing, buttons that look like buttons.
  4. Write plain, careful JavaScript. Check inputs (empty, not a number) and show a clear message instead of failing silently.
  5. For later changes use workspace_edit_file with the exact text to replace instead of re-creating the file.
  6. Tell the user the file name and what the page does. You cannot run it yourself, so do not claim you tested it.

Example skeleton

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Tip calculator</title>
<style>
  body { font-family: system-ui, sans-serif; max-width: 420px; margin: 2rem auto; padding: 0 1rem; }
  input, button { font: inherit; padding: .5rem; margin: .25rem 0; width: 100%; box-sizing: border-box; }
  button { cursor: pointer; }
  #out { font-size: 1.25rem; margin-top: 1rem; }
</style>
</head>
<body>
  <h1>Tip calculator</h1>
  <input id="bill" type="number" min="0" placeholder="Bill amount">
  <input id="pct" type="number" min="0" value="10" placeholder="Tip %">
  <button id="go">Calculate</button>
  <div id="out"></div>
<script>
  document.getElementById("go").addEventListener("click", () => {
    const bill = parseFloat(document.getElementById("bill").value);
    const pct = parseFloat(document.getElementById("pct").value);
    const out = document.getElementById("out");
    if (!(bill >= 0) || !(pct >= 0)) { out.textContent = "Enter a valid bill and tip %."; return; }
    out.textContent = "Tip: " + (bill * pct / 100).toFixed(2) + "  Total: " + (bill * (1 + pct / 100)).toFixed(2);
  });
</script>
</body>
</html>

関連スキル