Setup RailPose3D harness (Planner/Generator/Evaluator)
Name the project RailPose3D and stand up a multi-agent harness following the Anthropic harness-design blog principles (decomposition, separation of concerns, file-based handoff, sprint contracts, context-reset over compaction). - CLAUDE.md / PLAN.md / PROGRESS.md as the file-based handoff surface; every agent must read PLAN+PROGRESS before acting. - 7 sub-agents under .claude/agents/: plan-architect (Planner), pole-detector-builder, rail-detector-builder, triangulation- builder, data-pipeline-builder (Generators), module-evaluator (Evaluator), dataset-explorer (read-only helper). - 6 skills under .claude/skills/: /start /sprint /eval /progress /handoff /contract. - SessionStart and Stop hooks to inject the PLAN/PROGRESS briefing and remind about PROGRESS.md updates. - docs/plan.md captures the user-approved detailed plan; docs/research.md is the prior tech survey. - .gitignore excludes data/, .usage/, model checkpoints, and local Claude overrides. Tracking: closes #1 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
38
.claude/hooks/session_briefing.sh
Normal file
38
.claude/hooks/session_briefing.sh
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
# RailPose3D SessionStart hook: PLAN.md / PROGRESS.md 핵심을 컨텍스트에 주입.
|
||||
# stdin = 이벤트 JSON, stdout = JSON {"hookSpecificOutput": {"additionalContext": "..."}}
|
||||
|
||||
set -e
|
||||
|
||||
PROJECT_DIR="${CLAUDE_PROJECT_DIR:-$(pwd)}"
|
||||
PLAN="$PROJECT_DIR/PLAN.md"
|
||||
PROG="$PROJECT_DIR/PROGRESS.md"
|
||||
|
||||
# 파일 부재 시 안전 종료
|
||||
if [ ! -f "$PLAN" ] || [ ! -f "$PROG" ]; then
|
||||
printf '{"hookSpecificOutput":{"additionalContext":"[RailPose3D] PLAN.md 또는 PROGRESS.md 누락. /start 가 없으므로 사용자에게 셋업 진행 여부를 확인할 것."}}'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Current Sprint + Next Action + Blockers 섹션만 추출 (간단한 grep 기반)
|
||||
SUMMARY=$(awk '
|
||||
/^## Current Sprint/ {f=1; print; next}
|
||||
/^## Next Action/ {f=1; print; next}
|
||||
/^## Blockers/ {f=1; print; next}
|
||||
/^## / {f=0}
|
||||
f {print}
|
||||
' "$PROG" | head -60)
|
||||
|
||||
# 다이렉트 echo 가 한국어/유니코드 안전하지 않으므로 jq 가 있으면 사용, 없으면 escape
|
||||
if command -v jq >/dev/null 2>&1; then
|
||||
jq -nc --arg ctx "[RailPose3D] 세션 시작. 첫 작업 전 PLAN.md + PROGRESS.md 를 읽고 작업 위치를 명시할 것.
|
||||
|
||||
현재 PROGRESS 요약:
|
||||
$SUMMARY
|
||||
|
||||
권장 첫 명령: /start" '{hookSpecificOutput:{additionalContext:$ctx}}'
|
||||
else
|
||||
# jq 없을 때 fallback — 큰따옴표/개행 escape
|
||||
ESCAPED=$(printf '%s' "$SUMMARY" | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g' | awk '{printf "%s\\n", $0}')
|
||||
printf '{"hookSpecificOutput":{"additionalContext":"[RailPose3D] 세션 시작. PLAN.md + PROGRESS.md 우선 확인. 권장 첫 명령: /start\\n\\n%s"}}' "$ESCAPED"
|
||||
fi
|
||||
Reference in New Issue
Block a user