## Prompt Implement P2 manuscript agentic tools: `manuscript_diff` and `manuscr
Prompt¶
Implement P2 manuscript agentic tools: manuscript_diff and manuscript_cite_suggest.
Prerequisites¶
- Read the updated spec at
docs/specs/notio/manuscript.md— the "Agentic Tools" section documents the P2 tool contracts. - Read
src/projio/mcp/manuscripto.pyfor existing P0/P1 tool patterns.
Phase 1: Update spec¶
Before implementation, update the P2 section in docs/specs/notio/manuscript.md with detailed parameter/return schemas (matching the P0/P1 format already there).
Phase 2: Implement¶
manuscript_diff(name)¶
- Load ManuscriptSpec, call
assemble()to get current assembled text - Read
_build/assembled.md(last build output) if it exists - Compare: sections changed, word count delta, new/removed citations
- Use difflib or simple line comparison — no external deps
- Return:
{sections_changed: [...], word_count_before, word_count_after, word_count_delta, citations_added: [...], citations_removed: [...]}
manuscript_cite_suggest(name, section, claim?)¶
- Load section content (or use claim text if provided)
- Call
rag_queryagainst biblio corpus with section/claim text - Filter results to bibliography-related hits
- For each hit, extract citekey if available
- Return:
{suggestions: [{citekey, relevance_score, snippet, source}]}
Phase 3: Register and document¶
- Register both tools in
src/projio/mcp/server.py - Update CLAUDE.md MCP tool list for manuscripto.py
Notes¶
- All tools go in
src/projio/mcp/manuscripto.py— NOT in notio directly - Follow the existing
_find_manuscript_dir+_manuscript_availableguard pattern - Degrade gracefully when RAG/biblio unavailable
Related Notes¶
- task-arash-20260331-175739-980549.md — Directly precedes this task: registers manuscript MCP tools in notio and projio — same module, same registration pattern being extended with P2 tools
- task-arash-20260331-175439-058148.md — Implements manuscripto core assembly and render — manuscript_diff calls assemble() and reads _build/assembled.md, making this the direct dependency
- task-arash-20260331-175313-566067.md — manuscripto design spec covering architecture and API surface — P2 tools extend this spec
- task-arash-20260331-175508-399347.md — Registers manuscripto in projio MCP server — same registration step required for manuscript_diff and manuscript_cite_suggest
- task-arash-20260402-221349-409107.md — Update MCP tools and CLAUDE.md — same housekeeping tasks required by this implementation (Phase 3: register + document)