project-nighthawk: Skill for Claude Code

.github/skills/Nighthawk-PDFExport/SKILL.md

nighthawk-pdf-export is a skill for Claude Code, Codex from microsoftgbb/project-nighthawk. It costs 43 tokens per session (1,335 once invoked), scanned A, original, MIT.

A macOS export tool for turning Nighthawk Markdown reports into styled PDF files. It can handle Mermaid diagrams, which are text descriptions of diagrams.

In plain words
What is it for?
Use it to create PDFs from Nighthawk notes files, including reports with Mermaid diagrams.
Why use it?
It removes the need to format reports manually or choose and configure a PDF conversion method yourself.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

This is microsoftgbb/project-nighthawk's own configuration. It tells Claude Code and Codex how to work on project-nighthawk itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything project-nighthawk configures →

Reuse

Borrowing it

Nothing to install: this file belongs to microsoftgbb/project-nighthawk. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/microsoftgbb/project-nighthawk/main/.github/skills/Nighthawk-PDFExport/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/microsoftgbb/project-nighthawk

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for nighthawk-pdf-export

README.md
[![agentmods](https://agentmods.dev/badge/skills/microsoftgbb/project-nighthawk/nighthawk-pdfexport/github.svg)](https://agentmods.dev/skills/microsoftgbb/project-nighthawk/nighthawk-pdfexport)
Your own site
<a href="https://agentmods.dev/skills/microsoftgbb/project-nighthawk/nighthawk-pdfexport"><img src="https://agentmods.dev/badge/skills/microsoftgbb/project-nighthawk/nighthawk-pdfexport/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for nighthawk-pdf-export

Your own site · 80×15
<a href="https://agentmods.dev/skills/microsoftgbb/project-nighthawk/nighthawk-pdfexport"><img src="https://agentmods.dev/badge/skills/microsoftgbb/project-nighthawk/nighthawk-pdfexport.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,335 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00043 $0.01335
Opus 5.5 $0.00017 $0.00534
Sonnet 5.5 $0.00009 $0.00267
Haiku 4.5 $0.00004 $0.00134

Measured 2mo ago against content hash e2b893bd4bb8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

nighthawk-pdf-export scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/skills/Nighthawk-PDFExport/SKILL.md · 112 lines

How it starts

The opening of the file, as written. The whole thing — 112 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Nighthawk PDF Export

Converts a Nighthawk markdown report (notes/Nighthawk-*.md) to a styled PDF.

Tool Detection Order

Always probe before choosing an approach:

which pandoc wkhtmltopdf md-to-pdf 2>/dev/null
python3 -c "import weasyprint" 2>/dev/null && echo "weasyprint: ok" || echo "weasyprint: not installed"

Option A — pandoc (preferred, if installed)

pandoc "notes/Nighthawk-YYYY-MM-DD-topic.md" \
  -o "notes/Nighthawk-YYYY-MM-DD-topic.pdf" \
  --pdf-engine=wkhtmltopdf \
  -V geometry:margin=1in -V fontsize=11pt
# fallback engines in order: xelatex, pdflatex

Option B — Python + weasyprint (macOS fallback, supports Mermaid)

This is the verified working approach on macOS. It handles Mermaid diagrams by pre-rendering them to hi-res PNG via Puppeteer, then embedding them inline before weasyprint processes the document.

Do NOT use SVG — weasyprint renders SVG shapes but drops all text (missing font resolution). Always use PNG.

Step 1 — Install dependencies

python3 -m venv /tmp/pdf-venv
/tmp/pdf-venv/bin/pip install --quiet markdown weasyprint

Step 2 — Pre-render Mermaid diagrams to PNG

Run this for each report that contains a ```mermaid block:

# Extract the mermaid source
awk '/^```mermaid$/,/^```$/' notes/Nighthawk-YYYY-MM-DD-topic.md | sed '1d;$d' > /tmp/diagram.mmd

# Render to hi-res PNG (--width 3000 --scale 3 ensures readable text in PDF)
npx @mermaid-js/mermaid-cli -i /tmp/diagram.mmd -o /tmp/diagram.png --width 3000 --scale 3

Step 3 — Generate PDF with embedded diagram

Write the following to /tmp/build_pdf.py and run with the venv:

import pathlib, re, base64, markdown
from weasyprint import HTML

MD_IN  = "/Volumes/Extreme SSD/src/project-nighthawk/notes/Nighthawk-YYYY-MM-DD-topic.md"
PNG_IN = "/tmp/diagram.png"   # omit if no Mermaid diagram
PDF_OUT = "/Volumes/Extreme SSD/src/project-nighthawk/notes/Nighthawk-YYYY-MM-DD-topic.pdf"

CSS = """
body { font-family: Georgia, serif; font-size: 11pt; line-height: 1.6; padding: 40px; max-width: 900px; margin: auto; }
h1 { font-size: 20pt; border-bottom: 2px solid #333; padding-bottom: 8px; margin-top: 24px; }
h2 { font-size: 15pt; border-bottom: 1px solid #666; margin-top: 20px; }
h3 { font-size: 13pt; margin-top: 16px; }
code { font-family: 'Courier New', monospace; background: #f4f4f4; padding: 2px 4px; border-radius: 3px; font-size: 9pt; }
pre { background: #f4f4f4; padding: 12px; border-radius: 4px; border-left: 3px solid #666; page-break-inside: avoid; }
pre code { background: none; padding: 0; }
table { border-collapse: collapse; width: 100%; margin: 12px 0; page-break-inside: avoid; }
th { background: #333; color: white; padding: 8px; text-align: left; }
td { padding: 6px 8px; border: 1px solid #ccc; }
tr:nth-child(even) { background: #f9f9f9; }
blockquote { border-left: 4px solid #999; padding-left: 16px; color: #555; margin: 12px 0; }
a { color: #0066cc; }
img { max-width: 100%; height: auto; margin: 16px 0; }
"""

md_text = pathlib.Path(MD_IN).read_text(encoding="utf-8")

# Replace mermaid fenced block with embedded hi-res PNG
png_path = pathlib.Path(PNG_IN)
if png_path.exists():
    png_b64 = base64.b64encode(png_path.read_bytes()).decode()
    png_tag = f'<img src="data:image/png;base64,{png_b64}" alt="Diagram" />'
    md_text = re.sub(r'```mermaid\n.*?```', png_tag, md_text, flags=re.DOTALL)

body = markdown.markdown(md_text, extensions=["tables", "fenced_code", "toc"])
html = f"<!DOCTYPE html><html><head><meta charset='utf-8'><style>{CSS}</style></head><body>{body}</body></html>"
HTML(string=html).write_pdf(PDF_OUT)

size = pathlib.Path(PDF_OUT).stat().st_size
print(f"PDF written: {PDF_OUT} ({size:,} bytes / {size//1024} KB)")

Read the full file on GitHub · 112 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 112 lines · 43 tokens per session scan A e2b893bd4bb8

Subscribe to this mod's changes

nighthawk-pdf-export is a skill published in the GitHub repository microsoftgbb/project-nighthawk (33 stars, last pushed 5mo ago), licensed MIT. It adds 43 tokens to every session and 1,335 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

nighthawk-pdf-export compared with skills from other repositories

nighthawk-pdf-export next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
nighthawk-pdf-exportmicrosoftgbb/project-nighthawkSkill335mo agoMITA43Claude Code, Codex
apify-youtube-transcript-scrapersickn33/agentic-awesome-skillsSkill49kyesterdayMITA48Claude Code
foundry-hosted-agent-validationmicrosoft/agent-frameworkSkill15kyesterdayMITA82Claude Code, Codex
skill-doc-deliverynyldn/claude-octopusSkill4.4ktodayMITA29Claude Code
meta-web-to-pdf-briefingopensquilla/opensquillaSkill7.1k6d agoApache-2.0A45Claude Code, Codex
chat-complex-documentsvellum-ai/vellum-assistantSkill1.5k2d agoMITA90Claude Code, Codex
paper-readerhuangkiki/dailypaper-skillsSkill1.3k4d agoApache-2.0A135Claude Code, Codex