From eb8da9611e724492ac1d193f59cd39c541adf3cd Mon Sep 17 00:00:00 2001 From: Connor Rhodes Date: Fri, 22 May 2026 16:23:31 -0500 Subject: [PATCH] brag-sheet: add insert/update script, simplify SKILL.md --- brag-sheet/SKILL.md | 53 ++++------------ brag-sheet/scripts/brag_sheet.py | 106 +++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+), 41 deletions(-) create mode 100644 brag-sheet/scripts/brag_sheet.py diff --git a/brag-sheet/SKILL.md b/brag-sheet/SKILL.md index 7274a6f..ee4f4b5 100644 --- a/brag-sheet/SKILL.md +++ b/brag-sheet/SKILL.md @@ -18,55 +18,26 @@ Each document has the following fields: | `context` | `string` | Your own notes explaining the project/situation context where this feedback came from | | `tags` | `array[string]` | Tags for categorization. Default: `["work"]`. Can include additional tags like `"personal"`, etc. | -## Connection +## Script -Use the MongoDB connection from the `mongodb` skill. Connection string: - -``` -mongodb://root:3wwfoUjyk2E2zWELXFlLuHqfw1ALlOp4pb2H5Vq3TImbMIHL2h1u8Jej2mjzCPl@docdb.connorrhodes.com:35563 -``` - -## How to Add an Entry - -When the user provides positive feedback they want to save: - -1. **Collect the information** from the user: - - `note`: The kudos/feedback text. This is usually provided verbatim (e.g., an email, Slack message, or verbal feedback someone gave them). - - `context`: Background from the user about the project, situation, or relationship context. Ask for this if not provided. - - `tags`: Default to `["work"]` unless the user specifies otherwise. - -2. **Insert the document** using an inline Python script with `uv`: - -```python -from pymongo import MongoClient -from datetime import datetime - -client = MongoClient("mongodb://root:3wwfoUjyk2E2zWELXFlLuHqfw1ALlOp4pb2H5Vq3TImbMIHL2h1u8Jej2mjzCPl@docdb.connorrhodes.com:35563") -db = client["notes"] -collection = db["brag_sheet"] - -result = collection.insert_one({ - "date": datetime.now(), - "note": "", - "context": "", - "tags": ["work"] -}) -print(f"Inserted: {result.inserted_id}") -client.close() -``` - -Run it via: +All inserts and updates go through `scripts/brag_sheet.py`. Run it with `uv`: ```bash -cat <<'PYEOF' | uv run --with pymongo python - -