fix: resolve all errors from full repository audit

- README/README_JP: fix X bookmark schedule "22:00" → "every 4 hours"
- README: standardize skill name /auto-min → /auto-mins
- sync-x-bookmarks.sh: fix subshell variable scope (NEW_COUNT always 0)
  Use process substitution instead of pipe to preserve counter
- CLAUDE.md: add missing frontmatter (violated own schema rules)
- clips/_index.md: replace personal test data with clean template
- on-file-change.sh: replace bare except with specific exceptions
- on-session-end.sh: use context managers for file handles

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Masahiro Chaen 2026-04-08 23:29:08 +09:00
parent 0d1545b62e
commit 2c2343e081
7 changed files with 21 additions and 17 deletions

View file

@ -1,3 +1,7 @@
---
type: schema
---
# Obsidian Vault Schema
> このファイルはLLMがvaultを読み書きする際のルール定義。

View file

@ -1,5 +1,5 @@
---
date: 2026-04-08
date: {{date}}
type: index
---
@ -9,12 +9,10 @@ type: index
## Recent
- [[clips/x/2026-04-08_google-chrome-vertical-tabs]] — Chrome vertical tabs リリース (#chrome #ux)
- [[clips/x/2026-04-07_umiyuki-agent-harness]] — エージェントハーネスにクローズドソースは不適 (#ai #agent)
- [[clips/x/2026-03-01_masahirochaen-ai-brain-book]] — 初著書『AI脳』KADOKAWA出版 (#ai #book)
<!-- 新しいクリップが上に追加される -->
## Stats
- Total: 3
- X: 3
- Total: 0
- X: 0
- Articles: 0

View file

@ -17,7 +17,7 @@ try:
d = json.load(sys.stdin)
ti = d.get('tool_input', d)
print(ti.get('file_path', ti.get('path', '')))
except:
except (json.JSONDecodeError, AttributeError, TypeError, KeyError):
print('')
" 2>/dev/null || echo "")

View file

@ -39,7 +39,8 @@ import os
f = os.environ["DAILY_FILE"]
e = os.environ["ENTRY"]
lines = open(f).readlines()
with open(f) as fh:
lines = fh.readlines()
out = []
in_log = False
done = False
@ -57,7 +58,8 @@ for l in lines:
if in_log and not done:
out.append(e + "\n\n")
open(f, "w").writelines(out)
with open(f, "w") as fh:
fh.writelines(out)
' 2>/dev/null || echo "$ENTRY" >> "$DAILY_FILE"
exit 0

View file

@ -53,7 +53,7 @@ USER_MAP=$(echo "$BOOKMARKS" | jq -r '[.includes.users[]? | {(.id): .username}]
# 各ブックマークを処理
# スクリプト単体ではJSON出力のみ。要約・タグ生成はLLMが行う
NEW_COUNT=0
echo "$BOOKMARKS" | jq -c '.data[]' | while read -r tweet; do
while read -r tweet; do
TWEET_ID=$(echo "$tweet" | jq -r '.id')
TWEET_TEXT=$(echo "$tweet" | jq -r '.text // empty')
AUTHOR_ID=$(echo "$tweet" | jq -r '.author_id // "unknown"')
@ -69,6 +69,6 @@ echo "$BOOKMARKS" | jq -c '.data[]' | while read -r tweet; do
NEW_COUNT=$((NEW_COUNT + 1))
log "New bookmark: $TWEET_ID by @$AUTHOR"
echo "{\"id\":\"$TWEET_ID\",\"text\":$(echo "$TWEET_TEXT" | jq -Rs .),\"author\":\"@$AUTHOR\"}"
done
done < <(echo "$BOOKMARKS" | jq -c '.data[]')
log "Sync complete (new: $NEW_COUNT)"