skills.simulatos

← All skills · writing

sharepoint-html

Author HTML that renders in SharePoint's OneUp HTML viewer and publish it into the user's own OneDrive / SharePoint. Use this skill whenever the user wants to create, host, publish, share, get a link for, or update a web page, dashboard, report, diagram, prototype, or slide deck inside Microsoft 365 — even if they don't say "SharePoint" or "OneDrive" by name. Covers the OneUp rendering contract (the CSP / sandbox rules that make HTML render instead of failing silently), embedding live SharePoint file data, and publishing via Microsoft Graph (primary) or the SharePoint Vroom API (when the agent is onboarded with SharePoint OAuth), plus ready-made templates.

43score
★ 24repo stars
2026-12-01first seen
2026-07-30last push
Open on GitHub Raw SKILL.md SharePoint/sharepoint-html · SKILL.md
namedescriptionlicensemetadata

What it says

---
name: sharepoint-html
description: Author HTML that renders in SharePoint's OneUp HTML viewer and publish it into the user's own OneDrive / SharePoint. Use this skill whenever the user wants to create, host, publish, share, get a link for, or update a web page, dashboard, report, diagram, prototype, or slide deck inside Microsoft 365 — even if they don't say "SharePoint" or "OneDrive" by name. Covers the OneUp rendering contract (the CSP / sandbox rules that make HTML render instead of failing silently), embedding live SharePoint file data, and publishing via Microsoft Graph (primary) or the SharePoint Vroom API (when the agent is onboarded with SharePoint OAuth), plus ready-made templates.
license: MIT
metadata:
  version: "1.0.0"
  author: "ODSP"
  discovery-endpoint: "https://<your-sharepoint-host>/_html"
  graph-base: "https://graph.microsoft.com/v1.0"
  vroom-base: "https://{tenant}-my.sharepoint.com/_api/v2.0"
---

# Publishing HTML to SharePoint (OneUp HTML viewer)

SharePoint already hosts HTML: save an `.html` file into OneDrive or SharePoint and
open it, and it renders in the **OneUp HTML viewer** — a sandboxed `<iframe>` under a
strict Content-Security-Policy. There is no separate hosting service to provision;
publishing is just **writing an `.html` file to the user's drive** as the signed-in
user, then opening the file's `webUrl`.

This skill teaches an agent two things:

1. **Author HTML that actually renders** — the OneUp CSP + sandbox *fail silently*, so
   non-compliant HTML shows up blank or half-broken with no error. Follow the contract
   below and it just works.
2. **Publish it** — upload the file with **Microsoft Graph** (primary) or the
   **SharePoint Vroom API** (`_api/v2.0`, for agents already holding a SharePoint token),
   then hand the user the returned `webUrl`.

The canonical, always-current copy of the authoring contract lives at your tenant's
discovery endpoint: **`https://<your-sharepoint-host>/_html`** (human page),
**`/_html/llms.txt`** (agent text), and **`/_html/help.json`** (structured). When in
doubt, fetch `/_html/llms.txt` — it is generated from the live viewer source.

---

## ⚠️ Before you publish: you are writing to the user's real drive

Publishing with this skill **creates or overwrites a file in the user's own OneDrive /
SharePoint, authenticated as that user**. It is not a throwaway sandbox.

- **Nothing becomes public automatically.** The file is private to the user until they
  explicitly share it. But it *is* a real document in their drive.
- **You MUST get the user's explicit confirmation before every upload and every
  overwrite.** Show them the exact target (drive, folder, filename) and whether it
  creates a new file or replaces an existing one, and wait for a yes. See
  [Confirm before writing](#confirm-before-writing).
- **Overwrite is destructive.** `PUT .../content` to an existing path replaces the file's
  contents. Confirm the path and that overwrite is intended.

---

## The authoring contract (make HTML render in OneUp)

Your HTML runs inside `<iframe sandbox="allow-scripts">` under a strict CSP that **fails
silently**. Follow these rules or the page renders blank/partial with no error.

**Content-Security-Policy applied to your HTML:**

```
default-src 'none';
script-src 'unsafe-inline' 'unsafe-eval';
style-src 'unsafe-inline';
img-src data: blob:;
font-src data: blob:;
connect-src 'none';
worker-src 'none';
object-src 'none';
base-uri 'none';
form-action 'none';
```

The wrapper iframe additionally applies `frame-src 'none'`.

**Non-negotiable rules:**

1. **No external resources.** No `<script src>`, `<link href>`, `<img src=https://…>`,
   `@import`, `url(https://…)`, remote fonts, or CDNs. **Inline everything** or use
   `data:` / `blob:` URIs.
2. **All script must be inline** `<script>` blocks. No module imports, no `import()`, no
   `<script src>`.
3. **All styling must be inline** `<style>` or `style="…"`. No `<link rel="stylesheet">`.
4. **No network at runtime** — `fetch`, `XMLHttpRequest`, `WebSocket`, `sendBeacon`,
   `EventSource` are all blocked (`connect-src 'none'`). To read SharePoint file data at
   view time, use the **LiveData manifest** (below) — it is the only sanctioned data path.
5. **No storage primitives** — `localStorage`, `sessionStorage`, `indexedDB`,
   `document.cookie` (opaque-origin sandbox). For cross-reload state, set `location.hash`
   directly (e.g. `location.hash = '#slide=3'`). Do **not** use `history.pushState`/
   `replaceState` — the sandboxed document's base URL is inherited from the wrapper's
   `blob:` origin, so any `url` argument (even a bare `#hash`) throws `SecurityError`.
6. **No top-level navigation, popups, form submission, workers, or plugins.**
   `alert` / `confirm` / `prompt` are no-ops.
7. Inline `on*=` handlers work (they're rewritten to nonced scripts) but are an XSS sink
   if they template untrusted data — prefer `addEventListener` for computed/user/fetched
   data.
8. **Save as UTF-8** (the file-creation APIs below write UTF-8; add a BOM if authoring by
   hand and non-ASCII renders wrong).

**Links:** `<a href>` opens only for same-tenant SharePoint hosts or the external
allowlist; `javascript:` / `vbscript:` / `data:` hrefs are rejected.

### Live SharePoint data (the only runtime data source)

Runtime `fetch` is blocked. To show live SharePoint file content, embed a **LiveData
manifest** — the host prefetches each item server-side with the viewer's credentials and
injects the results before your script runs:

```html
<script type="application/json" class="ka-livedata-manifest">
[{ "spItemUrl": "https://contoso.sharepoint.com/_api/v2.0/drives/{driveId}/items/{itemId}", "fileName": "data.csv" }]
</script>
```

Before your script runs, the host sets `window.__LD_RESULTS__`, keyed by the exact `spItemUrl`.
Each value is `{ format, content, error?, metadata }` — **read `content` (a string) and check `error`**.

Non-obvious but essential:

- **Always include `file

Also scanned in writing

Turn ONE topic into a finished Vox-style paper-collage explainer / ad video, end to end on the Atlas Cloud API + local ffmpeg — script, collage keyframes, motion, voice-over, music, captions, all auto

writingAlisa0808/vox-director★ 33312026-12-01

Remove signs of AI-generated writing from prose, and keep it out of a repo. Use when drafting, editing, or reviewing text to make it sound natural and human, or when auditing a whole docs folder for A

writingaashaexo/soundshuman★ 3072026-12-01

Use when a task spans multiple steps, files, or unknowns — before planning the order of work, whenever about to report completion or success in any wording, and when picking the next action after a re

writingwsbm393/Fable-Skill★ 252026-12-01

Checks how well a Linear cycle is prepared. Reports per-person load in working days against available days, tickets with no estimate, tickets nobody is assigned to, oversized tickets that need splitti

writingxornivore/skills★ 02026-12-01