Skip to content

## 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.md first — 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.md for notes on what makes biblio the reference.

Deliverables

  1. 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
    

  2. ManuscriptSpec schema in schema.py:

  3. Based on the design spec
  4. Pydantic models: ManuscriptSpec, SectionRef, FigureBinding, RenderConfig
  5. YAML round-trip (from_yaml / to_yaml) like figio's FigureSpec
  6. Should declare: name, sections (ordered list), bibliography path, CSL path, pdf_engine, output_dir, figure_bindings

  7. pyproject.toml:

  8. Name: manuscripto
  9. Version: 0.1.0
  10. Entry point: manuscripto = manuscripto.cli:main
  11. Dependencies: pyyaml, pydantic
  12. Optional deps: pandoc (note: pandoc is a system dep, not pip)
  13. Dev extras: pytest

  14. CLAUDE.md: Follow figio's CLAUDE.md as template — architecture overview, source layout, CLI surface, MCP tool surface, build commands, agent tool routing table.

  15. 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.

  16. 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.

  • [[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