에이전트 협업 인프라 구축 — .claude/ 확장
All checks were successful
Publish ParaWiki / build-and-deploy (push) Successful in 29s
All checks were successful
Publish ParaWiki / build-and-deploy (push) Successful in 29s
- PLAN.md · PROGRESS.md 도입: 병렬 에이전트 조정 지점 - CLAUDE.md 린화 + 에이전트 작업 흐름 섹션 (상세는 Output/guides/로 분리) - Output/guides/cimery-dev-guide.md, obsidian-cli.md 신설 - Agents: cimery-architect-researcher, adr-drafter - Commands: /plan, /progress, /adr, /research, /cimery-start - Skill: plan-commit - Hooks: raw/ 쓰기 차단, SessionStart PLAN/PROGRESS 주입, wiki/ADR 변경 시 log 갱신 알림, auto-approve (deny 훅 우선 유지) - .gitignore: .claude/ 공유 자산 포함, 로컬 상태·바이너리만 유지 제외 Closes #3 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
61
.claude/hooks/session-start-context.py
Normal file
61
.claude/hooks/session-start-context.py
Normal file
@@ -0,0 +1,61 @@
|
||||
#!/usr/bin/env python3
|
||||
"""SessionStart hook: inject PLAN.md P0/P1 and PROGRESS.md snapshot as additionalContext."""
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
|
||||
def read_file(path: str) -> str:
|
||||
try:
|
||||
with open(path, encoding="utf-8") as f:
|
||||
return f.read()
|
||||
except Exception:
|
||||
return ""
|
||||
|
||||
|
||||
def main() -> None:
|
||||
proj = os.environ.get("CLAUDE_PROJECT_DIR", ".")
|
||||
plan = read_file(os.path.join(proj, "PLAN.md"))
|
||||
progress = read_file(os.path.join(proj, "PROGRESS.md"))
|
||||
|
||||
parts: list[str] = []
|
||||
|
||||
# PLAN: "### P0" through (not including) "## 백로그"
|
||||
m = re.search(r"^### P0.*?(?=^## 백로그)", plan, re.M | re.S)
|
||||
if m:
|
||||
parts.append("## PLAN.md — 현재 스프린트\n\n" + m.group(0).strip())
|
||||
|
||||
# PROGRESS: "## 현재 스냅샷" to EOF
|
||||
m = re.search(r"^## 현재 스냅샷.*$", progress, re.M | re.S)
|
||||
if m:
|
||||
parts.append(m.group(0).strip())
|
||||
|
||||
if not parts:
|
||||
sys.exit(0)
|
||||
|
||||
ctx = "\n\n".join(parts) + (
|
||||
"\n\n**에이전트 작업 시작 시 PLAN.md · PROGRESS.md를 읽는 것이 필수입니다.**"
|
||||
)
|
||||
|
||||
print(
|
||||
json.dumps(
|
||||
{
|
||||
"hookSpecificOutput": {
|
||||
"hookEventName": "SessionStart",
|
||||
"additionalContext": ctx,
|
||||
}
|
||||
},
|
||||
ensure_ascii=False,
|
||||
)
|
||||
)
|
||||
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
main()
|
||||
except Exception as exc:
|
||||
sys.stderr.write(f"session-start-context: {exc}\n")
|
||||
sys.exit(0)
|
||||
Reference in New Issue
Block a user