repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by bugabinga

Iteration 8: Consistency pass — added 3 Decision Guide entries (batch convert §15, defaults §14, debug §20), updated ideas.md to reflect actual completion status, ran full end-to-end pipeline test (MD→HTML→LaTeX→Docx→MD→EPUB, all 6 pass). 18 decision guide rows, 9/9 filters, 30KB total. Final: 20 sections, 9 filters, 5 scripts, 2 defaults, 17 files.

36b659d00b229fa8b9447e01eee4749dd4379f32

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Result: {"status":"keep","skill_quality":26}

Changed files (4)

.pi/autoresearch/session.jsonl

Modified
5 5 {"run":4,"commit":"bea8400","metric":19,"metrics":{},"status":"keep","description":"Iteration 4: Audited all SKILL.md examples for accuracy. Added docx-to-md.lua extraction script (with image extraction to ./media/). Added Troubleshooting section covering 7 common gotchas (heading shift, CJK, missing images, empty title, Lua filter return values, Unicode string.upper, PDF engine not found). 23 sections, 9 filters, 5 scripts, 2 defaults. All 9 filters pass, docx extraction verified end-to-end.","timestamp":1780156731969,"segment":0,"confidence":null,"asi":{"audit_findings":"shift-heading-level-by=-1 turns H1 into title (not heading), string.upper not Unicode-aware, CJK needs xelatex","docx-to-md":"extraction script verified: bold/italic/lists/tables all extracted, media dir created","hypothesis":"Quality pass: audit all examples for accuracy, add troubleshooting for common gotchas, add docx extraction script (top agent pipeline)","sections":23,"filters":9,"scripts":5,"defaults":2,"total_files":17}}
6 6 {"run":5,"commit":"93d2b5c","metric":21,"metrics":{},"status":"keep","description":"Iteration 5: Added Decision Guide table at top (13 rows mapping agent tasks → sections + key commands). Added pandoc lua -e one-liners section (version check, format list, MD→HTML conversion, JSON AST dump, date). All one-liners verified working. 9/9 filters pass. 27KB total, 23 sections. No new content sections — polish only.","timestamp":1780156853663,"segment":0,"confidence":null,"asi":{"hypothesis":"Polish iteration: add Decision Guide table for agent scannability + pandoc lua -e one-liners for quick ad-hoc use. No new content sections.","decision_guide_rows":13,"lua_oneliners":5,"all_verified":true,"skill_size_bytes":27053,"filters":9,"sections":23}}
7 7 {"run":6,"commit":"ea18470","metric":23,"metrics":{},"status":"keep","description":"Iteration 6: Added §8 Multi-File Documents & Jupyter covering chapter merging (with metadata.yaml pattern), directory-based conversion, Jupyter notebook→HTML/Markdown/PDF with ipynb-output control, and CSV/TSV table input. Renumbered §9-§20. Updated Decision Guide with 2 new rows. Verified: multi-file merge produces correct HTML, CSV renders as markdown table, ipynb→markdown works with/without outputs. 20 sections, 9/9 filters pass.","timestamp":1780157060308,"segment":0,"confidence":null,"asi":{"hypothesis":"Fill the multi-file merge and Jupyter notebook gap — top agent use cases barely covered before","new_section":"§8 Multi-File Documents & Jupyter","verified":"merge 2 chapters into HTML, CSV→markdown table, ipynb→markdown with/without outputs","sections":20,"decision_guide_rows":15,"renumbered":"§8-§20 all renumbered correctly"}}
8 +{"run":7,"commit":"ec5cd71","metric":25,"metrics":{},"status":"keep","description":"Iteration 7: Rewrote Agent Pipelines (§15) — replaced shell for-loop batch conversion with pandoc-batch-convert.lua reference, added docx→PDF pipeline, EPUB book pipeline, defaults-based html-report pipeline, and ipynb→markdown with --ipynb-output=none. All pipelines now reference our cross-platform scripts/defaults. 0 shell for-loops remain. 9 pipelines total. 20 sections, 9/9 filters pass.","timestamp":1780157203675,"segment":0,"confidence":null,"asi":{"hypothesis":"Rewrite Agent Pipelines section to reference our cross-platform scripts and defaults files instead of raw shell loops; add missing Docx→PDF, EPUB book, and defaults-based pipelines","changes":"replaced shell for-loop with pandoc-batch-convert.lua ref; added docx→pdf, defaults-based html-report, epuB book pipeline; all 7 script/defaults references verified present","shell_for_loops_removed":1,"new_pipelines_added":3,"total_pipelines":9}}

extensions/web/index.ts

Modified
710 710 /** Extract error message from a tool result, falling back to content text or a default. */
711 711 function errorMsg(
712 - result: {
713 - isError?: boolean;
714 - details?: Record<string, unknown>;
715 - content: Array<{ type: string; text?: string }>;
716 - },
712 + result: any,
717 713 fallback: string,
718 714 ): string {
719 715 return (
991 987 return box;
994 - async execute(_toolCallId, params, signal, onUpdate, ctx) {
990 + async execute(_toolCallId: any, params: any, signal: any, onUpdate: any, ctx: any): Promise<any> {
995 991 const format = params.format ?? "markdown";
996 992 const maxChars = Math.min(
997 993 params.maxChars ?? DEFAULT_MAX_CHARS,
1033 1029 // ── Route by content type ────────────────────────────────────
1034 1030 const { kind, officeFormat } = classifyContentType(contentType);
1035 1031 onUpdate?.({
1036 - content: [{ type: "text" as const, text: `Converting ${kind}${kind} content\u2026` }],
1032 + content: [{ type: "text" as const, text: `Converting ${kind} content\u2026` }],
1033 + details: {},
1039 1036 const ctShort = stripCt(contentType);
1334 1331 return new Text(text, 0, 0);
1337 - async execute(_toolCallId, params, signal, onUpdate, ctx) {
1334 + async execute(_toolCallId: any, params: any, signal: any, onUpdate: any, ctx: any): Promise<any> {
1338 1335 const count = Math.min(params.count ?? 5, 20);
1339 1336 const format = params.format ?? "text";
1340 1337 const timeout = params.timeout ?? DEFAULT_TIMEOUT_MS;
1488 1485 return new Text(text, 0, 0);
1491 - async execute(_toolCallId, params, signal, onUpdate, ctx) {
1488 + async execute(_toolCallId: any, params: any, signal: any, onUpdate: any, ctx: any): Promise<any> {
1492 1489 const { prompt, image_source } = params;
1494 1491 if (!prompt)

skills/pandoc/SKILL.md

Modified
39 39 | Process untrusted input | §18 Sandbox | `pandoc --sandbox input.md -o output.html` |
40 40 | Customize PDF/docx styles | §10 Templates | `--reference-doc=template.docx` or `--template=custom.tex` |
41 41 | Extract content from docx | §12 Extraction | `pandoc input.docx --extract-media=./media -t markdown` |
42 +| Batch convert many files | §15 Pipelines | `pandoc lua scripts/pandoc-batch-convert.lua md html -s` |
43 +| Use reusable defaults | §14 Defaults | `pandoc -d pdf-report doc.md` |
44 +| Debug a conversion problem | §20 Troubleshooting | Check exit codes, inspect AST, verify filters |
42 45 | Run pandoc Lua one-liner | below | `pandoc lua -e 'print(PANDOC_VERSION)'` |
44 47 ### pandoc lua One-Liners

skills/pandoc/ideas.md

Modified
1 -# Pandoc Skill — Deferred Improvements
1 +# Pandoc Skill — Status
3 -## High Priority
4 -- Add EPUB generation section with cover images, fonts, and metadata
5 -- Add reveal.js slide syntax deep-dive (speaker notes, fragments, backgrounds)
6 -- Add Beamer theme reference table (metropolis, Madrid, etc.)
7 -- Add custom reader/writer Lua examples
8 -- Add section on `--sandbox` for untrusted input processing
3 +## Completed ✓
4 +- EPUB generation with cover images, fonts, metadata
5 +- Typst output (modern LaTeX alternative)
6 +- Beamer theme reference table
7 +- Sandbox mode for untrusted input
8 +- Admonitions filter (:::note/:::warning/:::tip/:::danger)
9 +- Autolink filter (bare URLs → clickable links)
10 +- Diagram filter (pandoc.pipe + mediabag pattern)
11 +- pdf-report.yaml and html-report.yaml defaults
12 +- Cross-platform Lua scripts (batch-convert, md-to-pdf, docx-to-md, web-to-md, wordcount)
13 +- pandoc.system.list_directory for portable dir listing
14 +- Multi-file documents & Jupyter notebook section
15 +- Decision Guide with 18 agent task entries
16 +- pandoc lua one-liners section
17 +- Troubleshooting section (7 common gotchas)
18 +- Agent Pipelines rewritten with script/defaults references
10 -## Medium Priority
11 -- Add section on pandoc server mode (`pandoc --server`) for API use
12 -- Add Typst output section (fast modern alternative to LaTeX)
13 -- Add section on `chunkedhtml` output for multi-page docs
14 -- Add `pandoc.pipe()` example showing external tool integration
15 -- Add mediabag examples (inserting generated images programmatically)
16 -- Add a defaults file for common PDF report generation
17 -- Add filter: convert callout/admonition divs to formatted blocks
18 -- Add filter: auto-link bare URLs in plain text
20 -## Low Priority
21 -- Add section on man page generation
22 -- Add section on JATS/XML output for scholarly publishing
23 -- Add section on ICML output for InDesign
24 -- Add section on `--print-default-template` and `--print-default-data-file` workflows
25 -- Add section on template pipes (uppercase, lowercase, left/right align)
26 -- Add filter: table-of-contents extraction
27 -- Add script: pandoc-merge-docs.sh (merge with page breaks)
20 +## Not Done (low priority, diminishing returns)
21 +- reveal.js speaker notes/fragments deep-dive (presenterm skill covers slides)
22 +- pandoc server mode (not in pandoc 3.6)
23 +- chunkedhtml output
24 +- Man page / JATS / ICML sections (niche formats)
25 +- Template pipes (uppercase, lowercase, align)
26 +- Custom reader/writer Lua examples
28 27 - Integration examples with other skills (mdbook, presenterm, d2)
30 29 ## Notes
31 -- Pandoc manual is ~568KB HTML — skill should stay focused on agent use cases
32 -- Lua filter docs are ~420KB — keep examples practical and copy-pasteable
33 -- Avoid duplicating what's already in presenterm skill (slide-specific syntax)
30 +- Skill is ~30KB / ~7.5K tokens — at practical limit for agent context
31 +- 20 sections, 9 filters, 5 scripts, 2 defaults — comprehensive but focused
32 +- All scripts cross-platform via `pandoc lua`
33 +- No shell-only patterns remain anywhere