.claude/skills/add-pdf-report/SKILL.md
Generate a branded Arabic PDF report from an HTML template using Puppeteer. Use for contracts, invoices, CMA reports, commission statements.
npx skillsauth add malhajri07/real-estate-CRM-project add-pdf-reportInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Creates a new PDF report template with Arabic RTL support, org branding, and data binding. Uses Puppeteer to render HTML → PDF server-side.
Check PDF engine exists. Read apps/api/libs/pdf-engine.ts. If missing, create:
import puppeteer from "puppeteer";
export async function generatePDF(html: string): Promise<Buffer> {
const browser = await puppeteer.launch({ headless: true, args: ["--no-sandbox"] });
const page = await browser.newPage();
await page.setContent(html, { waitUntil: "networkidle0" });
const pdf = await page.pdf({ format: "A4", printBackground: true });
await browser.close();
return Buffer.from(pdf);
}
Create the HTML template at apps/api/templates/{report-type}.ts:
<html dir="rtl" lang="ar">Create the API endpoint:
router.get("/documents/{type}/:entityId", authenticateToken, async (req, res) => {
// Fetch data from Prisma
// Render HTML template with data
// Generate PDF
res.setHeader("Content-Type", "application/pdf");
res.setHeader("Content-Disposition", `attachment; filename="${type}-${entityId}.pdf"`);
res.send(pdfBuffer);
});
Add frontend download button:
const handleDownload = async () => {
const blob = await apiGetBlob(`/api/documents/{type}/${entityId}`);
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url; a.download = `${type}.pdf`; a.click();
};
Install Puppeteer if not already: pnpm add puppeteer
/typecheck passes@react-pdf/renderer for complex layouts — Puppeteer handles Arabic RTL much bettertesting
Create and edit Obsidian Flavored Markdown with wikilinks, embeds, callouts, properties, and other Obsidian-specific syntax. Use when working with .md files in Obsidian, or when the user mentions wikilinks, callouts, frontmatter, tags, embeds, or Obsidian notes.
tools
Interact with Obsidian vaults using the Obsidian CLI to read, create, search, and manage notes, tasks, properties, and more. Also supports plugin and theme development with commands to reload plugins, run JavaScript, capture errors, take screenshots, and inspect the DOM. Use when the user asks to interact with their Obsidian vault, manage notes, search vault content, perform vault operations from the command line, or develop and debug Obsidian plugins and themes.
data-ai
Create and edit Obsidian Bases (.base files) with views, filters, formulas, and summaries. Use when working with .base files, creating database-like views of notes, or when the user mentions Bases, table views, card views, filters, or formulas in Obsidian.
tools
Create and edit JSON Canvas files (.canvas) with nodes, edges, groups, and connections. Use when working with .canvas files, creating visual canvases, mind maps, flowcharts, or when the user mentions Canvas files in Obsidian.