Session Notes to GitHub
Captures the core substance, key decisions, code snippets, and takeaways from the active working session into an Obsidian-ready, high-signal Markdown document and securely pushes it to a remote GitHub repository.
Trigger Phrases
| User Input |
Target Action |
| "Save this discussion" / "Push today's notes" |
Generate summary & push to default repo (sumanjeet0012/temporary) |
| "Make a markdown of what we discussed and push to github" |
Full session documentation with code blocks & architectural takeaways |
| "Save notes to repo <owner/repo>" |
Target a custom repository instead of the default |
Execution Workflow
Phase 1: Context Distillation & Sanitization
- Extract Factual Substance (Zero Padding):
- Review the actual conversation transcript for real discussions, decisions, and code changes.
- Never invent topics, praise, or discussions that did not happen.
- Mandatory Secret Sanitization Check:
- Scan the drafted note for credentials: API keys, JWT tokens (
ey...), bearer tokens, private keys (BEGIN PRIVATE KEY), and passwords.
- Redact any discovered secrets with
[REDACTED_SECRET] and document the redaction in the note header.
- Determine Exact Date:
- Execute
date +%Y-%m-%d to get today's accurate local calendar date (e.g., 2026-09-04).
Phase 2: Document Structure Template
Format the Markdown note with frontmatter for Obsidian, static-site generators, and GitHub rendering:
---
title: "<Topic — Short Descriptive Title>"
date: YYYY-MM-DD
tags:
- session-notes
- <topic-tag-1>
- <topic-tag-2>
summary: "<1-2 sentence executive summary of what was accomplished or explored>"
---
# <Topic — Short Descriptive Title>
- **Date:** YYYY-MM-DD
- **Context:** <1-line summary of context, e.g., "Deep dive into Tailscale Funnel & Serve architecture">
---
## 📌 Executive Summary & Key Decisions
- Bullet points covering core architectural decisions, discoveries, and solutions established during the session.
---
## 🛠️ Concepts & Mechanics Explored
Detailed breakdown of technical mechanics, protocols, algorithms, or systems discussed:
- **Sub-topic A:** Core mechanics, trade-offs, and invariants.
- **Sub-topic B:** Relevant commands, configurations, or patterns.
---
## 💻 Key Code Snippets & Commands
Include the exact, working code snippets, CLI incantations, or configurations produced in the conversation:
```bash
# Important commands executed or recommended
# Canonical code snippets developed
🔗 Resources & References Mentioned
- Direct verified URLs to documentation, repositories, RFCs, or articles referenced.
🚀 Open Questions & Next Steps
---
### Phase 3: File Naming & Git Publishing
1. **Determine Target Repository:**
- Default: `sumanjeet0012/temporary` (override if specified by user).
2. **Generate Standard File Name:**
- Pattern: `YYYY-MM-DD-<kebab-case-topic>.md` (e.g., `2026-09-04-tailscale-architecture-notes.md`).
- If the note targets the root directory (default in `sumanjeet0012/temporary`), keep it at repository root.
3. **Execute Safe Git Operations:**
Run the following automated sequence in a clean temporary directory:
```bash
set -e
REPO="sumanjeet0012/temporary"
FILE_NAME="YYYY-MM-DD-<kebab-case-topic>.md"
TMP=$(mktemp -d)
trap 'rm -rf "$TMP"' EXIT
# 1. Clone using gh if authenticated, fallback to standard git
if command -v gh >/dev/null 2>&1 && gh auth status >/dev/null 2>&1; then
gh repo clone "$REPO" "$TMP/repo"
else
git clone "https://github.com/$REPO.git" "$TMP/repo" || git clone "git@github.com:$REPO.git" "$TMP/repo"
fi
# 2. Check for filename collisions
TARGET_PATH="$TMP/repo/$FILE_NAME"
COUNTER=2
BASE_NAME="YYYY-MM-DD-<kebab-case-topic>"
while [ -f "$TARGET_PATH" ]; do
TARGET_PATH="$TMP/repo/${BASE_NAME}-${COUNTER}.md"
FILE_NAME="${BASE_NAME}-${COUNTER}.md"
COUNTER=$((COUNTER + 1))
done
# 3. Write note content into TARGET_PATH (using agent file tools or cat << 'EOF')
# 4. Commit and push
git -C "$TMP/repo" add "$FILE_NAME"
git -C "$TMP/repo" commit -m "notes: <kebab-case-topic> ($(date +%Y-%m-%d))"
# 5. Pull rebase to handle concurrent commits, then push
git -C "$TMP/repo" pull --rebase origin main || git -C "$TMP/repo" pull --rebase origin master || true
git -C "$TMP/repo" push origin HEAD
Phase 4: Confirmation & Handoff
Report back to the user with the direct clickable GitHub URL:
✅ Session notes successfully saved and published!
📄 File: https://github.com/<owner>/<repo>/blob/main/<filename>.md
Safety & Security Rules
- Zero Secret Leakage: Never push API tokens, SSH keys, private IPs, or internal confidential credentials.
- Never Force Push (
--force): Always use standard git push origin HEAD or rebase cleanly.
- Immutable History: Never modify, overwrite, or delete existing notes or files in the remote repository. Only create new notes.
- Clean Workspaces: Always perform git operations in an isolated
$TMP directory, never polluting the user's active local workspace.
1---2name: session-notes-to-github3description: Summarize the technical substance of the current conversation (topics discussed, concepts learned, architectural decisions, code snippets, and next steps) and publish it as a clean, structured Markdown note to a designated GitHub repository (defaults to sumanjeet0012/temporary). Use when the user asks to "save this discussion", "make a markdown of what we discussed", "upload notes to GitHub", "save session to temporary repo", or "push today's notes".4license: MIT5---67# Session Notes to GitHub89Captures the core substance, key decisions, code snippets, and takeaways from the active working session into an Obsidian-ready, high-signal Markdown document and securely pushes it to a remote GitHub repository.1011---1213## Trigger Phrases1415| User Input | Target Action |16|---|---|17| "Save this discussion" / "Push today's notes" | Generate summary & push to default repo (`sumanjeet0012/temporary`) |18| "Make a markdown of what we discussed and push to github" | Full session documentation with code blocks & architectural takeaways |19| "Save notes to repo <owner/repo>" | Target a custom repository instead of the default |2021---2223## Execution Workflow2425### Phase 1: Context Distillation & Sanitization26271. **Extract Factual Substance (Zero Padding):**28 - Review the actual conversation transcript for real discussions, decisions, and code changes.29 - Never invent topics, praise, or discussions that did not happen.302. **Mandatory Secret Sanitization Check:**31 - Scan the drafted note for credentials: API keys, JWT tokens (`ey...`), bearer tokens, private keys (`BEGIN PRIVATE KEY`), and passwords.32 - Redact any discovered secrets with `[REDACTED_SECRET]` and document the redaction in the note header.333. **Determine Exact Date:**34 - Execute `date +%Y-%m-%d` to get today's accurate local calendar date (e.g., `2026-09-04`).3536---3738### Phase 2: Document Structure Template3940Format the Markdown note with frontmatter for Obsidian, static-site generators, and GitHub rendering:4142```markdown43---44title: "<Topic — Short Descriptive Title>"45date: YYYY-MM-DD46tags:47 - session-notes48 - <topic-tag-1>49 - <topic-tag-2>50summary: "<1-2 sentence executive summary of what was accomplished or explored>"51---5253# <Topic — Short Descriptive Title>5455- **Date:** YYYY-MM-DD56- **Context:** <1-line summary of context, e.g., "Deep dive into Tailscale Funnel & Serve architecture">5758---5960## 📌 Executive Summary & Key Decisions61- Bullet points covering core architectural decisions, discoveries, and solutions established during the session.6263---6465## 🛠️ Concepts & Mechanics Explored66Detailed breakdown of technical mechanics, protocols, algorithms, or systems discussed:67- **Sub-topic A:** Core mechanics, trade-offs, and invariants.68- **Sub-topic B:** Relevant commands, configurations, or patterns.6970---7172## 💻 Key Code Snippets & Commands73Include the exact, working code snippets, CLI incantations, or configurations produced in the conversation:7475```bash76# Important commands executed or recommended77```7879```python80# Canonical code snippets developed81```8283---8485## 🔗 Resources & References Mentioned86- Direct verified URLs to documentation, repositories, RFCs, or articles referenced.8788---8990## 🚀 Open Questions & Next Steps91- [ ] Next action items identified by the user or agent.92- [ ] Unresolved questions or topics scheduled for future exploration.93```9495---9697### Phase 3: File Naming & Git Publishing98991. **Determine Target Repository:**100 - Default: `sumanjeet0012/temporary` (override if specified by user).1012. **Generate Standard File Name:**102 - Pattern: `YYYY-MM-DD-<kebab-case-topic>.md` (e.g., `2026-09-04-tailscale-architecture-notes.md`).103 - If the note targets the root directory (default in `sumanjeet0012/temporary`), keep it at repository root.1043. **Execute Safe Git Operations:**105 Run the following automated sequence in a clean temporary directory:106107```bash108set -e109110REPO="sumanjeet0012/temporary"111FILE_NAME="YYYY-MM-DD-<kebab-case-topic>.md"112113TMP=$(mktemp -d)114trap 'rm -rf "$TMP"' EXIT115116# 1. Clone using gh if authenticated, fallback to standard git117if command -v gh >/dev/null 2>&1 && gh auth status >/dev/null 2>&1; then118 gh repo clone "$REPO" "$TMP/repo"119else120 git clone "https://github.com/$REPO.git" "$TMP/repo" || git clone "git@github.com:$REPO.git" "$TMP/repo"121fi122123# 2. Check for filename collisions124TARGET_PATH="$TMP/repo/$FILE_NAME"125COUNTER=2126BASE_NAME="YYYY-MM-DD-<kebab-case-topic>"127while [ -f "$TARGET_PATH" ]; do128 TARGET_PATH="$TMP/repo/${BASE_NAME}-${COUNTER}.md"129 FILE_NAME="${BASE_NAME}-${COUNTER}.md"130 COUNTER=$((COUNTER + 1))131done132133# 3. Write note content into TARGET_PATH (using agent file tools or cat << 'EOF')134135# 4. Commit and push136git -C "$TMP/repo" add "$FILE_NAME"137git -C "$TMP/repo" commit -m "notes: <kebab-case-topic> ($(date +%Y-%m-%d))"138139# 5. Pull rebase to handle concurrent commits, then push140git -C "$TMP/repo" pull --rebase origin main || git -C "$TMP/repo" pull --rebase origin master || true141git -C "$TMP/repo" push origin HEAD142```143144---145146### Phase 4: Confirmation & Handoff147148Report back to the user with the direct clickable GitHub URL:149```text150✅ Session notes successfully saved and published!151📄 File: https://github.com/<owner>/<repo>/blob/main/<filename>.md152```153154---155156## Safety & Security Rules1571581. **Zero Secret Leakage:** Never push API tokens, SSH keys, private IPs, or internal confidential credentials.1592. **Never Force Push (`--force`):** Always use standard `git push origin HEAD` or rebase cleanly.1603. **Immutable History:** Never modify, overwrite, or delete existing notes or files in the remote repository. Only create new notes.1614. **Clean Workspaces:** Always perform git operations in an isolated `$TMP` directory, never polluting the user's active local workspace.