feat(ai): defer marimo-pair references and improve code mode prompts

Merged
LI
4mo ago
+986-650

📝 Summary

image

Code mode had no way to load deeper reference docs without bloating the system prompt. I split the reference material into deferred pydantic-ai capabilities so the model pulls in gotchas, notebook-improvements, and rich-representations only when needed.

  • Bundle three reference markdown files and expose them as deferred Capability objects wired into the code-mode agent harness
  • Update SKILL.md and reference docs to tell the model to use load_capability instead of reading files from disk
  • Streamline the code-mode system prompt: drop per-language rules and injected cell code (the model can inspect the notebook via execute_code), and add a nudge to inspect notebook state first
  • Expose code mode in the chat mode picker outside dev builds

📋 Pre-Review Checklist

  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
  • Video or media evidence is provided for any visual changes (optional).

✅ Merge Checklist

  • I have read the contributor guidelines.
  • Documentation has been updated where applicable, including docstrings for API changes.
  • Tests have been added for the changes made.

Made with Cursor