## Prompt Add master document support — master_build MCP tool for dual-marker p
Prompt¶
Add master document support — master_build MCP tool for dual-marker plan/spec documents that need web+print output.
Context¶
Manuscripts use concatenation (no Lua filter needed). But non-manuscript ordered documents like plan/master.md and explanation/infra/pipeline-spec/master.md use the dual-marker pattern:
[[plan/overview]]
{% include-markdown "plan/overview.md" %}
Where to put it¶
Option A: notio.manuscript.master — a sibling module within the manuscript subpackage
Option B: projio.master — projio-level since it's about orchestrating the Lua filter + pandoc
Prefer Option A since it reuses notio's MCP server and shares the render config machinery. The master module is thin — it doesn't manage sections (those are hand-ordered in master.md), it just invokes pandoc with the Lua filter.
Deliverables¶
1. packages/notio/src/notio/manuscript/master.py¶
Functions:
- find_master_files(root: Path) -> list[dict] — scan for docs/*/master.md files, return name + path + section count
- build_master(root: Path, name: str, format: str, render_config: dict | None) -> Path — invoke pandoc on docs/<name>/master.md with Lua filter + citeproc. Uses .projio/render.yml for defaults.
- generate_master_md(sections: list[dict], name: str) -> str — generate a dual-marker master.md from a section list (for scaffolding)
The pandoc command for master docs:
pandoc docs/<name>/master.md \
--lua-filter=.projio/filters/include.lua \
--citeproc --bibliography=<bib> --csl=<csl> \
--pdf-engine=<engine> \
-o _build/pdf/<name>-master.pdf
2. MCP tools¶
Add to notio's MCP server and projio's wrapper (src/projio/mcp/manuscripto.py):
master_list()— list all master documents (scan fordocs/*/master.md)master_build(name, format?)— build a master document to PDF/LaTeX/MDmaster_generate(name, sections)— generate/regenerate master.md with dual markers from section list
3. Export from notio.manuscript.__init__¶
Add find_master_files, build_master, generate_master_md to exports.
4. CLI¶
Add to the existing notio manuscript subcommand:
- notio manuscript master-list — list master documents
- notio manuscript master-build <name> [--format pdf] — build a master doc
Notes¶
- Master documents are NOT managed by ManuscriptSpec — they have their own master.md with hand-ordered dual markers
- The Lua filter must be at
.projio/filters/include.lua(shipped by the prior task) - Master docs use the same render.yml config as manuscripts for engine/csl/bib
- The key difference: master docs use transclusion (Lua filter), manuscripts use concatenation
- Don't touch existing master.md files in pixecog — this just provides the tooling
Related Notes¶
- task-arash-20260331-175703-656609.md — Implements manuscript subpackage in notio — master.py would be a sibling module in the same package
- task-arash-20260331-175617-644481.md — Design spec for manuscript as notio subpackage — architectural context for where master module lives
- task-arash-20260331-175313-566067.md — manuscripto architecture and API surface — render config machinery that master_build reuses
- task-arash-20260331-175739-980549.md — Registers manuscript MCP tools in notio and projio — master_build MCP tool registration follows same pattern
- task-arash-20260331-175508-399347.md — Registers manuscripto in projio as optional dependency — master module needs same registration
Batch Result¶
- status: done
- batch queue_id:
d4b9b2177a02 - session:
29223ba5-627f-47d9-b1cc-78330eb97d21 - batch duration: 691.0s