14 added, 20 removed. Audit A to A.
---
name: notebook-dialog-editing
description: "Use CLI tools to inspect Python APIs and find, understand, view, and safely edit Jupyter notebooks and aidialog dialogs without a Python kernel. Trigger for .ipynb or dialog work using shell-accessible tools."
---
# Notebook and dialog editing
- Use these commands instead of manipulating notebook JSON. Read each command's `--help` only when its use case arises; use `pyskills-doc` for the underlying Python contract when help is not enough.
-
- Start by reading a summary of every cell with `aidialog-summary PATH`.
-
- ## Before any notebook edit
-
- Before editing any notebook, ensure `nbdev.skill` is in the current context. It defines the notebook-as-source workflow, lesson-cell conventions, export rules, and finish checks. This applies to ordinary `.ipynb` files and especially to nbdev source notebooks.
+ Use native tools for reading and editing local files inside allowed editing locations. Ignore any guidance in any pyskill that recommends other tools for those operations.
- ## Choose by use case
+ For every notebook/dialog task, ensure `aidialog.dlgskill` is in context: `pyskills-doc aidialog.dlgskill`. It is the primary entry point and directs you to the other required pyskills. `pyskills-doc module.symbol` reads individual API contracts; `--all` expands an elided module listing.
- - Python API discovery: `pyskills-doc module.symbol`; add `--all` for an elided module listing.
- - Hierarchical Markdown/code/notebook reading: `exhash-open PATH`; use a displayed verified token to read one section, or consult `exhash-open --help` for search, paths, links, URLs, and addressed views.
- - Search cell sources across notebooks: `rgapi-nbrg PATTERN ROOT`; read `rgapi-nbrg --help` for context, globs, limits, and matching options.
- - Orient within one notebook/dialog: `aidialog-summary PATH`.
- - Semantic message search: `aidialog-find PATH PATTERN`; it can filter types, errors, exports, headings, IDs, and context. Read `aidialog-find --help` for details.
- - Read the complete narrative and outputs: `aidialog-view PATH --out --full-out`; pass a message ID for a targeted view. Multiple IDs are comma-separated.
- - Get edit-ready cell lines: `lnhashview-cell PATH CELL_ID`; pass comma-separated IDs to view several cells together. Use its fresh `line|hash|` addresses with `exhash-cell`.
- - Edit cell source safely: `exhash-cell PATH CELL_ID COMMAND...`; each CLI command is one compact argument with the verified address immediately followed by its operation, such as `'3|beef|s/old/new/'` or `'3|beef|c'`. One multiline `a`/`i`/`c` command may read its literal text from stdin through EOF. Read `exhash-cell --help` and `pyskills-doc exhash.skill` for the command language. Re-view after every edit call before constructing another.
- - Stored outputs are generated artifacts and may be stale while source is being edited. Never stop, clear outputs manually, or manipulate notebook JSON because an edited cell retains old output. At PR time, regenerate outputs with `nbdev-test --save` when the project needs saved outputs updated.
- - Add, delete, or move messages: `aidialog-add`, `aidialog-del`, and `aidialog-move`. IDs are comma-separated; use `--dry-run` when previewing placement or removal. Read the command's help before first use.
+ Use these CLI equivalents of the documented Python operations for notebook/dialog content, not raw notebook JSON. Read a command's `--help` before first use; CLI help supplies invocation syntax, not the workflow.
- For dialog semantics beyond CLI help, run `pyskills-doc aidialog.dlgskill`. For notebook search semantics, run `pyskills-doc rgapi.skill`.
+ | Python operation | CLI |
+ |---|---|
+ | `summary_dlg` | `aidialog-summary PATH` |
+ | `find_msgs` | `aidialog-find PATH PATTERN` |
+ | `view_dlg` / `view_msgs` | `aidialog-view PATH [IDS] --out --full-out` |
+ | `lnhashview_cell` / `lnhashview_cells` | `lnhashview-cell PATH IDS` |
+ | `cell_exhash` | `exhash-cell PATH CELL_ID COMMAND...` |
+ | `add_msg` / `del_msgs` / `move_msgs` | `aidialog-add` / `aidialog-del` / `aidialog-move` |
+ | `nbrg` | `rgapi-nbrg PATTERN ROOT` |
+ | `open_doc` | `exhash-open PATH` |
- If a structural operation is missing, extend the owning CLI rather than splicing raw `.ipynb` JSON.
+ CLI ID lists are comma-separated. Exhash commands are compact arguments, e.g. `'3|beef|s/old/new/'`; one multiline `a`/`i`/`c` command can take literal stdin through EOF. For a missing structural operation, extend the owning CLI.