Skip to main content
ClaudeWave
Skill122 estrellas del repoactualizado 26d ago

user-ask-for-report

Generate a clean white Tailwind CDN report page from user content, optionally password-gate viewing via client-side decryption, and deploy to Originless/IPFS.

Instalar en Claude Code
Copiar
git clone --depth 1 https://github.com/besoeasy/open-skills /tmp/user-ask-for-report && cp -r /tmp/user-ask-for-report/skills/user-ask-for-report ~/.claude/skills/user-ask-for-report
Después abre una sesión nueva de Claude Code; el skill carga automáticamente.

SKILL.md

# Generate Report Website with Tailwind + Originless

Create a single `index.html` report page from user-provided content, style it with Tailwind CDN (white background, subtle animations), then publish it to Originless for instant hosting.

At the start, ask whether the user wants a **single-file page** (`index.html` only) or a **multi-file site** (separate CSS/JS/images/assets).
If they want multiple files, use `skills/static-assets-hosting/SKILL.md` and upload a `.zip` that contains `index.html` plus all assets.

## When to use

- User asks for a quick hosted report or landing page from text/data
- User wants no-build static HTML output (`index.html` only)
- User wants instant public hosting via Originless/IPFS
- User optionally asks for a password prompt before content is shown

Before generating the final HTML, pre-upload any images or other assets you plan to include and use the returned hosted URLs in `index.html`.
If the report content appears sensitive (PII, credentials, private business data, internal docs), explicitly ask the user whether they want password protection enabled.
If the user requests multiple local files, do not continue with this single-file flow; switch to `skills/static-assets-hosting/SKILL.md`.

## Required tools / APIs

- Originless endpoint (pick one):
  - `http://localhost:3232/upload` (self-hosted)
  - `https://filedrop.besoeasy.com/upload` (public instance)

No build tooling is required for the basic flow.

## Skills

### generate_index_html_report

Generate an `index.html` with Tailwind CDN and subtle animations.

**Design constraints:**

- White-first layout (`bg-white`, dark text)
- Slight motion only (fade/slide on cards, soft hover)
- Responsive, readable typography
- No external framework build step

**Starter template (`index.html`):**

```html
<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Report</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <style>
      @keyframes fadeUp {
        from {
          opacity: 0;
          transform: translateY(10px);
        }
        to {
          opacity: 1;
          transform: translateY(0);
        }
      }
      .fade-up {
        animation: fadeUp 0.45s ease-out both;
      }
    </style>
  </head>
  <body class="bg-white text-slate-900 antialiased">
    <main class="max-w-4xl mx-auto px-6 py-10">
      <header class="mb-8 fade-up">
        <h1 class="text-3xl sm:text-4xl font-semibold tracking-tight">User Report</h1>
        <p class="mt-2 text-slate-600">Generated static report page</p>
      </header>

      <section class="grid gap-4">
        <article class="fade-up rounded-2xl border border-slate-200 bg-white p-5 shadow-sm transition hover:-translate-y-0.5 hover:shadow-md">
          <h2 class="text-lg font-medium">Summary</h2>
          <p class="mt-2 text-slate-700 leading-relaxed">Replace with user-requested content.</p>
        </article>
      </section>
    </main>
  </body>
</html>
```

### upload_report_to_originless

Upload generated `index.html` and return hosted URL.

If the report includes images/files, upload those assets first, collect their hosted URLs/CIDs, and reference those URLs inside `index.html` before uploading the page.

Prefer `curl` for uploads, since it handles `multipart/form-data` reliably out of the box.
If another tool/runtime is used, it must be a full `curl -F` replacement: send a real multipart body, include the file part named exactly `file`, and preserve filename/content-type behavior.

**Bash:**

```bash
# Self-hosted Originless
curl -fsS -X POST -F "file=@index.html" http://localhost:3232/upload

# Public Originless
curl -fsS -X POST -F "file=@index.html" https://filedrop.besoeasy.com/upload
```

**Node.js:**

```javascript
import fs from "node:fs";

const file = new Blob([fs.readFileSync("index.html")], { type: "text/html" });
const form = new FormData();
form.append("file", file, "index.html");

const endpoint = "https://filedrop.besoeasy.com/upload";
const res = await fetch(endpoint, { method: "POST", body: form });
if (!res.ok) throw new Error(`Upload failed: ${res.status}`);

const out = await res.json();
console.log(out.url || out.cid || out);
```

### password_gate_report_optional

If user requests a password, keep content encrypted in the HTML and only render when the correct password is entered.

> Important: this is client-side access gating, not strong secret storage. Anyone with the file can still inspect code/assets.

**Client-side unlock block (drop into `index.html`):**

```html
<div id="lock" class="max-w-md mx-auto mt-16 p-6 border rounded-2xl">
  <h2 class="text-xl font-semibold">Protected Report</h2>
  <p class="text-slate-600 mt-2">Enter password to unlock.</p>
  <input id="pw" type="password" class="mt-4 w-full border rounded-lg px-3 py-2" placeholder="Password" />
  <button id="unlock" class="mt-3 px-4 py-2 rounded-lg bg-slate-900 text-white">Unlock</button>
  <p id="err" class="mt-2 text-sm text-red-600 hidden">Wrong password.</p>
</div>

<div id="app" class="hidden"></div>

<script id="enc" type="application/json">
  {
    "salt": "BASE64_SALT",
    "iv": "BASE64_IV",
    "ciphertext": "BASE64_CIPHERTEXT"
  }
</script>

<script>
  const enc = JSON.parse(document.getElementById("enc").textContent);

  const b64ToBytes = (b64) => Uint8Array.from(atob(b64), (c) => c.charCodeAt(0));

  async function deriveKey(password, saltBytes) {
    const keyMaterial = await crypto.subtle.importKey("raw", new TextEncoder().encode(password), "PBKDF2", false, ["deriveKey"]);
    return crypto.subtle.deriveKey(
      { name: "PBKDF2", salt: saltBytes, iterations: 100000, hash: "SHA-256" },
      keyMaterial,
      { name: "AES-GCM", length: 256 },
      false,
      ["decrypt"],
    );
  }

  async function decryptHtml(password) {
    const key = await deriveKey(password, b64ToBytes(enc.salt));
    const plain = await crypto.s