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:
minsung
2026-04-28 08:32:05 +09:00
parent 39df31f3e4
commit 417f880a87
23 changed files with 1202 additions and 0 deletions

View 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

View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
# RailPose3D Stop hook: 세션 종료 시 PROGRESS.md 갱신 여부 점검.
# PROGRESS.md 의 mtime 이 세션 시작 이전이면 사용자에게 한 줄 알림.
set -e
PROJECT_DIR="${CLAUDE_PROJECT_DIR:-$(pwd)}"
PROG="$PROJECT_DIR/PROGRESS.md"
[ ! -f "$PROG" ] && exit 0
# 최근 1시간 안에 변경되었는지 검사 (간단 판정).
NOW=$(date +%s)
MTIME=$(stat -c %Y "$PROG" 2>/dev/null || stat -f %m "$PROG" 2>/dev/null || echo 0)
DIFF=$(( NOW - MTIME ))
if [ "$DIFF" -gt 3600 ]; then
printf '{"systemMessage":"[RailPose3D] PROGRESS.md 가 1시간 이상 갱신되지 않았습니다. 세션 종료 전 /progress 또는 /handoff 호출을 고려하세요."}'
fi
exit 0