Set up the target project's CLAUDE.md and AGENTS.md to match the harness system. CLAUDE.md is a minimal entry point of 20 lines or fewer, AGENTS.md is 95–130 lines of core rules.
Persona
Harness system setup expert. Remove content in CLAUDE.md that duplicates AGENTS.md, check the 5 AGENTS.md sections, and supplement any that are missing. Delete cursor rules.
Prerequisites
- Project rootrun from (the target project, not peach-harness itself)
- The peach-harness skill must be installed
Workflow
Step 1: Current State Analysis
Check the following:
# CLAUDE.md 존재 여부 + 내용
cat CLAUDE.md 2>/dev/null || echo "CLAUDE.md 없음"
# AGENTS.md 존재 여부 + 내용
cat AGENTS.md 2>/dev/null || echo "AGENTS.md 없음"
# 프로젝트 구조 감지
ls -d api/ front/ 2>/dev/null || echo "모노레포 아님"
# Controller 프레임워크 감지 (Koa vs Elysia)
head -3 api/src/modules/test-data/controller/test-data.controller.ts 2>/dev/null || echo "controller 없음"
# DAO 라이브러리 감지 (bunqldb vs sql-template-strings)
head -5 api/src/modules/test-data/dao/test-data.dao.ts 2>/dev/null || echo "dao 없음"
# DB 종류 감지
grep -i "host\|database\|mysql\|postgres" api/env.local.yml 2>/dev/null | head -5 || echo "env.local.yml 없음"
# cursor rules 존재 여부
ls api/.cursor/rules/ 2>/dev/null && echo "api cursor rules 존재" || echo "api cursor rules 없음"
ls front/.cursor/rules/ 2>/dev/null && echo "front cursor rules 존재" || echo "front cursor rules 없음"
ls .cursor/rules/ 2>/dev/null && echo "root cursor rules 존재" || echo "root cursor rules 없음"
ls .cursorrules 2>/dev/null && echo ".cursorrules 존재" || echo ".cursorrules 없음"
Summarize the analysis results:
- CLAUDE.md: presence, current line count, list of sections duplicating AGENTS.md
- AGENTS.md: presence, presence of the 5 sections
- Project type:
api/ + front/monorepo / standaloneapi// standalonefront/ - Controller framework: Koa (routing-controllers) or Elysia (N/A if no api/)
- DB type: MySQL or PostgreSQL (N/A if no api/)
- cursor rules: presence and file list
Step 2: Check the 5 AGENTS.md Sections
If AGENTS.md exists, check whether the following 5 sections are present:
grep -l "공통 원칙\|_common.*import" AGENTS.md 2>/dev/null && echo "§1.공통원칙 존재" || echo "§1.공통원칙 누락"
grep -l "백엔드 규칙\|ErrorHandler" AGENTS.md 2>/dev/null && echo "§2.백엔드 존재" || echo "§2.백엔드 누락"
grep -l "프론트엔드 규칙\|computed" AGENTS.md 2>/dev/null && echo "§3.프론트엔드 존재" || echo "§3.프론트엔드 누락"
grep -l "테스트\|TDD" AGENTS.md 2>/dev/null && echo "§4.테스트 존재" || echo "§4.테스트 누락"
grep -l "Bounded Autonomy\|Must Follow" AGENTS.md 2>/dev/null && echo "§5.BA 존재" || echo "§5.BA 누락"
When a missing section is found, use the references below as the source:
| Section | Source File |
|---|---|
| 1. Common Principles | peach-setup-harness/references/01-common.md |
| 2. Backend Rules (Koa) | peach-setup-harness/references/02-backend-koa.md |
| 2. Backend Rules (Elysia) | peach-setup-harness/references/02-backend-elysia.md |
| 3. Frontend Rules | peach-setup-harness/references/03-frontend.md |
| 4. Testing and Quality | peach-setup-harness/references/04-testing.md |
| 5. Bounded Autonomy | peach-setup-harness/references/05-bounded-autonomy.md |
Koa/Elysia branching: handled only by selecting file 02
- Koa →
01 + 02-backend-koa + 03 + 04 + 05 - Elysia →
01 + 02-backend-elysia + 03 + 04 + 05
Additional checks when Elysia is detected:
grep -l "Plugin System\|try-catch 금지" AGENTS.md 2>/dev/null && echo "Elysia 규칙 존재" || echo "Elysia 규칙 누락"
Record the list of missing sections.
Optional section (when api/ exists):
# DB 데이터 확인 섹션 존재 여부
grep -l "개발 DB 데이터 확인\|psql.*DATABASE_URL\|peach-db-query" AGENTS.md 2>/dev/null && echo "§6.DB조회 존재" || echo "§6.DB조회 누락"
- api/ present + §6 missing →
peach-setup-harness/references/06-db-query.mdadd as source
Step 3: Generate Change Plan
Present the change plan to the user:
CLAUDE.md changes:
- Duplicate sections to remove (content already in AGENTS.md)
- Final estimated line count
AGENTS.md changes:
- List of missing sections + summary of content to add
- Confirm the overall 5-section structure
Delete cursor rules (if present):
- List of files/directories to delete
- Reason for deletion: "Proceed based on the basic guidelines (AGENTS.md) + skill base. cursor rules are no longer used"
Step 4: User Confirmation
Obtain the user's consent for the change plan. If there are modification requests, incorporate them.
Step 5: Apply
Apply the changes after approval:
-
CLAUDE.md cleanup
- Remove sections that overlap with AGENTS.md
- Preserve project-specific instructions (Electron IPC, special settings, etc.)
- Keep within 20 lines
-
Create or update AGENTS.md
- Compose 5 sections by combining references per section
- Handle the Koa/Elysia branch by file selection in item 02 only
- No AGENTS.md → generate the whole thing by combining the 5 references
- AGENTS.md exists → extract only missing/mismatched sections from references and add/update them
-
Delete cursor rules (if present)
api/.cursor/rules/Delete directoryfront/.cursor/rules/Delete directory- Root
.cursor/rules/Delete directory - Root
.cursorrulesDelete file
Step 6: Verify completion
Output the application results:
- CLAUDE.md line count before/after changes
- List of sections added/updated in AGENTS.md
- List of deleted cursor rules files
AGENTS.md minimization principles
When creating AGENTS.md anew or supplementing it, apply the principles below.
Core: "Keep only what the guide code cannot say." Do not separately consider skill-unused cases.
Keep (4 categories):
| Category | Content |
|---|---|
| Prohibitions | _commonimport only, no FK, no unnecessary optional/null/undefined for core domain types, no try-catch (Elysia), no isLoading |
| Design philosophy | Error handling (200+success:false / ErrorHandler), fully independent domains, no TDD/real DB/mocking |
| Conventions | 4 naming types (snake_case/kebab-case/PascalCase/camelCase), PK seq suffix, audit columns, DB Boolean CHAR(1) |
| Pointers | Guide code paths, quality verification commands, DB migration commands |
Remove:
- Content inferable from guide code → replace with guide code pointers
- Rules that linters (Biome/ESLint) can catch
- Code examples →
파일 경로 참조replace with 1 line
Target size: 95130 lines (5-section full-stack configuration: common+backend+frontend+test+autonomy. For the 4-section standalone configuration, peach-setup-ui-proto는 7090줄)
CLAUDE.md standard template
Organize the target project's CLAUDE.md in the format below. Preserve project-specific instructions in a separate section.
# {프로젝트명}
{한 줄 설명}
## 규칙 참조
모든 개발 규칙은 @AGENTS.md 를 참조하라.
## 세션 시작
`git status && git branch`로 현재 상태를 확인하세요.
## 가이드 코드
코드 생성 = **가이드 코드 참조(기본 골격)** → 도메인 분석 → 더 나은 구조라면 AI 자율 조정 → Adapt 사유 기록
- Backend: `api/src/modules/test-data/`
- Frontend: `front/src/modules/test-data/`
> 가이드 코드는 강제 표준이 아니다. "단일 사용처 추상화 금지" 원칙이 가이드 패턴보다 우선한다.
> 상세 원칙은 `peach-setup-harness/references/05-bounded-autonomy.md` 참조.
Core principles
- CLAUDE.md는 Within 20 lines keep
- Remove sections that overlap with AGENTS.md ("Claude-specific instructions", "Coding rules", etc.)
- Preserve project-specific instructions (Electron IPC, special environment variables, etc.) in a separate section
- "Guide code" section:
- Monorepo (api/+front/):
Backend: api/src/modules/test-data/+Frontend: front/src/modules/test-data/ - Standalone front/:
Frontend: front/src/modules/test-data/
- Monorepo (api/+front/):
Completion Criteria Checklist
Basic:
- CLAUDE.md is organized within 20 lines
- Duplicate content of AGENTS.md is removed from CLAUDE.md
- AGENTS.md consists of 5 sections (Common, Backend, Frontend, Test, BA)
- AGENTS.md is in the range of 95–130 lines
- Project-specific unique instructions are preserved
Additional:
- If it is an Elysia project, Elysia-specific items are included
- The tech stack is accurately reflected
- The references structure is correct (01, 02-koa/02-elysia, 03, 04, 05, 06)
- cursor rules are deleted (if they existed)
- Written with content suitable for the project environment (Koa/Elysia, DB type)
- §6 DB Data Verification section is included in projects with api/