feat: migrate skills review desk to astro
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
---
|
||||
name: back-to-work
|
||||
description: Log the return from lunch at the Long Day Factory. Records backToWork with the current timestamp in ~/long-day-factory.json. Use when the user says lunch is over / they are back at their desk / "back to work".
|
||||
---
|
||||
|
||||
# back-to-work
|
||||
|
||||
Records when the user returns from lunch. The gap between `lunchTime` and
|
||||
`backToWork` is the lunch break that `am-i-free` subtracts from time served.
|
||||
|
||||
## Steps
|
||||
|
||||
1. Run:
|
||||
|
||||
```bash
|
||||
bash "$CLAUDE_SKILL_DIR/back.sh"
|
||||
```
|
||||
|
||||
Fallback path: `~/.claude/skills/back-to-work/back.sh`.
|
||||
|
||||
2. The script creates `~/long-day-factory.json` if missing and sets `backToWork`
|
||||
to now.
|
||||
- If it warns that `lunchTime` is not set, ask the user whether they want to
|
||||
also set `lunchTime` now (to the current time) or leave it for `am-i-free`
|
||||
to handle with the default 11:30 assumption. If they say yes, re-run with:
|
||||
`bash "$CLAUDE_SKILL_DIR/back.sh" --also-lunch`
|
||||
- If it warns that `startTime` is not set, pass that along.
|
||||
|
||||
3. Reply with humor: the machine missed you, the assembly line resumes, etc.
|
||||
Include the timestamp.
|
||||
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
# Log return from lunch.
|
||||
set -euo pipefail
|
||||
|
||||
F="$HOME/long-day-factory.json"
|
||||
TS="$(python3 -c 'import datetime;print(datetime.datetime.now().astimezone().isoformat(timespec="seconds"))')"
|
||||
ALSO_LUNCH="${1:-}"
|
||||
|
||||
if [ ! -f "$F" ]; then
|
||||
printf '{\n "startTime": null,\n "lunchTime": null,\n "backToWork": null\n}\n' > "$F"
|
||||
fi
|
||||
|
||||
tmp="$(mktemp)"
|
||||
if [ "$ALSO_LUNCH" = "--also-lunch" ]; then
|
||||
jq --arg ts "$TS" '.backToWork = $ts | (if .lunchTime == null then .lunchTime = $ts else . end)' "$F" > "$tmp" && mv "$tmp" "$F"
|
||||
echo "Back to work at $TS (also set lunchTime to $TS)"
|
||||
else
|
||||
jq --arg ts "$TS" '.backToWork = $ts' "$F" > "$tmp" && mv "$tmp" "$F"
|
||||
echo "Back to work at $TS"
|
||||
fi
|
||||
|
||||
if [ "$(jq -r '.lunchTime' "$F")" = "null" ]; then
|
||||
echo "WARNING: lunchTime is not set — ask the user if they want to set it now (--also-lunch)."
|
||||
fi
|
||||
if [ "$(jq -r '.startTime' "$F")" = "null" ]; then
|
||||
echo "WARNING: startTime is not set — did you skip long-day-start this morning?"
|
||||
fi
|
||||
Reference in New Issue
Block a user