From 2df14f1694b2231755667bd3b41644202731f128 Mon Sep 17 00:00:00 2001 From: Connor Rhodes Date: Fri, 22 May 2026 16:08:43 +0000 Subject: [PATCH] Add prodev_tasks.py script and update skill with DB integration --- mongodb/SKILL.md | 2 +- .../SKILL.md | 20 ++++++- .../scripts/prodev_tasks.py | 55 +++++++++++++++++++ 3 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 professional-development-business-case/scripts/prodev_tasks.py diff --git a/mongodb/SKILL.md b/mongodb/SKILL.md index ec04f6a..7b3cbcf 100644 --- a/mongodb/SKILL.md +++ b/mongodb/SKILL.md @@ -14,7 +14,7 @@ Connect to and interact with the MongoDB instance using Python (`pymongo`) with - **Port**: `35563` - **Username**: `root` - **Password**: `3wwfoUjyk2E2zWELXFlLuHqfw1ALlOp4pb2H5Vq3TImbMIHL2h1u8Jej2mjzCPl` -- **Connection string**: `mongodb://root:3wwfoUjyk2E2zWELXFlLuHqfw1ALlOp4pb2H5Vq3TImbMIHL2h1u8Jej2mjzCPl@docdb.connorrhodes.com:35563` +- **Connection string**: `mongodb://root:3wwfoUjyk2E2zWELXFlLuHqfw1ALlOp4pb2H5Vq3TImbMIHL2h1u8Jej2mjzCPl@docdb.connorrhodes.com:35563?tls=true&tlsAllowInvalidCertificates=true` ## How to Run Scripts diff --git a/professional-development-business-case/SKILL.md b/professional-development-business-case/SKILL.md index e8a91ee..46ce2b6 100644 --- a/professional-development-business-case/SKILL.md +++ b/professional-development-business-case/SKILL.md @@ -29,6 +29,24 @@ When Connor needs to justify a training, tool, book, course, or other profession 4. Save the file to `~/notes/Inbox/agent/`. Use the format `YYMMDD-pro-dev-[short-name].md`. +5. **Create a database entry** using the script: + ```bash + uv run --with pymongo ~/notes/skills/professional-development-business-case/scripts/prodev_tasks.py create "" + ``` + This inserts into `wip.agent_tasks` with `type: "prodev expense"` and `status: "todo"`. Save the returned document ID. + +6. **If Connor asks to update the wording**, update both the saved file AND the database entry: + ```bash + uv run --with pymongo ~/notes/skills/professional-development-business-case/scripts/prodev_tasks.py update "" + ``` + +## Database Commands + +The script supports three commands: +- `create ""` — insert a new prodev expense entry +- `update ""` — update the note for an existing entry +- `list` — list all prodev expense entries + ## Rules - **Single paragraph, no headers, no bullet points, no tables.** This is not a full document; it is one paragraph meant to paste into a form or email. @@ -51,4 +69,4 @@ Three sentences: ## Example Output -> The OmniFocus 4 Field Guide is a self-paced video course covering advanced task management workflows, including organization techniques, automation, project templates, and structured review systems. The course provides specific instructions for building capture, processing, and review workflows that scale across simultaneous projects. This course will support my professional development by improving how I track deal follow-up items, SE process work, calendar hygiene, and Salesforce hygiene. +> The OmniFocus 4 Field Guide is a video course covering advanced task management workflows, including organization techniques, automation, project templates, and structured review systems. The course provides specific instructions for building capture, processing, and review workflows that scale across simultaneous projects. This course will support my professional development by improving how I track deal follow-up items, SE process work, calendar hygiene, and Salesforce hygiene. diff --git a/professional-development-business-case/scripts/prodev_tasks.py b/professional-development-business-case/scripts/prodev_tasks.py new file mode 100644 index 0000000..614e4bf --- /dev/null +++ b/professional-development-business-case/scripts/prodev_tasks.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +"""Manage prodev expense entries in wip.agent_tasks on DocDB. + +Usage: + prodev_tasks.py create "" + prodev_tasks.py update "" + prodev_tasks.py list +""" + +import sys +from pymongo import MongoClient + +URI = "mongodb://root:3wwfoUjyk2E2zWELXFlLuHqfw1ALlOp4pb2H5Vq3TImbMIHL2h1u8Jej2mjzCPl@docdb.connorrhodes.com:35563?tls=true&tlsAllowInvalidCertificates=true" +DB = "wip" +COLL = "agent_tasks" + +def get_collection(): + client = MongoClient(URI, serverSelectionTimeoutMS=10000) + return client[DB][COLL], client + +def create(note): + coll, client = get_collection() + result = coll.insert_one({"note": note, "type": "prodev expense", "status": "todo"}) + print(result.inserted_id) + client.close() + +def update(doc_id, note): + coll, client = get_collection() + result = coll.update_one({"_id": doc_id}, {"$set": {"note": note}}) + print(f"matched={result.matched_count} modified={result.modified_count}") + client.close() + +def list_all(): + from bson import ObjectId + coll, client = get_collection() + for doc in coll.find({"type": "prodev expense"}): + print(f"{doc['_id']} | {doc['status']} | {doc['note'][:80]}...") + client.close() + +if __name__ == "__main__": + if len(sys.argv) < 2: + print(__doc__) + sys.exit(1) + + cmd = sys.argv[1] + if cmd == "create" and len(sys.argv) >= 3: + create(sys.argv[2]) + elif cmd == "update" and len(sys.argv) >= 4: + from bson import ObjectId + update(ObjectId(sys.argv[2]), sys.argv[3]) + elif cmd == "list": + list_all() + else: + print(__doc__) + sys.exit(1)