Skip to content

Commit 75aecdc

Browse files
committed
chore: add review.sh
1 parent 43609a2 commit 75aecdc

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

scripts/review.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
# Scheduled doc-review audit via Claude Code CLI.
3+
# Runs locally where skills and source repos are available.
4+
#
5+
# Usage:
6+
# ./scripts/doc-review-cron.sh # default: diff mode, 2 weeks
7+
# ./scripts/doc-review-cron.sh audit on-call # audit mode, scoped to on-call
8+
# ./scripts/doc-review-cron.sh diff "" "1 week ago" # diff mode, custom time range
9+
10+
set -euo pipefail
11+
12+
DOCS_DIR="$HOME/go/src/github.com/flashcatcloud/flashduty-docs"
13+
LOG_DIR="$DOCS_DIR/.doc-review/logs"
14+
CLAUDE="$HOME/.local/bin/claude"
15+
16+
MODE="${1:-diff}"
17+
SCOPE="${2:-}"
18+
SINCE="${3:-2 weeks ago}"
19+
20+
mkdir -p "$LOG_DIR"
21+
LOGFILE="$LOG_DIR/$(date +%Y-%m-%d-%H%M%S).log"
22+
23+
SCOPE_ARG=""
24+
if [ -n "$SCOPE" ]; then
25+
SCOPE_ARG="--scope $SCOPE"
26+
fi
27+
28+
echo "$(date): Starting doc-review (mode=$MODE, scope=$SCOPE, since=$SINCE)" | tee "$LOGFILE"
29+
30+
cd "$DOCS_DIR"
31+
32+
# Pull latest docs before reviewing
33+
git pull --rebase origin main >> "$LOGFILE" 2>&1 || true
34+
35+
echo "/doc-review --mode $MODE --since \"$SINCE\" $SCOPE_ARG --auto" | \
36+
$CLAUDE --print \
37+
--allowedTools "Read,Glob,Grep,Write,Edit,Bash,Agent,Skill" \
38+
>> "$LOGFILE" 2>&1
39+
40+
echo "$(date): Done. Log: $LOGFILE"

0 commit comments

Comments
 (0)