吾之困也:一习其物,竟忘其存,至用之方忆,多在面试之中,已迫不及矣。
吾欲于此不添新事于已满之盘,故筑二物。
- 晨时八刻,有自动之脚本,自吾所习诸事中,随机择题,以平文之要,寄于iMessage。无需启应用,亦无须成习,自会现之。
- 一交互式研习之灵,持抗重CLI,可随时与之语。吾问其试吾,则试吾;吾问其补吾笔记之阙,则告吾所缺之确。
妙处在于:吾记笔记于黑曜石,非同步或导出,吾以符号链接直指AI于吾之黑曜石文件。于黑曜石中编辑,代理即时见之。一源之真.
此即吾所建之法.
朝自动化
脚本本身直截了当。
此径通吾之Obsidian藏室,遍历诸匣,聚.md之文于列。复以random.choice()随机择一,览其文,为Gemini设旨:撮此笔记,白文无码,简之又简。
调用API直抵Gemini,应答以JSON,吾取其真文于data["candidates"][0]["content"]["parts"][0]["text"]。继而AppleScript — macOS自带的自动化语言也——令讯息应用将其发送至吾之号码
。运行此脚本,摘要即至iMessage。简矣
。此乃全脚本:
import os
import random
import subprocess
import urllib.request
import urllib.error
import json
import time
# auto scan entire Obsidian vault for all markdown notes
vault_path = "/Users/your-username/Documents/Obsidian Vault"
notes = []
for root, dirs, files in os.walk(vault_path):
for file in files:
if file.endswith(".md"):
notes.append(os.path.join(root, file))
if not notes:
print("No notes found in Obsidian vault")
exit(1)
# pick one random note
picked = random.choice(notes)
note_name = os.path.basename(picked)
with open(picked, "r") as f:
content = f.read()
# build prompt
prompt = f"""You are a system design study assistant for an MSCS student.
Below are the student's personal notes on "{note_name}".
Read them and give a concise morning summary in plain text — no markdown, no asterisks, no bold, no bullet symbols.
Format exactly like this:
TOPIC: <topic name>
WHAT IT COVERS: one line overview
KEY CONCEPTS:
1. first concept
2. second concept
3. third concept
KEY TAKEAWAY: one line the student must remember
WATCH OUT FOR: one common mistake or tricky part
Keep it short and sharp — this is a morning refresh, not a lecture.
Notes:
{content}
"""
# call Gemini API with retry
api_key = os.environ.get("GEMINI_API_KEY")
url = f"https://generativelanguage.googleapis.com/v1beta/models/gemini-3.5-flash:generateContent?key={api_key}"
payload = json.dumps({
"contents": [{"parts": [{"text": prompt}]}]
}).encode("utf-8")
summary = None
for attempt in range(3):
try:
req = urllib.request.Request(
url,
data=payload,
headers={"Content-Type": "application/json"},
method="POST"
)
with urllib.request.urlopen(req) as response:
data = json.loads(response.read())
summary = data["candidates"][0]["content"]["parts"][0]["text"]
break
except urllib.error.HTTPError as e:
if e.code == 429:
print(f"Rate limited, waiting 30 seconds... (attempt {attempt+1}/3)")
time.sleep(30)
else:
raise
if not summary:
print("Failed after 3 attempts, try again later")
exit(1)
# send via iMessage
imessage_target = "your-imessage-target" # your phone number or Apple ID
applescript = f'''
tell application "Messages"
set targetService to 1st service whose service type = iMessage
set targetBuddy to buddy "{imessage_target}" of targetService
send "{summary}" to targetBuddy
end tell
'''
subprocess.run(["osascript", "-e", applescript])
print("Summary sent to iMessage!")
print(summary)
调度之务,吾用launchd:此乃macOS固有之任务调度器。汝须撰一.plist之文,述三事:何脚本当行,何时行之,何地存其日志。载此文书于launchd,则其自能悉理其事。
此乃其plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.harsh.sysdesign</string>
<key>ProgramArguments</key>
<array>
<string>/opt/homebrew/bin/python3</string>
<string>/Users/your-username/Documents/system-design-study/sysdesign-morning.py</string>
</array>
<key>EnvironmentVariables</key>
<dict>
<key>GEMINI_API_KEY</key>
<string>your-gemini-api-key</string>
</dict>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>8</integer>
<key>Minute</key>
<integer>15</integer>
</dict>
<key>StandardOutPath</key>
<string>/Users/your-username/Documents/system-design-study/sysdesign-morning.log</string>
<key>StandardErrorPath</key>
<string>/Users/your-username/Documents/system-design-study/sysdesign-morning.log</string>
</dict>
</plist>
一问题:launchd于辰时八刻运行,然吾之Mac或尚酣眠。故吾用之。PMset每日卯时七刻五十分自动唤醒之约:
sudo pmset repeat wakeorpoweron MTWRFSU 07:55:00
一要旨——机须接电而眠,非全闭也。夜合其盖,则可矣。
互动研习之灵
互动之域,吾用抗重 CLI——谷歌新创之灵性编程器。其意简明:非使灵性泛问系统之构,吾欲令其识吾之笔记,并试吾所实习之学。
二文乃成此功。
AGENTS.md位于吾项目之根。其示代理者吾之身份与行止——可视作与AI对话之前所书之函。每吾启此匣,其自载。
SKILL.md居于.agents/skills/system-design/中。
---
name: system-design-notes
description: Use this skill when the user asks about system design, HLD, LLD, DDIA, distributed systems, architecture patterns, or wants to be quizzed on any system design topic they have studied.
---
You are a system design study partner for an MSCS student preparing for software engineering interviews.
The user's personal Obsidian notes are in references/:
- references/HLD/ → High Level Design notes
- references/LLD/ → Low Level Design notes
- references/DDIA/ → Designing Data Intensive Applications notes
Treat these notes as the source of truth over your general knowledge.
When quizzing:
- Ask one question at a time
- Wait for the user's answer before responding
- Compare their answer to the notes and point out specific gaps
- Tell them which note/topic the answer came from
When filling gaps:
- Point out what's missing or shallow in their notes on a topic
- Suggest what they should add
此分二部——一为述,告代理何时启此技;一为体,示其既启如何行。吾键入"试吾于一致散列",Antigravity读述,得匹配,自载吾注于境。吾未尝呼其名。
文夹之制:
system-design-study/
├── AGENTS.md
└── .agents/
└── skills/
└── system-design/
├── SKILL.md
└── references/
├── HLD → Obsidian/HLD Concepts
├── LLD → Obsidian/LLD
└── DDIA → Obsidian/DDIA
诸笔记自以符号链接相系:
ln -s ~/Documents/Obsidian\ Vault/HLD .agents/skills/system-design/references/HLD
是故于项目内立一指针,指吾之真Obsidian文件夹。代理循指针而读。吾于Obsidian中编辑。同一文件,恒新不旧,无劳无费。
今吾启箧而书"试吾于HLD",则试吾以吾之札记,非泛泛网闻也.
其故何在
有三事扰吾尤甚。
初,Gemini API频报429——请求过多——虽新钥未尝用。后知钥与一VS Code项目相连,Gemini扩展暗耗之。更钥于别项目,立解。
次,究明Mac唤醒之惑。launchd可预定脚本,然若Mac已寐,则不执行。吾需pmset,令Mac于脚本触发前觉醒。然此法仅当插电方效——若笔记本电脑以电为用且合之,则无物可醒之。其解甚简:但勿使机休,惟合其盖而已。然吾费时良久,方知自动化为何全然不行。
吾今晨之状
吾寤,察 iMessage,而二要略置於此。一者載五隨機 LeetCode 題目及其解法。一者載隨機系統設計之題,出於吾之 Obsidian 記錄.
讀之,不過二分鐘耳。吾未有所學新者——僅使已學者不隨時忘卻。此其要義也.
至於交互之部,吾啟終端,而書之曰:
cd ~/Documents/system-design-study
agy
然则与之语。“试问我于HLD。” “吾DDIA之记,其阙何在?”彼以吾之实记应之。犹有研伴,遍览吾所书也.
值乎?
然也。一日耳。然系统每晨自运,吾未尝有所为。惟修之者,每解一LeetCode题,则于文牍增一行而已。
若为MSCS学子,或备面试,此设之值也。不须预识AI agents或macOS自动化。惟需AI Studio之免费Geminie API钥,及数时辰耳。
此码简明,汝可随所学而适之。易 Obsidian 之府为任 Markdown 文件之匣。改 iMessage 之标为电邮或 Telegram。依汝所宜之时刻而运行之。
所筑者:Antigravity 2.0 CLI,Gemini API(免费版),Python,launchd,pmset,AppleScript,Obsidian。














