@walwal-harness/cli 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/assets/templates/AGENTS.md.template +52 -0
  2. package/assets/templates/HARNESS.md +159 -0
  3. package/assets/templates/config.json +108 -0
  4. package/assets/templates/progress.txt.template +15 -0
  5. package/bin/init.js +281 -0
  6. package/gotchas/README.md +37 -0
  7. package/gotchas/evaluator-functional.md +5 -0
  8. package/gotchas/evaluator-visual.md +5 -0
  9. package/gotchas/generator-backend.md +5 -0
  10. package/gotchas/generator-frontend.md +5 -0
  11. package/gotchas/planner.md +5 -0
  12. package/package.json +35 -0
  13. package/scripts/init-agents-md.sh +327 -0
  14. package/scripts/scan-project.sh +269 -0
  15. package/skills/dispatcher/SKILL.md +53 -0
  16. package/skills/dispatcher/references/gotcha-flow.md +52 -0
  17. package/skills/dispatcher/references/initialization.md +53 -0
  18. package/skills/dispatcher/references/pipeline-definitions.md +76 -0
  19. package/skills/evaluator-functional/SKILL.md +58 -0
  20. package/skills/evaluator-functional/references/ia-compliance.md +37 -0
  21. package/skills/evaluator-functional/references/playwright-tools.md +43 -0
  22. package/skills/evaluator-functional/references/scoring-rubric.md +52 -0
  23. package/skills/evaluator-visual/SKILL.md +41 -0
  24. package/skills/evaluator-visual/references/responsive-checklist.md +44 -0
  25. package/skills/evaluator-visual/references/scoring-rubric.md +59 -0
  26. package/skills/generator-backend/SKILL.md +43 -0
  27. package/skills/generator-backend/references/nestjs-msa-patterns.md +69 -0
  28. package/skills/generator-backend/references/sprint-contract-be.md +32 -0
  29. package/skills/generator-frontend/SKILL.md +49 -0
  30. package/skills/generator-frontend/references/anti-slop-rules.md +21 -0
  31. package/skills/generator-frontend/references/component-patterns.md +52 -0
  32. package/skills/planner/SKILL.md +48 -0
  33. package/skills/planner/references/api-contract-schema.md +34 -0
  34. package/skills/planner/references/ia-map-guide.md +31 -0
  35. package/skills/planner/references/plan-template.md +51 -0
@@ -0,0 +1,32 @@
1
+ # Sprint Contract — Backend Section Template
2
+
3
+ ```markdown
4
+ ## Backend Scope
5
+
6
+ ### Services Affected
7
+ | Service | Port | Changes |
8
+ |---------|------|---------|
9
+ | gateway | 3000 | EP-XXX 라우팅 추가 |
10
+ | service-a | 3001 | message_pattern 핸들러 추가 |
11
+
12
+ ### Message Patterns
13
+ | Pattern | From | To | Payload | Response |
14
+ |---------|------|----|---------|----------|
15
+ | create_item | gateway | service-a | CreateItemDto | ItemResponse |
16
+
17
+ ### Database Schema Changes
18
+ - Service-A DB: items (id, name, description, created_at, updated_at)
19
+
20
+ ### Shared DTOs (libs/shared-dto)
21
+ - CreateItemDto: { name: string, description?: string }
22
+ - ItemResponse: { id: number, name: string, created_at: string }
23
+
24
+ ### Success Criteria (Backend)
25
+ 1. [ ] Gateway → POST /api/v1/items → service-a → 201
26
+ 2. [ ] 유효성 검증 — 빈 name → 400
27
+ 3. [ ] 서비스 간 TCP 통신 정상
28
+ 4. [ ] Jest 통과
29
+
30
+ ### Test Commands
31
+ curl -X POST http://localhost:3000/api/v1/items -H "Content-Type: application/json" -d '{"name":"Test"}'
32
+ ```
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: harness-generator-frontend
3
+ description: "하네스 Frontend Generator. React/Next.js + TypeScript로 UI 컴포넌트, 상태관리, API Gateway 연동을 구현한다. api-contract.json 기반으로 Gateway만 바라보며 내부 서비스 존재를 모른다."
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Generator-Frontend — React/Next.js
8
+
9
+ ## Startup
10
+
11
+ 1. `AGENTS.md` 읽기 — IA-MAP, 권한 확인
12
+ 2. `.harness/gotchas/generator-frontend.md` 읽기 — **과거 실수 반복 금지**
13
+ 3. `pwd` + `.harness/progress.txt` + `git log --oneline -20`
14
+ 4. `.harness/actions/api-contract.json` 읽기 — **Gateway가 유일한 API 인터페이스**
15
+ 5. `.harness/actions/feature-list.json` — `layer: "frontend"` 필터
16
+ 6. Gateway 확인: `curl -s http://localhost:3000/health`
17
+ 7. Frontend 시작: `cd apps/web && npm run dev`
18
+
19
+ ## AGENTS.md — 읽기 전용
20
+
21
+ `[FE]` + `→ Generator-Frontend` 소유 경로만 쓰기 가능.
22
+
23
+ ## Prerequisites
24
+
25
+ **Backend 통합 러너가 동작 중이어야 함.** Gateway 미응답 시 → STOP.
26
+
27
+ ## Sprint Workflow
28
+
29
+ 1. **Sprint Contract FE 섹션 추가** — 컴포넌트, API 연동, 성공 기준
30
+ 2. **구현** — API 타입 변환 + 컴포넌트 + 상태관리
31
+ 3. **Self-Verification** — tsc + Vitest
32
+ 4. **Handoff** → Evaluator-Functional
33
+
34
+ 컴포넌트 패턴 → [참조](references/component-patterns.md)
35
+ AI슬롭 방지 → [참조](references/anti-slop-rules.md)
36
+
37
+ ## 핵심 규칙
38
+
39
+ - api-contract.json → `src/api/types.ts` 1:1 변환
40
+ - API base URL: `http://localhost:3000` (Gateway만)
41
+ - 로딩/에러/빈 상태 3가지 필수 처리
42
+ - 시맨틱 HTML + 키보드 네비게이션
43
+ - Tailwind CSS, 4px 기반 spacing
44
+
45
+ ## 금지 사항
46
+
47
+ - Backend 코드 수정, Gateway 내부 서비스 직접 호출
48
+ - api-contract.json에 없는 엔드포인트 호출
49
+ - 인라인 스타일 남용, AI슬롭 패턴
@@ -0,0 +1,21 @@
1
+ # Anti-Slop Rules
2
+
3
+ ## 감점 패턴
4
+
5
+ | 패턴 | 감점 | 설명 |
6
+ |------|------|------|
7
+ | 보라색/파란색 그라디언트 + 흰 카드 | -2 | AI 기본 테마 답습 |
8
+ | 과도한 box-shadow 남발 | -1 | 모든 카드에 동일 그림자 |
9
+ | 기본 아이콘팩 무분별 사용 | -1 | 의미 없는 장식 아이콘 |
10
+ | "Welcome to [AppName]" 히어로 | -1 | 제너릭 랜딩 패턴 |
11
+ | 둥근 아바타 + 카드 그리드 | -1 | SaaS 템플릿 클리셰 |
12
+ | 전체 fade-in 애니메이션 | -1 | 로드 시 모든 요소 fade |
13
+ | 과도한 보더/구분선 | -1 | 시각적 노이즈 |
14
+
15
+ ## 대신 해야 할 것
16
+
17
+ - 프로젝트 고유 색상 팔레트 (CSS custom properties)
18
+ - 의미 있는 spacing scale (Tailwind 기본 scale 활용)
19
+ - 아이콘은 기능에 필요한 경우만
20
+ - 애니메이션은 사용자 피드백 목적만 (로딩, 전환)
21
+ - 타이포그래피 계층 명확히 (h1 > h2 > h3)
@@ -0,0 +1,52 @@
1
+ # Component Patterns
2
+
3
+ ## 프로젝트 구조
4
+
5
+ ```
6
+ apps/web/src/
7
+ ├── api/
8
+ │ ├── client.ts # fetch 인스턴스 (base: localhost:3000)
9
+ │ ├── types.ts # api-contract.json → TypeScript 1:1
10
+ │ └── [domain].ts # 도메인별 API 함수
11
+ ├── components/
12
+ │ ├── ui/ # Button, Input, Modal, Card
13
+ │ └── [domain]/ # 도메인별 컴포넌트
14
+ ├── pages/ (또는 app/)
15
+ ├── hooks/
16
+ │ └── use[Domain].ts
17
+ ├── stores/ # Zustand (클라이언트 상태만)
18
+ └── styles/
19
+ └── globals.css # Tailwind directives
20
+ ```
21
+
22
+ ## API 타입 변환
23
+
24
+ ```typescript
25
+ // api-contract.json의 response_200을 그대로 반영
26
+ interface ItemResponse {
27
+ id: number;
28
+ name: string;
29
+ created_at: string;
30
+ }
31
+ ```
32
+
33
+ ## 상태관리
34
+
35
+ - 서버 상태: TanStack Query (캐시, 리페치, 낙관적 업데이트)
36
+ - 클라이언트 상태: Zustand (최소한, 서버 상태와 중복 금지)
37
+
38
+ ## 3가지 상태 필수 처리
39
+
40
+ ```tsx
41
+ if (isLoading) return <Skeleton />;
42
+ if (error) return <ErrorMessage error={error} />;
43
+ if (data.length === 0) return <EmptyState />;
44
+ return <ItemList items={data} />;
45
+ ```
46
+
47
+ ## 접근성
48
+
49
+ - `<button>`, `<nav>`, `<main>`, `<form>` 시맨틱 태그
50
+ - `aria-label` 필요 시 추가
51
+ - Tab 순서 논리적, Enter/Escape 동작
52
+ - 색상 대비 4.5:1 이상
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: harness-planner
3
+ description: "하네스 Planner 에이전트. 사용자의 프로젝트 설명을 제품 사양(plan.md), 기능 목록(feature-list.json), API 계약서(api-contract.json), AGENTS.md로 확장. pipeline.json의 planner_mode(light/full)에 따라 동작."
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Planner Agent
8
+
9
+ ## Startup
10
+
11
+ 1. `AGENTS.md` 읽기
12
+ 2. `.harness/gotchas/planner.md` 읽기 — **과거 실수 반복 금지**
13
+ 3. `.harness/progress.txt` 읽기
14
+ 4. `.harness/actions/pipeline.json` 읽기 — `planner_mode` 확인
15
+
16
+ ## Outputs (4개)
17
+
18
+ | 파일 | 설명 |
19
+ |------|------|
20
+ | `actions/plan.md` | 제품 사양서 |
21
+ | `actions/feature-list.json` | 기능 추적 (layer + service 필드) |
22
+ | `actions/api-contract.json` | API 계약서 (Gateway ↔ Services ↔ Frontend) |
23
+ | `AGENTS.md` | IA-MAP 갱신 |
24
+
25
+ ## planner_mode
26
+
27
+ - **full**: MSA 서비스 분할 + 전체 설계 (FULLSTACK, BE-ONLY)
28
+ - **light**: OpenAPI → api-contract.json 변환 + FE 설계만 (FE-ONLY)
29
+
30
+ ## Process
31
+
32
+ 1. 사양서 작성 → [plan 템플릿](references/plan-template.md)
33
+ 2. API 계약서 → [api-contract 스키마](references/api-contract-schema.md)
34
+ 3. feature-list.json → layer/service/depends_on 필드 필수
35
+ 4. AGENTS.md IA-MAP 갱신 → [IA-MAP 가이드](references/ia-map-guide.md)
36
+
37
+ ## Constraints
38
+
39
+ - 기술 구현 세부사항은 Generator에 위임
40
+ - Sprint당 기능 3-5개 권장
41
+ - 각 기능에 `layer`, `service`, `depends_on` 명시
42
+ - API 계약의 스키마는 Pydantic/class-validator로 직접 변환 가능한 수준
43
+
44
+ ## After Completion
45
+
46
+ 1. `progress.txt` 업데이트 (Phase: PLANNED)
47
+ 2. 사용자에게 plan.md + api-contract.json 리뷰 요청
48
+ 3. 승인 후 → 다음 에이전트 (pipeline.json 참조)
@@ -0,0 +1,34 @@
1
+ # API Contract Schema
2
+
3
+ ```json
4
+ {
5
+ "version": "1.0.0",
6
+ "gateway_base_url": "/api/v1",
7
+ "services": {
8
+ "gateway": { "port": 3000, "description": "API Gateway" },
9
+ "service-a": { "port": 3001, "transport": "TCP", "description": "..." }
10
+ },
11
+ "endpoints": [
12
+ {
13
+ "id": "EP-001",
14
+ "method": "POST",
15
+ "path": "/api/v1/items",
16
+ "gateway_route": true,
17
+ "target_service": "service-a",
18
+ "message_pattern": "create_item",
19
+ "description": "...",
20
+ "request_body": { "name": "string (required)" },
21
+ "response_200": { "id": "number", "name": "string", "created_at": "string (ISO 8601)" },
22
+ "response_errors": [
23
+ { "status": 400, "when": "유효성 검증 실패" }
24
+ ],
25
+ "related_features": ["F-001"]
26
+ }
27
+ ]
28
+ }
29
+ ```
30
+
31
+ ## 규칙
32
+ - Gateway가 외부 진입점, 내부 서비스는 message pattern으로 통신
33
+ - request/response 스키마는 Pydantic/class-validator로 직접 변환 가능한 수준
34
+ - 이 계약서가 Frontend ↔ Gateway ↔ Services 간 유일한 진실의 원천
@@ -0,0 +1,31 @@
1
+ # IA-MAP Guide
2
+
3
+ ## 형식
4
+
5
+ ```
6
+ ├── path/to/dir/ # [TAG] 한줄 설명 → 소유 에이전트
7
+ ```
8
+
9
+ ## 태그
10
+
11
+ | 태그 | 의미 | 소유 |
12
+ |------|------|------|
13
+ | `[BE]` | Backend | Generator-Backend |
14
+ | `[FE]` | Frontend | Generator-Frontend |
15
+ | `[HARNESS]` | 하네스 시스템 | Planner / Evaluator |
16
+ | `[META]` | 프로젝트 메타 | Planner |
17
+ | `[INFRA]` | 인프라/배포 | Planner |
18
+ | `[TEST]` | 테스트 코드 | Evaluator / Generator |
19
+ | `[?]` | 미분류 | TBD (Planner가 확정) |
20
+
21
+ ## 갱신 시점
22
+
23
+ - Sprint 0 (최초): 전체 구조 설계
24
+ - Sprint 간 전환: 새 폴더/파일 반영, Change Request 처리
25
+ - Generator/Evaluator가 남긴 Change Request 검토 후 반영
26
+
27
+ ## 규칙
28
+
29
+ - Planner만 AGENTS.md 수정 가능
30
+ - Generator는 sprint-contract.md에 `## Change Request`로 요청
31
+ - Evaluator는 evaluation에 `## AGENTS.md Drift`로 보고
@@ -0,0 +1,51 @@
1
+ # Plan Template
2
+
3
+ ```markdown
4
+ # Product Specification: [제품명]
5
+
6
+ ## 1. Vision & Value Proposition
7
+ [왜 이 제품이 존재해야 하는가]
8
+
9
+ ## 2. User Persona
10
+ [타겟 사용자, 사용 시나리오]
11
+
12
+ ## 3. System Architecture
13
+
14
+ ### 3.1 MSA Service Map
15
+ - API Gateway (NestJS) — 라우팅, 인증, 레이트리밋
16
+ - Service A: [도메인] — [책임]
17
+ - Service B: [도메인] — [책임]
18
+
19
+ ### 3.2 Communication
20
+ - Dev: TCP transport
21
+ - Prod: RabbitMQ / NATS
22
+
23
+ ### 3.3 Monorepo Structure
24
+ project-root/
25
+ ├── apps/
26
+ │ ├── gateway/
27
+ │ ├── service-a/
28
+ │ └── web/
29
+ ├── libs/
30
+ │ ├── shared-dto/
31
+ │ ├── database/
32
+ │ └── common/
33
+ └── package.json
34
+
35
+ ### 3.4 Tech Stack Decisions
36
+ - 각 결정의 **근거** 포함
37
+
38
+ ## 4. Data Model
39
+ [서비스별 핵심 엔티티 — 서비스 경계 명확히]
40
+
41
+ ## 5. Sprint Roadmap
42
+ ### Sprint 1: [테마]
43
+ - BE-Gateway: [작업]
44
+ - BE-ServiceA: [작업]
45
+ - FE: [작업]
46
+ - 의존성: [선행 조건]
47
+
48
+ ## 6. AI Integration Opportunities
49
+
50
+ ## 7. Non-Functional Requirements
51
+ ```