Automated technical review of DOCX book chapters using Databricks Foundation Model API. Generates review comments and adds them as proper MS Word comments.
- 🔍 Auto-discovers skills from
.agent/skills/directory - 💬 Real Word comments (not inline text) - visible in Review pane
- 📝 Editable CSV output - review and filter before applying
- 📊 Batch processing with progress logging
- Python 3.10+
- Databricks workspace with Foundation Model API access
- API token with serving endpoint permissions
Skills are managed as git submodules and auto-update on every pull:
# First-time setup: initialize and fetch all skills
git submodule update --init --recursiveTo refresh skills to the latest version at any time:
git submodule update --remote --recursiveTo auto-update submodules on every git pull:
git config submodule.recurse trueSkills are sourced from two repositories:
- Databricks skills:
databricks-solutions/ai-dev-kit→.agent/skills/ai-dev-kit/databricks-skills/ - MLflow skills:
mlflow/skills→.agent/skills/mlflow-skills/
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtcp .env.example .envEdit .env with your Databricks credentials:
DATABRICKS_HOST=https://your-workspace.cloud.databricks.com
DATABRICKS_TOKEN=your-api-token
LLM_MODEL=databricks-claude-sonnet-4
AUTHOR_NAME=Your Name # Optional - used for review comments
EDITOR_NAME=Editor Name # Optional - used for Track Changes edits (falls back to AUTHOR_NAME if not set)Process all DOCX files in a folder with three workflow modes:
# Mode 3 (default): process current directory
python3 batch_review.py
# Process a specific folder
python3 batch_review.py --folder "/path/to/chapters"
python3 batch_review.py --folder "../Ready for Review" --mode 1
# Mode 1: Generate CSV + apply comments only → _reviewed.docx
python3 batch_review.py --mode 1
# Mode 2: Use existing CSV + apply track changes only → _edited.docx
python3 batch_review.py --mode 2
# Process specific file in a folder
python3 batch_review.py --folder "/path/to/chapters" --file "Chapter 11.docx" --mode 3
# Continue processing if a file fails
python3 batch_review.py --mode 3 --continue-on-errorWorkflow Modes:
-
Mode 1 - Generate CSV + apply comments only →
_reviewed.docx- Generates unified review CSV with both comments and suggested edits
- Applies only Word comments (no track changes)
- Use this to review comments first before applying edits
-
Mode 2 - Use existing CSV + apply track changes only →
_edited.docx- Loads review items from existing CSV (from mode 1)
- Applies only track changes (no comments, no CSV regeneration)
- Use this after reviewing/editing the CSV from mode 1
-
Mode 3 - Generate CSV + apply both (default) →
_reviewed_edited.docx- Generates unified review CSV
- Applies both Word comments AND track changes
- Use this for complete review in one step
python3 docx_tech_review.py "Chapter 11 - MLflow 3.docx"Generates both:
- Review comments (Word sidebar comments) →
_reviewed.docx - Suggested edits (Track Changes) → applied to
_reviewed.docx
python3 docx_tech_review.py "Chapter 11.docx" --generate# Edit the CSV in Excel/Numbers - remove unwanted comments
python3 docx_tech_review.py "Chapter 11.docx" --applypython3 docx_tech_review.py "Chapter 11.docx" --author "Tech Reviewer"Generate text edits with Track Changes (strikethrough + insertions):
python3 docx_tech_review.py "Chapter 11.docx" --generate-editsCreates Chapter 11_edits.csv with suggested changes.
# Edit the CSV - remove/modify unwanted changes
python3 docx_tech_review.py "Chapter 11.docx" --apply-editsCreates Chapter 11_edited.docx with Track Changes enabled.
| File | Description |
|---|---|
<name>_review.csv |
Review comments (paragraph_index, issue_type, comment, severity) |
<name>_reviewed.docx |
Document with Word comments added |
review_*.log |
Detailed processing log |
| File | Purpose |
|---|---|
docx_tech_review.py |
Main review script (single file) |
batch_review.py |
Batch processing script (all DOCX files) |
.env.example |
Configuration template |
requirements.txt |
Python dependencies |
- Extract paragraphs from DOCX file
- Load skill context from
.agent/skills/(auto-discovered) - Send to LLM in batches for technical review
- Parse comments from LLM response (JSON format)
- Save to CSV for optional editing
- Apply as Word comments using python-docx 1.2.0+
MIT