refactor(harness): migrate references/ into .agents/ and slim CLAUDE.md#33
Merged
Conversation
The anthropic-skills:skill-creator skill already encodes the frontmatter, standard sections, and anti-rationalization conventions this file documented. Remove references/skill-anatomy.md and its index entry to drop the duplicate. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…aptation, and graphify-manager Realign three active documentation surfaces with their declared roles: - CLAUDE.md (= AGENTS.md symlink): schema, 3-layer architecture, 7 operating principles, PR rules. 152 -> 83 lines. - references/local-adaptation.md: tech stack, main modules, validation commands, Repo-local Codex commands, path mapping, language conventions. 78 -> 123 lines. - .agents/skills/graphify-manager/SKILL.md: full refresh orchestration, committed artifacts, and `graphify update .` ban (previously embedded across CLAUDE.md and local-adaptation.md). Side changes: - Update docs-manager sync targets to include graphify-manager SKILL.md. - Rewrite .github/copilot-instructions.md read order across three surfaces. - Simplify test_claude_delegates_graphify_details_to_graphify_manager_skill to check the boundary pointer only; move internal SKILL.md assertions into the existing test_graphify_manager_skill_exists_with_full_refresh_flow. Tests: 124 passed; 2 network-dependent graphify_producer tests skipped in the sandbox. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…s/playbooks/
Move harness-local docs out of references/ into the .agents/ namespace so
the agent-harness files sit under a single root.
- git mv references/local-adaptation.md -> .agents/policies/local-adaptation.md
- git mv references/{security,performance,accessibility}-checklist.md
and references/testing-patterns.md -> .agents/playbooks/{security,performance,accessibility,testing}.md
- Drop references/{README,upstream-AGENTS,upstream-README}.md (upstream
drift snapshot no longer maintained)
- Update in-repo path references in skill SKILL.md files,
docs-manager/doc-manager agents yaml, CLAUDE.md, README.md, README.ko.md,
raw/README.md, .github/pull_request_template.md,
.github/copilot-instructions.md, tests/test_graphify_harness.py,
tests/test_execute_script.py, and scripts/execute.py GUARDRAIL_FILES
- Remove obsolete references/ entry from .graphifyignore
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…alize playbook H1s
- `.agents/policies/local-adaptation.md`: drop the `references/` Path Mapping row
(upstream agent-skills doesn't mandate `references/` as a hard convention,
and no in-repo consumer references the old path anymore)
- `.agents/playbooks/{security,performance,accessibility,testing}.md`: drop
`-Checklist` / `-Reference` suffix from the H1 to match the filename rename
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…-push) Stop hook은 fire-and-forget (exit 2 차단 불가) + 에이전트 응답 종료마다 실행되는 hot-path다. 매 턴 ~3s mypy+pytest는 핫패스 원칙 위반이고 차단 효과도 없어 `pre-push.sh`의 동일 검증과 중복. - `scripts/hooks/claude-stop-checks.sh`에서 `uv run mypy src` / `uv run pytest` 블록 제거, `ruff check .`와 `ruff format --check .`만 유지 - `tests/test_execute_script.py::test_claude_stop_script_uses_repo_validation_chain` 의 assertion을 현실에 맞게 갱신 (mypy/pytest가 **없어야** 함을 검증) pre-push.sh는 그대로 유지 — mypy/pytest 전체 게이트는 push 직전 1회로 위임. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… exit 2 for blocks JSON에 박힌 인라인 bash (regex + grep + sed, 이중 이스케이프)는 shellcheck 불가, syntax highlighting 불가, unit test 불가, diff 리뷰 난해. 차단 hook이 `exit 1`을 쓰고 있어 Claude Code 스펙상 실제로는 non-blocking error로 처리되던 버그까지 동시 교정. 신규 스크립트 5개 (`scripts/hooks/`): - `pretool-block-destructive.sh` — PreToolUse:Bash, **exit 2** (차단 정상화) - `pretool-warn-package-remove.sh` — PreToolUse:Bash, exit 0 (경고) - `pretool-block-graphify-out.sh` — PreToolUse:Write/Edit, **exit 2** (차단 정상화) - `pretool-warn-secret-file.sh` — PreToolUse:Write/Edit, exit 0 (경고) - `posttool-check-secrets-on-git.sh` — PostToolUse:Bash, git add/commit 감지 시 `check-secrets.sh` 실행 `.claude/settings.json`은 matcher + `bash scripts/hooks/<name>.sh` 호출만 남도록 슬림화 (Write/Edit 공통 로직 2개는 동일 스크립트 재사용). `tests/test_graphify_harness.py::test_claude_settings_enable_repo_specific_safety_hooks` 의 command 문자열 검증을 `"graphify-out/"` → `"graphify-out"`으로 완화 (스크립트 경로엔 슬래시가 없음 — 이름에는 dash로 포함). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Security-invariant hook은 warn-only로 두는 게 Claude Code hook 철학의 anti-pattern 3번과 정면 충돌. 감지 시 exit 2로 전환해 Claude에게 "반드시 rollback/재작업" 신호를 주입. 개별 탐지 라인의 `WARN:` 프리픽스는 진단 정보로 남기고, 최종에서 `BLOCKED:` + exit 2로 차단. PostToolUse는 이미 실행된 git add/commit을 되돌리진 못하지만, exit 2가 에이전트에게 전달돼 다음 턴에 rollback을 강제. 사람 로컬 commit 차단은 .githooks/pre-commit 통합이 별도 후속 (노션 §8에 기록). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
한 줄 요약
references/에 섞여 있던 local-adaptation(정책)과 체크리스트 4종을.agents/policies/·.agents/playbooks/로 분리하고,CLAUDE.md를 도메인 상세가 없는 스키마/거버넌스 레이어로 슬림화합니다.배경 / 문제
references/가 local-adaptation + 체크리스트 + upstream archival을 혼합 보관했고,CLAUDE.md는 기술 스택·모듈 표·CLI·Codex commands 같은 도메인 구체를 직접 들고 있어 스스로 선언한 "스키마 레이어" 역할과 어긋났다..agents/와references/두 루트에 분산돼 있었고, drift 비교 이력 없이references/upstream-*.md스냅샷만 archival로 남아 있었다..agents/단일 루트로 하네스 레이아웃을 통합하고,CLAUDE.md는 스키마 + 7개 운영 원칙까지로 축소.PR 대시보드
main변경 묶음별 리뷰 가이드
references/전체,.agents/policies/,.agents/playbooks/references/local-adaptation.md→.agents/policies/, 체크리스트 4종 →.agents/playbooks/(접미사-checklist·-patterns제거),references/upstream-*.md+references/README.md삭제git log --stat,git show <commit> --name-statusCLAUDE.md,.agents/policies/local-adaptation.mdreferences/...참조를 새 경로로 치환references/언급이 남지 않았는지grep -rn "references/" .tests/test_graphify_harness.py,tests/test_execute_script.py_load_guardrailsfixture 경로 갱신test_pr_creation_rules_require_template_based_flow,test_load_guardrails_uses_repo_specific_documents의미 유지references/skill-anatomy.mdgrep -rn "skill-anatomy"Before / After
Before
references/local-adaptation.md+references/{security,performance,accessibility}-checklist.md+references/testing-patterns.md+references/upstream-{AGENTS,README}.mdCLAUDE.md가 기술 스택·모듈 표·CLI·Codex commands 포함.graphifyignore에 존재하지 않을 예정인references/줄After
.agents/policies/local-adaptation.md(정책 + 도메인 상세 집결지).agents/playbooks/{security,performance,accessibility,testing}.md(rename 후 일관된 네이밍)CLAUDE.md83줄로 슬림화 (스키마 + 7개 운영 원칙 + 3-레이어 아키텍처)검증
uv run pytest --ignore=tests/test_mlx_runtime.py --ignore=tests/test_cli_smoke_mlx.py --ignore=tests/test_graphify_auto_refresh.py -q→ 141 passed (pre-push 게이트 그대로)uv run ruff check .→ All checks passeduv run mypy src→ no issuesgrep -rn "references/"실제 소스 0 hit (Path Mapping 표의 upstream 지시 1건만 의도적으로 유지)남은 리스크 / 후속 작업
.agents/vendor/upstream/같은 추가 분화가 필요해지면 별도 PR로 검토chore(graphify): refresh graph after harness split,...after layout split)는 rebase 시graphify-out/*충돌로 skip했습니다. 현재graphify-out/은 main(fdb0c71)의 code refresh 결과이며,scripts/hooks/graphify-auto-refresh.sh가inputs unchanged로 판정해 별도 refresh 커밋 없이 유지..agents/playbooks/" vs "정책/로컬 적응 맥락 →.agents/policies/"로 구분돼 들어갔는지