No description
- Python 97.6%
- Shell 2.4%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Add the standard License section with the SPDX identifier to match the sibling forge plugins. Drop the _wiki/ and .a0proj/ rows from the README directory table (untracked local-only paths absent from a fresh clone) and state that the plugin ships no WebUI assets. Complete the AGENTS.md project structure inventory with LICENSE and README.md. |
||
| helpers | ||
| prompts | ||
| tests | ||
| tools | ||
| .gitignore | ||
| AGENTS.md | ||
| default_config.yaml | ||
| deploy.sh | ||
| hooks.py | ||
| LICENSE | ||
| plugin.yaml | ||
| README.md | ||
MD Editor
Section-based Markdown editor plugin for Agent Zero. Parses Markdown by heading hierarchy and provides atomic section editing with uniqueness validation, backup, and GFM checkbox support.
Quick Start
# Deploy the plugin to Agent Zero
bash deploy.sh deploy
# Run the test suite
python -m pytest tests/test_md_editor.py -v
# Build a distributable ZIP
bash deploy.sh zip
Requires Agent Zero framework and Python 3.12+. No external dependencies beyond the standard library.
Section editing
{"tool_name": "md_editor:replace", "tool_args": {"path": "/path/to/file.md", "heading": "Section A", "content": "New content"}}
Checkbox operations
{"tool_name": "md_editor:check", "tool_args": {"path": "/path/to/todo.md", "label": "Buy groceries"}}
{"tool_name": "md_editor:uncheck", "tool_args": {"path": "/path/to/todo.md", "label": "Send email", "heading": "Work"}}
{"tool_name": "md_editor:list_checkboxes", "tool_args": {"path": "/path/to/todo.md", "heading": "Shopping", "include_children": true}}
Key Directories
| Directory | Purpose |
|---|---|
helpers/ |
Core parsing and editing logic |
tools/ |
Agent Zero tool class (MdEditor) |
prompts/ |
Tool prompt documentation injected into agent context |
tests/ |
Pytest test suite (178 tests) |
Key Files
plugin.yaml- Plugin manifest (name, version, settings sections)helpers/md_editor_core.py- Core parsing engine:parse_sections,edit_section,set_checkbox,atomic_write, and CLI entry pointtools/md_editor.py- Agent Zero tool class routing all operations through the Python APIhooks.py- Lifecycle hooks:install,uninstall,pre_updatewith module cache clearingprompts/agent.system.tool.md_editor.md- Tool prompt injected into agent system contextdefault_config.yaml- Default configuration (no settings currently configurable)LICENSE- MIT licensedeploy.sh- Deployment script:deploy,zip,validate,cleantests/test_md_editor.py- Pytest suite with 178 tests covering parsing, editing, checkboxes, CLI, and file I/OAGENTS.md- Engineering contracts and development guidelines
Tech Stack
Python 3.12+ | Agent Zero Framework | pytest | rsync
Notes
- All edits use atomic writes via
tempfile.mkstemp+os.replace()with.bakbackup by default. - Headings inside fenced code blocks are ignored during parsing.
- Setext-style headings (
===/---underlines) are detected and warned about but not parsed. - Delete always includes child sections regardless of the
include_childrenparameter. - Content is passed as a string directly through the Python API — no shell escaping issues with backticks, quotes, or emojis.
- The plugin ships no WebUI assets; after deploying Python code changes, an Agent Zero process restart is required due to
sys.modulescaching.
Operations
| Operation | Description |
|---|---|
replace |
Replace section content (optionally rename heading) |
append |
Append text to section end |
prepend |
Insert text after heading line |
delete |
Remove entire section (always includes children) |
list |
List all headings with line numbers |
validate |
Check for ambiguous (duplicate) headings |
read |
Read section or entire file with line numbers |
write |
Write content to file (create or overwrite) |
check |
Check a checkbox by label text (case-insensitive) |
uncheck |
Uncheck a checkbox by label text (case-insensitive) |
list_checkboxes |
List all checkboxes with status and line numbers |
- See AGENTS.md for detailed guidance for AI coding agents.
License
MIT License. See LICENSE for details.
SPDX-License-Identifier: MIT