| 264 | } |
| 265 | |
| 266 | function getFixAndDocumentPrompt(args: Record<string, string> | undefined): GetPromptResult { |
| 267 | const notebookPath = args?.notebook_path || 'notebook.deepnote' |
| 268 | |
| 269 | return { |
| 270 | description: 'Workflow for fixing and documenting a notebook', |
| 271 | messages: [ |
| 272 | { |
| 273 | role: 'user', |
| 274 | content: { |
| 275 | type: 'text', |
| 276 | text: `Fix issues and add documentation to: ${notebookPath} |
| 277 | |
| 278 | Follow this workflow: |
| 279 | |
| 280 | 1. **Check for issues**: |
| 281 | Use ${TOOL_NAMES.read} with include: ["lint", "dag"] to identify: |
| 282 | - Undefined variables |
| 283 | - Missing imports |
| 284 | - Circular dependencies |
| 285 | |
| 286 | 2. **Inspect and fix affected blocks**: |
| 287 | Use ${TOOL_NAMES.cat} path: "${notebookPath}" blockId: "<failed-or-flagged-block-id>" |
| 288 | Then use ${TOOL_NAMES.editBlock} to apply fixes. |
| 289 | |
| 290 | 3. **Add documentation and structure**: |
| 291 | Use ${TOOL_NAMES.addBlock} to add: |
| 292 | - Markdown explanations before code blocks |
| 293 | - Section headers to organize the notebook |
| 294 | |
| 295 | 4. **Re-run and verify**: |
| 296 | Use ${TOOL_NAMES.run} and inspect results with ${TOOL_NAMES.snapshotLoad}. |
| 297 | Use ${TOOL_NAMES.snapshotList} to review output history between runs.`, |
| 298 | }, |
| 299 | }, |
| 300 | ], |
| 301 | } |
| 302 | } |
| 303 | |
| 304 | function getBlockTypesReferencePrompt(): GetPromptResult { |
| 305 | return { |