Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Iblai Api Studio Pdf

BSecurity

Add a PDF viewer component to an Open edX unit on Studio — enable the pdf advanced module on the course, upload the PDF as a course asset, create the pdf block, and save its title and href through the block's own save_pdf handler (the generic xblock update does not persist the file field). Use when the user wants a PDF, slides, a syllabus, a reading handout or any document displayed inline in a unit. Session auth via studio.env.

15 stars
0 votes
0 copies
0 views
Added 9/20/2026
developmentpythongobashnodeapi

Works with

api

Security Analysis

B88/100
criticalDownloads and executes remote scripts — classic supply chain attack

Scanned 9/20/2026

Install to Claude Code

$npx -y skills add iblai/vibe --skill iblai-api-studio-pdf --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Iblai Api Studio Pdf?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Iblai Api Studio Pdf
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/iblai-iblai-api-studio-pdf/badge)](https://www.skillsdirectory.com/skills/iblai-iblai-api-studio-pdf)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: iblai-api-studio-pdf
description: Add a PDF viewer component to an Open edX unit on Studio — enable the pdf advanced module on the course, upload the PDF as a course asset, create the pdf block, and save its title and href through the block's own save_pdf handler (the generic xblock update does not persist the file field). Use when the user wants a PDF, slides, a syllabus, a reading handout or any document displayed inline in a unit. Session auth via studio.env.
metadata:
  kind: api
---

# iblai-api-studio-pdf

The `pdf` XBlock renders a PDF inline in the unit. It is an *advanced module*:
the course has to list it in `advanced_modules` before Studio will create one,
and it saves its fields through its own handler, not the generic xblock update.
Three steps: enable once per course → upload the file → create + save.

## Before you start

1. Preflight: `node .claude/skills/iblai-api-studio-auth/scripts/studio-login.mjs --check` prints two `ok`s; otherwise run **`/iblai-api-studio-auth`** first — do not attempt the calls below.
2. A unit locator (`/iblai-api-studio-unit`, or the unit list from `/iblai-api-studio-outline` — the bulk builder cannot create `pdf` blocks, so they are always added here afterwards).
3. The PDF file on disk (compressed if large).

## Auth & conventions

- **Base URL:** `$STUDIO_URL`; Studio session cookies from `studio.env` (its values are single-quoted — bash strips the quotes; any other parser must strip them too, or Studio answers 500: `/iblai-api-studio-auth`).
- **Snippet:**
  ```bash
  set -a; . ./studio.env; set +a
  S=(-s -b "studio_session_id=$STUDIO_SESSION; csrftoken=$STUDIO_CSRF" -H "X-CSRFToken: $STUDIO_CSRF" \
     -H "Origin: $STUDIO_URL" -H "Referer: $STUDIO_URL/" -H "Accept: application/json" -H "Content-Type: application/json")
  ```
- **Keys:** `COURSE` = `course-v1:…`; parent = a unit locator; the block is `…+type@pdf+block@<hex>`.
- Fields: `display_name` (title) and `href` (URL of the PDF — a course asset `/static/<file>.pdf` or an absolute `https://` URL).
- Draft until the unit is published (`/iblai-api-studio-publish`). DELETE is destructive — confirm with the user first.

## Reads

- **GET** `/settings/advanced/{COURSE}` — `{ …, "advanced_modules": { "value": ["pdf", …], … } }`; the block can be created only when `"pdf"` is in `value`.
- **GET** `/xblock/{pdf}` — `{ "display_name", "category": "pdf", "metadata": { "display_name" }, "published", "has_changes" }`. The `href` is **not** in `metadata`; read it from the studio view:
- **GET** `/xblock/{pdf}/studio_view` — `{ "html": "…<input id=\"edit_href\" … value=\"/static/syllabus.pdf\">…" }`; regex `id="edit_href"[^>]*value="([^"]*)"`.
- **GET** `/assets/{COURSE}/?asset_type=Documents&page_size=50` — uploaded PDFs (`assets[].portable_url` is the `/static/…` path to use).

## Writes

1. **Enable the module** (once per course; keeps the other entries):
   **POST** `/settings/advanced/{COURSE}` `{ "advanced_modules": { "value": ["pdf"] } }` → the full advanced-settings map with the new value. Read first and merge if `value` already lists other modules.
2. **Upload the PDF** (multipart, field `file`, no JSON content type):
   ```bash
   curl -s -b "studio_session_id=$STUDIO_SESSION; csrftoken=$STUDIO_CSRF" -H "X-CSRFToken: $STUDIO_CSRF" \
     -H "Origin: $STUDIO_URL" -H "Referer: $STUDIO_URL/" -H "Accept: application/json" \
     -X POST "$STUDIO_URL/assets/$COURSE/" -F "file=@syllabus.pdf"
   ```
   → `{ "asset": { "display_name": "syllabus.pdf", "content_type": "application/pdf", "url": "/asset-v1:…+type@asset+block@syllabus.pdf", "portable_url": "/static/syllabus.pdf", "external_url": "https://<lms>/asset-v1:…", "id": "asset-v1:…", "locked": false, … }, "msg": "Upload completed" }`. Re-uploading the same filename replaces the asset.
3. **Create the block:** **POST** `/xblock/` `{ "parent_locator": "<unit>", "category": "pdf", "display_name": "Syllabus" }` → `{ "locator": "…+type@pdf+block@<hex>", "courseKey" }`.
   `400`/`500` here usually means step 1 was skipped.
4. **Save title + file:** **POST** `/xblock/{pdf}/handler/save_pdf`
   ```json
   { "display_name": "Syllabus", "href": "/static/syllabus.pdf" }
   ```
   → `{ "result": "success" }` (or `{ "result": "error", "message": "…" }`). This is the only call that persists `href`.
- **POST** `/xblock/{pdf}` `{ "metadata": { "display_name": "New title" } }` — rename only. Sending `href` or `url` in `metadata` is silently ignored or returns `500`; never use it for the file.
- **DELETE** `/xblock/{pdf}` → `204`. Confirm with the user first.

## Example

```bash
set -a; . ./studio.env; set +a
S=(-s -b "studio_session_id=$STUDIO_SESSION; csrftoken=$STUDIO_CSRF" -H "X-CSRFToken: $STUDIO_CSRF" \
   -H "Origin: $STUDIO_URL" -H "Referer: $STUDIO_URL/" -H "Accept: application/json" -H "Content-Type: application/json")
COURSE="course-v1:acme+DATA101+2026-T1"
UNIT="block-v1:acme+DATA101+2026-T1+type@vertical+block@645f5ded5f544adab9fb603c4afc3bac"

# 1. enable (merge with existing modules)
MODS=$(curl "${S[@]}" "$STUDIO_URL/settings/advanced/$COURSE" | python3 -c '
import sys,json; v=json.load(sys.stdin)["advanced_modules"]["value"]; print(json.dumps(sorted(set(v)|{"pdf"})))')
curl "${S[@]}" -X POST "$STUDIO_URL/settings/advanced/$COURSE" -d "{\"advanced_modules\":{\"value\":$MODS}}" >/dev/null

# 2. upload (multipart: same cookies/CSRF, no JSON content type)
U=(-s -b "studio_session_id=$STUDIO_SESSION; csrftoken=$STUDIO_CSRF" -H "X-CSRFToken: $STUDIO_CSRF" \
   -H "Origin: $STUDIO_URL" -H "Referer: $STUDIO_URL/" -H "Accept: application/json")
STATIC=$(curl "${U[@]}" -X POST "$STUDIO_URL/assets/$COURSE/" -F "file=@syllabus.pdf" \
  | python3 -c 'import sys,json; print(json.load(sys.stdin)["asset"]["portable_url"])')      # /static/syllabus.pdf

# 3 + 4. create and save
PDF=$(curl "${S[@]}" -X POST "$STUDIO_URL/xblock/" -d "{\"parent_locator\":\"$UNIT\",\"category\":\"pdf\",\"display_name\":\"Syllabus\"}" \
  | python3 -c 'import sys,json; print(json.load(sys.stdin)["locator"])')
curl "${S[@]}" -X POST "$STUDIO_URL/xblock/$PDF/handler/save_pdf" -d "{\"display_name\":\"Syllabus\",\"href\":\"$STATIC\"}"
```

## Notes

- `href` accepts `/static/<name>` (course asset, portable across reruns and hosts) or an absolute URL; use assets for anything the org owns. External URLs must allow embedding (no `X-Frame-Options: DENY`).
- The viewer is an inline reader; there is no download toggle in this block's fields — link the `external_url` from an `/iblai-api-studio-html` block if users need a download link.
- Verify with `studio_view` (regex above) after saving; the generic `GET /xblock/{pdf}` will always show only `display_name`.
- The `-F` upload must not carry `Content-Type: application/json`; the example uses a second header array without it.
- Large PDFs: Studio accepts uploads up to the deployment's limit (tens of MB); compress first when in doubt.

Attribution

iblaiiblai
View sourceMore from iblai →
SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Related Skills

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

281612 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2132 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Tanstack Start

Build a full-stack TanStack Start app on Cloudflare Workers from scratch — SSR, file-based routing, server functions, D1+Drizzle, better-auth, Tailwind v4+shadcn/ui. Use whenever the user mentions TanStack Start, asks to scaffold a full-stack Cloudflare app with SSR, wants an SSR dashboard, or asks for a React 19 + Cloudflare Workers app with file-based routing and server functions — even if they don't name TanStack Start specifically. No template repo — Claude generates every file fresh per ...

9881 votes

Pentest

PTES-aligned adversarial security audit for backend, frontend, and mobile applications. Produces a CVSS-scored Hacker Report with verified PoCs and phased remediation.

5491 votes
View all in development →