1
2
3
4
5
6
7
8
9
|
{
"name": "module-editing-workflow",
"description": "Step-by-step procedure for editing a WebX11 module: view → edit → test → keep or reload.",
"tags": [],
"category": "general",
"created": "2026-06-08T20:27:43.109Z",
"updated": "2026-06-08T20:27:43.109Z",
"content": "---\nname: module-editing-workflow\ndescription: Edit a WebX11 module safely — view source, edit in /_mods/, test live, reload if broken.\ncategory: dev\ntags: modules,editing,workflow,dev\n---\n\n# Module Editing Workflow\n\n## When to use\nUser asks to modify, fix, or improve a WebX11 module's behavior.\n\n## Steps\n\n1. **Get current state**\n - Call `get_module_status()` to see what's loaded, modified, and where source lives.\n\n2. **Read the source**\n - Call `view_module(name)` to read the current source of the target module.\n - Identify the exact section/function the user wants changed.\n\n3. **Open the editor**\n - Call `edit_module(name)` — this copies the module into `/<name>/index.js` (or similar) and opens an editor.\n - **CONFIRM WITH USER FIRST** — this is destructive and overwrites their local copy.\n\n4. **Make the change**\n - Edit only what was requested. Don't refactor surrounding code.\n - Preserve the module's public API (class name, exported methods) unless told otherwise.\n\n5. **Test live**\n - Call `test_module(name)` to load the edited version from `/_mods/`.\n - If the test errors: call `reload_module(name)` to discard edits and restore the original.\n - If the test works: tell the user it's live. They can keep it or reload.\n\n6. **Document the change**\n - After a successful edit, consider `create_skill` if the change is a reusable pattern.\n\n## Anti-loop notes\n- Never call `view_module` on a module you don't intend to edit.\n- Never call `test_module` twice in a row without a change in between.\n- If `edit_module` says \"no changes detected\" — stop, don't re-call.\n\n## Rollback\n- `reload_module(name)` — always works, restores the original from the source URL.\n- `list_modified_modules()` — see what's currently in a modified state.\n"
}
|