## Scaffold manuscripto package under packages/ Create the manuscripto package
Scaffold manuscripto package under packages/¶
Create the manuscripto package following the biblio pattern exactly. This is a new projio subsystem for manuscript assembly and rendering.
Prerequisites¶
- Read the design spec at
docs/explanation/manuscripto-design-spec.mdfirst — it was written by a prior task and contains the architecture, schema, and API decisions. - Read
packages/biblio/structure as the reference pattern (pyproject.toml, src layout, CLAUDE.md, tests/). - Read the memory at
reference_biblio_pattern.mdfor notes on what makes biblio the reference.
Deliverables¶
-
Package structure at
packages/manuscripto/:packages/manuscripto/ ├── pyproject.toml # editable install, deps: pyyaml, pydantic ├── CLAUDE.md # agent instructions following biblio pattern ├── Makefile # test, build, clean targets ├── src/manuscripto/ │ ├── __init__.py # public API exports │ ├── schema.py # ManuscriptSpec Pydantic model │ ├── config.py # manuscript.yml loading, defaults │ ├── section.py # section ordering, notio integration helpers │ ├── assembly.py # concatenate sections → assembled markdown │ ├── render.py # pandoc invocation (PDF, LaTeX, MD) │ ├── figures.py # figio caption extraction, figure insertion │ ├── validate.py # citation checks, figure checks, completeness │ ├── cli.py # argparse CLI entry point │ └── mcp.py # MCP tool functions (called by projio wrapper) └── tests/ ├── __init__.py └── test_schema.py # basic ManuscriptSpec round-trip test -
ManuscriptSpec schema in
schema.py: - Based on the design spec
- Pydantic models: ManuscriptSpec, SectionRef, FigureBinding, RenderConfig
- YAML round-trip (from_yaml / to_yaml) like figio's FigureSpec
-
Should declare: name, sections (ordered list), bibliography path, CSL path, pdf_engine, output_dir, figure_bindings
-
pyproject.toml:
- Name: manuscripto
- Version: 0.1.0
- Entry point:
manuscripto = manuscripto.cli:main - Dependencies: pyyaml, pydantic
- Optional deps: pandoc (note: pandoc is a system dep, not pip)
-
Dev extras: pytest
-
CLAUDE.md: Follow figio's CLAUDE.md as template — architecture overview, source layout, CLI surface, MCP tool surface, build commands, agent tool routing table.
-
Stub implementations: All .py files should have proper docstrings and the public API defined (function signatures with types), but can have minimal/stub implementations. The schema and config modules should be fully functional. assembly.py and render.py can be stubs that raise NotImplementedError for now.
-
Test: test_schema.py should test ManuscriptSpec YAML round-trip.
Do NOT register as a git submodule or modify projio's pyproject.toml — that integration comes later.
Related Notes¶
- [[docs/log/task/task-arash-20260331-175313-566067.md]] — Direct prerequisite: the manuscripto design spec written by a prior task that this scaffold task explicitly depends on