[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-qwibitai-nanoclaw-.claude-skills-add-pdf-reader":3},{"error":4,"detail":5,"metadata":24,"markdownContent":25,"rawMarkdown":21},false,{"repo_full_name":6,"owner":7,"repo_name":8,"repo_forks":9,"skill_path":10,"repo_stars":11,"name":12,"category_id":13,"description":14,"file_tree":15,"skill_md_content":21,"skill_id":22,"skill_key":23},"qwibitai/nanoclaw","qwibitai","nanoclaw",7105,".claude/skills/add-pdf-reader",24374,"add-pdf-reader",1,"Add PDF reading to NanoClaw agents. Extracts text from PDFs via pdftotext CLI. Handles WhatsApp attachments, URLs, and local files.",[16],{"name":17,"path":18,"size":19,"type":20},"SKILL.md",".claude/skills/add-pdf-reader/SKILL.md",2761,"file","---\nname: add-pdf-reader\ndescription: Add PDF reading to NanoClaw agents. Extracts text from PDFs via pdftotext CLI. Handles WhatsApp attachments, URLs, and local files.\n---\n\n# Add PDF Reader\n\nAdds PDF reading capability to all container agents using poppler-utils (pdftotext/pdfinfo). PDFs sent as WhatsApp attachments are auto-downloaded to the group workspace.\n\n## Phase 1: Pre-flight\n\n1. Check if `container/skills/pdf-reader/pdf-reader` exists — skip to Phase 3 if already applied\n2. Confirm WhatsApp is installed first (`skill/whatsapp` merged). This skill modifies WhatsApp channel files.\n\n## Phase 2: Apply Code Changes\n\n### Ensure WhatsApp fork remote\n\n```bash\ngit remote -v\n```\n\nIf `whatsapp` is missing, add it:\n\n```bash\ngit remote add whatsapp https://github.com/qwibitai/nanoclaw-whatsapp.git\n```\n\n### Merge the skill branch\n\n```bash\ngit fetch whatsapp skill/pdf-reader\ngit merge whatsapp/skill/pdf-reader || {\n  git checkout --theirs package-lock.json\n  git add package-lock.json\n  git merge --continue\n}\n```\n\nThis merges in:\n- `container/skills/pdf-reader/SKILL.md` (agent-facing documentation)\n- `container/skills/pdf-reader/pdf-reader` (CLI script)\n- `poppler-utils` in `container/Dockerfile`\n- PDF attachment download in `src/channels/whatsapp.ts`\n- PDF tests in `src/channels/whatsapp.test.ts`\n\nIf the merge reports conflicts, resolve them by reading the conflicted files and understanding the intent of both sides.\n\n### Validate\n\n```bash\nnpm run build\nnpx vitest run src/channels/whatsapp.test.ts\n```\n\n### Rebuild container\n\n```bash\n./container/build.sh\n```\n\n### Restart service\n\n```bash\nlaunchctl kickstart -k gui/$(id -u)/com.nanoclaw  # macOS\n# Linux: systemctl --user restart nanoclaw\n```\n\n## Phase 3: Verify\n\n### Test PDF extraction\n\nSend a PDF file in any registered WhatsApp chat. The agent should:\n1. Download the PDF to `attachments/`\n2. Respond acknowledging the PDF\n3. Be able to extract text when asked\n\n### Test URL fetching\n\nAsk the agent to read a PDF from a URL. It should use `pdf-reader fetch \u003Curl>`.\n\n### Check logs if needed\n\n```bash\ntail -f logs/nanoclaw.log | grep -i pdf\n```\n\nLook for:\n- `Downloaded PDF attachment` — successful download\n- `Failed to download PDF attachment` — media download issue\n\n## Troubleshooting\n\n### Agent says pdf-reader command not found\n\nContainer needs rebuilding. Run `./container/build.sh` and restart the service.\n\n### PDF text extraction is empty\n\nThe PDF may be scanned (image-based). pdftotext only handles text-based PDFs. Consider using the agent-browser to open the PDF visually instead.\n\n### WhatsApp PDF not detected\n\nVerify the message has `documentMessage` with `mimetype: application/pdf`. Some file-sharing apps send PDFs as generic files without the correct mimetype.\n","34484e6b-c933-5870-b168-5210d27ba17a","qwibitai-nanoclaw-.claude-skills-add-pdf-reader",{"name":12,"description":14},"\u003Ch1>Add PDF Reader\u003C/h1>\n\u003Cp>Adds PDF reading capability to all container agents using poppler-utils (pdftotext/pdfinfo). PDFs sent as WhatsApp attachments are auto-downloaded to the group workspace.\u003C/p>\n\u003Ch2>Phase 1: Pre-flight\u003C/h2>\n\u003Col>\n\u003Cli>Check if \u003Ccode>container/skills/pdf-reader/pdf-reader\u003C/code> exists — skip to Phase 3 if already applied\u003C/li>\n\u003Cli>Confirm WhatsApp is installed first (\u003Ccode>skill/whatsapp\u003C/code> merged). This skill modifies WhatsApp channel files.\u003C/li>\n\u003C/ol>\n\u003Ch2>Phase 2: Apply Code Changes\u003C/h2>\n\u003Ch3>Ensure WhatsApp fork remote\u003C/h3>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">bash\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-bash\">git remote -v\u003C/code>\u003C/pre>\u003C/div>\u003Cp>If \u003Ccode>whatsapp\u003C/code> is missing, add it:\u003C/p>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">bash\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-bash\">git remote add whatsapp https://github.com/qwibitai/nanoclaw-whatsapp.git\u003C/code>\u003C/pre>\u003C/div>\u003Ch3>Merge the skill branch\u003C/h3>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">bash\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-bash\">git fetch whatsapp skill/pdf-reader\ngit merge whatsapp/skill/pdf-reader || {\n  git checkout --theirs package-lock.json\n  git add package-lock.json\n  git merge --\u003Cspan class=\"hljs-built_in\">continue\u003C/span>\n}\u003C/code>\u003C/pre>\u003C/div>\u003Cp>This merges in:\u003C/p>\n\u003Cul>\n\u003Cli>\u003Ccode>container/skills/pdf-reader/SKILL.md\u003C/code> (agent-facing documentation)\u003C/li>\n\u003Cli>\u003Ccode>container/skills/pdf-reader/pdf-reader\u003C/code> (CLI script)\u003C/li>\n\u003Cli>\u003Ccode>poppler-utils\u003C/code> in \u003Ccode>container/Dockerfile\u003C/code>\u003C/li>\n\u003Cli>PDF attachment download in \u003Ccode>src/channels/whatsapp.ts\u003C/code>\u003C/li>\n\u003Cli>PDF tests in \u003Ccode>src/channels/whatsapp.test.ts\u003C/code>\u003C/li>\n\u003C/ul>\n\u003Cp>If the merge reports conflicts, resolve them by reading the conflicted files and understanding the intent of both sides.\u003C/p>\n\u003Ch3>Validate\u003C/h3>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">bash\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-bash\">npm run build\nnpx vitest run src/channels/whatsapp.test.ts\u003C/code>\u003C/pre>\u003C/div>\u003Ch3>Rebuild container\u003C/h3>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">bash\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-bash\">./container/build.sh\u003C/code>\u003C/pre>\u003C/div>\u003Ch3>Restart service\u003C/h3>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">bash\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-bash\">launchctl kickstart -k gui/$(\u003Cspan class=\"hljs-built_in\">id\u003C/span> -u)/com.nanoclaw  \u003Cspan class=\"hljs-comment\"># macOS\u003C/span>\n\u003Cspan class=\"hljs-comment\"># Linux: systemctl --user restart nanoclaw\u003C/span>\u003C/code>\u003C/pre>\u003C/div>\u003Ch2>Phase 3: Verify\u003C/h2>\n\u003Ch3>Test PDF extraction\u003C/h3>\n\u003Cp>Send a PDF file in any registered WhatsApp chat. The agent should:\u003C/p>\n\u003Col>\n\u003Cli>Download the PDF to \u003Ccode>attachments/\u003C/code>\u003C/li>\n\u003Cli>Respond acknowledging the PDF\u003C/li>\n\u003Cli>Be able to extract text when asked\u003C/li>\n\u003C/ol>\n\u003Ch3>Test URL fetching\u003C/h3>\n\u003Cp>Ask the agent to read a PDF from a URL. It should use \u003Ccode>pdf-reader fetch &lt;url&gt;\u003C/code>.\u003C/p>\n\u003Ch3>Check logs if needed\u003C/h3>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">bash\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-bash\">\u003Cspan class=\"hljs-built_in\">tail\u003C/span> -f logs/nanoclaw.log | grep -i pdf\u003C/code>\u003C/pre>\u003C/div>\u003Cp>Look for:\u003C/p>\n\u003Cul>\n\u003Cli>\u003Ccode>Downloaded PDF attachment\u003C/code> — successful download\u003C/li>\n\u003Cli>\u003Ccode>Failed to download PDF attachment\u003C/code> — media download issue\u003C/li>\n\u003C/ul>\n\u003Ch2>Troubleshooting\u003C/h2>\n\u003Ch3>Agent says pdf-reader command not found\u003C/h3>\n\u003Cp>Container needs rebuilding. Run \u003Ccode>./container/build.sh\u003C/code> and restart the service.\u003C/p>\n\u003Ch3>PDF text extraction is empty\u003C/h3>\n\u003Cp>The PDF may be scanned (image-based). pdftotext only handles text-based PDFs. Consider using the agent-browser to open the PDF visually instead.\u003C/p>\n\u003Ch3>WhatsApp PDF not detected\u003C/h3>\n\u003Cp>Verify the message has \u003Ccode>documentMessage\u003C/code> with \u003Ccode>mimetype: application/pdf\u003C/code>. Some file-sharing apps send PDFs as generic files without the correct mimetype.\u003C/p>\n"]