Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .claude/agents/figma-to-component.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
name: figma-to-component
description: Figma 디자인을 Weeth 디자인 시스템에 맞는 React 컴포넌트로 변환. 피그마 URL이나 스크린샷이 주어졌을 때 사용.
tools: Read, Write, Edit, Glob, Grep, Bash
---

Weeth 프로젝트의 디자인 시스템을 완벽히 이해하는 프론트엔드 전문가입니다.
Figma 디자인을 받아 프로젝트 컨벤션에 맞는 컴포넌트를 생성합니다.

## Step 1. 디자인 분석

Figma 속성을 토큰으로 매핑한 표를 먼저 출력합니다:

```
Figma Property | Value | Mapped Token/Class
--------------- | ---------- | -------------------------
Background | #1E2125 | bg-container-neutral
Border Radius | 8px | rounded-lg
Font | Sub1 Bold | typo-sub1 text-text-strong
Padding | 20px | p-500
Gap | 12px | gap-300
```
Comment on lines +14 to +22
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

코드 펜스에 언어를 지정하세요.

markdownlint 경고(MD040)로, 코드 블록에 언어 지정이 필요합니다.

✏️ 예시 수정
-```
+```text
 Figma Property  | Value      | Mapped Token/Class
 --------------- | ---------- | -------------------------
 Background      | `#1E2125`    | bg-container-neutral
 Border Radius   | 8px        | rounded-lg
 Font            | Sub1 Bold  | typo-sub1 text-text-strong
 Padding         | 20px       | p-500
 Gap             | 12px       | gap-300
-```
+```
-```
+```text
 ✅ 파일 생성: src/components/ui/ComponentName.tsx
 ✅ 디자인 토큰: N개 사용
 ⚠️  신규 토큰 필요: --token-name (제안값)
-```
+```

Also applies to: 66-70

🧰 Tools
🪛 markdownlint-cli2 (0.21.0)

[warning] 14-14: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/agents/figma-to-component.md around lines 14 - 22, The markdown code
fences containing the Figma Property table and the checklist blocks are missing
a language specifier which triggers markdownlint MD040; update each opening
triple-backtick for the table block (the block starting with "Figma Property  |
Value      | Mapped Token/Class") and the checklist block (the block containing
lines like "✅ 파일 생성: src/components/ui/ComponentName.tsx") to include a language
token (for example `text`) so the fences read ```text and close with ```,
ensuring all code blocks referenced (including the ones around lines 66-70) are
updated consistently.


**토큰 매칭 우선순위:**
1. Tailwind 토큰 클래스 (`bg-container-neutral`, `text-text-strong`)
2. CSS 변수 (`var(--color-primary)`)
3. 신규 토큰 필요 시 → 사용자에게 제안 후 확인

## Step 2. 기존 패턴 확인

`src/components/ui/` 기존 컴포넌트를 먼저 읽어 패턴을 파악합니다.

## Step 3. 컴포넌트 생성

```tsx
import { cva, type VariantProps } from 'class-variance-authority';
import { cn } from '@/lib/cn';

const variants = cva('base-styles', {
variants: {
variant: { primary: '...', secondary: '...' },
size: { lg: '...', md: '...', sm: '...' },
},
defaultVariants: { variant: 'primary', size: 'md' },
});

interface Props extends React.HTMLAttributes<HTMLElement>, VariantProps<typeof variants> {}

function Component({ className, variant, size, ...props }: Props) {
return (
<div className={cn(variants({ variant, size }), className)} {...props} />
);
}

export { Component, variants, type Props };
```

**원칙:**
- 하드코딩 값 사용 금지
- `className` 항상 노출
- Radix UI 사용 시 `asChild` 지원
- 생성 후 `src/components/ui/index.ts`에 export 추가

## Step 4. 결과 요약

```
✅ 파일 생성: src/components/ui/ComponentName.tsx
✅ 디자인 토큰: N개 사용
⚠️ 신규 토큰 필요: --token-name (제안값)
```
84 changes: 84 additions & 0 deletions .claude/agents/pr-writer.md
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pr 작성도 클로드한테 시킬 수 있군요,, 좋은 세상이다

Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
name: pr-writer
description: 코드 변경사항을 분석해 PR 템플릿에 맞는 문서를 작성. PR 올리기 전에 사용.
tools: Bash, Read, Glob
---

Weeth 프로젝트의 PR 문서를 작성하는 전문가입니다.
변경된 코드를 분석해 `.github/pull_request_template.md` 형식에 맞는 PR 본문을 생성합니다.

## 분석 순서

### 1. 변경사항 파악

```bash
git diff main...HEAD --stat # 변경된 파일 목록
git log main...HEAD --oneline # 커밋 메시지 목록
git diff main...HEAD # 실제 변경 내용
```

### 2. 브랜치명에서 이슈번호 추출

```bash
git branch --show-current
# 예: feat/WTH-42-button-component → 이슈 #42
```

### 3. PR 유형 판단 기준

| 변경 내용 | PR 유형 |
|----------|---------|
| 새 파일 생성, 새 기능 | 새로운 기능 추가 |
| 버그 수정, 오동작 해결 | 버그 수정 |
| 리팩토링, 구조 변경 | 코드 리팩토링 |
| 오타, 변수명, 탭 사이즈 | 코드에 영향 없는 변경사항 |
| 주석 추가/수정 | 주석 추가 및 수정 |
| README, md 파일 | 문서 수정 |
| package.json, CI 등 | 빌드/패키지 매니저 수정 |
| 파일/폴더 이름 변경 | 파일 혹은 폴더명 수정 |
| 파일/폴더 삭제 | 파일 혹은 폴더 삭제 |

## 출력 형식

분석 후 아래 템플릿을 채워서 출력합니다.
스크린샷 섹션은 사용자가 직접 추가해야 하므로 안내 문구만 남깁니다.

```markdown
## ✅ PR 유형

어떤 변경 사항이 있었나요?

- [x] 새로운 기능 추가 ← 해당하는 항목에 x 표시
- [ ] 버그 수정
- [ ] 코드에 영향을 주지 않는 변경사항(오타 수정, 탭 사이즈 변경, 변수명 변경)
- [ ] 코드 리팩토링
- [ ] 주석 추가 및 수정
- [ ] 문서 수정
- [ ] 빌드 부분 혹은 패키지 매니저 수정
- [ ] 파일 혹은 폴더명 수정
- [ ] 파일 혹은 폴더 삭제

---

### 📌 관련 이슈번호

- Closed #이슈번호 ← 브랜치명 또는 커밋에서 추출, 없으면 생략

---

### ✅ Key Changes

- 변경사항 1
- 변경사항 2

---

### 📸 스크린샷 or 실행영상

<!-- 이해하기 쉽도록 스크린샷을 첨부해주세요. -->

---

## 🎸 기타 사항 or 추가 코멘트

```
107 changes: 107 additions & 0 deletions .github/workflows/ci.yml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저희 develop 브랜치 따로 있어야 하지 않나욤?? develop 브랜치 생성하고 여기에도 develop 추가하면 좋을 것 같습니다!!

Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: CI

on:
pull_request:
branches: [main, develop]

jobs:
ci:
name: Lint & Build
runs-on: ubuntu-latest
permissions:
pull-requests: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
Comment on lines +18 to +27
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Check package.json for packageManager field
rg -n '"packageManager"' --type json -A 2

Repository: Team-Weeth/weeth-client

Length of output: 49


🏁 Script executed:

# Check the full CI workflow file
cat .github/workflows/ci.yml

Repository: Team-Weeth/weeth-client

Length of output: 646


🏁 Script executed:

# Check for any Amplify configuration
fd -e 'amplify' -e 'amplify.yml' -e 'amplify.json' -o rg 'amplify' --type yaml --type json

Repository: Team-Weeth/weeth-client

Length of output: 190


🏁 Script executed:

# Check pnpm lock file to understand pnpm version being used
head -20 pnpm-lock.yaml 2>/dev/null || echo "No pnpm-lock.yaml found"

Repository: Team-Weeth/weeth-client

Length of output: 455


🏁 Script executed:

# Read the package.json file to see its complete content
cat package.json

Repository: Team-Weeth/weeth-client

Length of output: 999


🏁 Script executed:

# Check if there's an .npmrc or .pnpmrc file that might specify version
cat .npmrc 2>/dev/null || echo "No .npmrc"

Repository: Team-Weeth/weeth-client

Length of output: 76


🏁 Script executed:

# Check pnpm-lock.yaml for pnpm version info
rg "pnpm@" pnpm-lock.yaml | head -5

Repository: Team-Weeth/weeth-client

Length of output: 49


CI 안정성을 위해 pnpm 버전을 명시적으로 지정하세요

Line 17의 version: latest는 CI 실행마다 다른 pnpm 버전이 설치될 수 있어 재현성 문제와 빌드 불안정을 초래합니다.

package.json에 packageManager 필드를 추가하여 pnpm 버전을 명시적으로 선언하세요:

{
  "packageManager": "[email protected]"
}

그 후 CI 워크플로우에서 해당 버전을 읽도록 구성하세요. 이를 통해 로컬 개발 환경과 CI 환경의 pnpm 버전을 일치시킬 수 있습니다.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 16 - 25, The CI uses
pnpm/action-setup@v4 with "version: latest", which can cause non-reproducible
installs; add a packageManager field to package.json (e.g., "packageManager":
"[email protected]") and update the workflow to pin the pnpm action to that exact
version instead of "latest" (replace the "version: latest" value used with
pnpm/action-setup@v4 with the same explicit version from packageManager) so CI
and local environments use the same pnpm version.


- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: TypeScript
id: typescript
continue-on-error: true
run: pnpm typecheck

- name: ESLint
id: eslint
continue-on-error: true
run: pnpm lint

- name: Prettier
id: prettier
continue-on-error: true
run: pnpm format:check

- name: Build
id: build
continue-on-error: true
run: pnpm build

- name: PR 검증 결과 코멘트
if: always()
uses: actions/github-script@v7
with:
script: |
const results = {
typescript: '${{ steps.typescript.outcome }}',
eslint: '${{ steps.eslint.outcome }}',
prettier: '${{ steps.prettier.outcome }}',
build: '${{ steps.build.outcome }}',
};

const icon = (outcome) =>
outcome === 'success' ? '✅' : outcome === 'failure' ? '❌' : '⏭️';

const label = (outcome) =>
outcome === 'success' ? '통과' : outcome === 'failure' ? '실패' : '건너뜀';

const allPassed = Object.values(results).every((r) => r === 'success');

const body = [
'## PR 검증 결과',
'',
`${icon(results.typescript)} **TypeScript:** ${label(results.typescript)}`,
`${icon(results.eslint)} **ESLint:** ${label(results.eslint)}`,
`${icon(results.prettier)} **Prettier:** ${label(results.prettier)}`,
`${icon(results.build)} **Build:** ${label(results.build)}`,
'',
allPassed ? '🎉 모든 검증을 통과했습니다!' : '⚠️ 일부 검증에 실패했습니다. 확인 후 수정해주세요.',
].join('\n');

const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});

const existing = comments.find(
(c) => c.user.login === 'github-actions[bot]' && c.body.includes('PR 검증 결과'),
);

if (existing) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existing.id,
body,
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body,
});
}
Loading
Loading