@wondev/dotenv-example 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.
- package/.claude/README.md +60 -0
- package/.claude/commands/business_logic.md +143 -0
- package/.claude/commands/generate-prd.md +175 -0
- package/.claude/commands/gotobackend.md +569 -0
- package/.claude/commands/playwrightMCP_install.md +113 -0
- package/.claude/commands/setting_dev.md +731 -0
- package/.claude/commands/tech-lead.md +404 -0
- package/.claude/commands/user-flow.md +839 -0
- package/.claude/settings.local.json +9 -0
- package/.cursor/README.md +10 -0
- package/.cursor/mcp.json +31 -0
- package/.cursor/rules/common/cursor-rules.mdc +53 -0
- package/.cursor/rules/common/git-convention.mdc +86 -0
- package/.cursor/rules/common/self-improve.mdc +72 -0
- package/.cursor/rules/common/tdd.mdc +81 -0
- package/.cursor/rules/common/vibe-coding.mdc +114 -0
- package/.cursor/rules/supabase/supabase-bootstrap-auth.mdc +236 -0
- package/.cursor/rules/supabase/supabase-create-db-functions.mdc +136 -0
- package/.cursor/rules/supabase/supabase-create-migration.mdc +50 -0
- package/.cursor/rules/supabase/supabase-create-rls-policies.mdc +248 -0
- package/.cursor/rules/supabase/supabase-declarative-database-schema.mdc +78 -0
- package/.cursor/rules/supabase/supabase-postgres-sql-style-guide.mdc +133 -0
- package/.cursor/rules/supabase/supabase-writing-edge-functions.mdc +105 -0
- package/.cursor/rules/web/design-rules.mdc +381 -0
- package/.cursor/rules/web/nextjs-convention.mdc +237 -0
- package/.cursor/rules/web/playwright-test-guide.mdc +176 -0
- package/.cursor/rules/web/toss-frontend.mdc +695 -0
- package/.env +4 -0
- package/CLAUDE.md +40 -0
- package/README.md +7 -0
- package/bin/index.js +66 -0
- package/package.json +32 -0
- package/prompts/20250926_175606.md +3 -0
- package/prompts/20250926_180205.md +148 -0
package/.cursor/mcp.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcpServers": {
|
|
3
|
+
"sequential-thinking": {
|
|
4
|
+
"command": "bunx",
|
|
5
|
+
"args": ["@modelcontextprotocol/server-sequential-thinking"]
|
|
6
|
+
},
|
|
7
|
+
"context7": {
|
|
8
|
+
"command": "bunx",
|
|
9
|
+
"args": ["@upstash/context7-mcp"]
|
|
10
|
+
},
|
|
11
|
+
"playwright": {
|
|
12
|
+
"command": "bunx",
|
|
13
|
+
"args": ["@playwright/mcp@latest"]
|
|
14
|
+
},
|
|
15
|
+
"supabase": {
|
|
16
|
+
"command": "bunx",
|
|
17
|
+
"args": [
|
|
18
|
+
"@supabase/mcp-server-supabase@latest",
|
|
19
|
+
"--access-token",
|
|
20
|
+
"your_supabase_access_token"
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
"notionApi": {
|
|
24
|
+
"command": "bunx",
|
|
25
|
+
"args": ["@notionhq/notion-mcp-server"],
|
|
26
|
+
"env": {
|
|
27
|
+
"OPENAPI_MCP_HEADERS": "{\"Authorization\": \"Bearer your_notion_access_token\", \"Notion-Version\": \"2022-06-28\" }"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Guidelines for creating and maintaining Cursor rules to ensure consistency and effectiveness.
|
|
3
|
+
globs: .cursor/rules/*.mdc
|
|
4
|
+
alwaysApply: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
- **Required Rule Structure:**
|
|
8
|
+
```markdown
|
|
9
|
+
---
|
|
10
|
+
description: Clear, one-line description of what the rule enforces
|
|
11
|
+
globs: path/to/files/*.ext, other/path/**/*
|
|
12
|
+
alwaysApply: boolean
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
- **Main Points in Bold**
|
|
16
|
+
- Sub-points with details
|
|
17
|
+
- Examples and explanations
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
- **File References:**
|
|
21
|
+
- Use `[filename](mdc:path/to/file)` ([filename](mdc:filename)) to reference files
|
|
22
|
+
- Example: [prisma.mdc](mdc:.cursor/rules/prisma.mdc) for rule references
|
|
23
|
+
- Example: [schema.prisma](mdc:prisma/schema.prisma) for code references
|
|
24
|
+
|
|
25
|
+
- **Code Examples:**
|
|
26
|
+
- Use language-specific code blocks
|
|
27
|
+
```typescript
|
|
28
|
+
// ✅ DO: Show good examples
|
|
29
|
+
const goodExample = true;
|
|
30
|
+
|
|
31
|
+
// ❌ DON'T: Show anti-patterns
|
|
32
|
+
const badExample = false;
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
- **Rule Content Guidelines:**
|
|
36
|
+
- Start with high-level overview
|
|
37
|
+
- Include specific, actionable requirements
|
|
38
|
+
- Show examples of correct implementation
|
|
39
|
+
- Reference existing code when possible
|
|
40
|
+
- Keep rules DRY by referencing other rules
|
|
41
|
+
|
|
42
|
+
- **Rule Maintenance:**
|
|
43
|
+
- Update rules when new patterns emerge
|
|
44
|
+
- Add examples from actual codebase
|
|
45
|
+
- Remove outdated patterns
|
|
46
|
+
- Cross-reference related rules
|
|
47
|
+
|
|
48
|
+
- **Best Practices:**
|
|
49
|
+
- Use bullet points for clarity
|
|
50
|
+
- Keep descriptions concise
|
|
51
|
+
- Include both DO and DON'T examples
|
|
52
|
+
- Reference actual code over theoretical examples
|
|
53
|
+
- Use consistent formatting across rules
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Git convention defining branch naming, commit message format, and issue labeling based on GitFlow and Conventional Commits.
|
|
3
|
+
globs:
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
# Git Convention
|
|
7
|
+
|
|
8
|
+
- 깃 브랜치 전략은 GitFlow를 따르며 이를 기반으로 한 브랜치 네이밍 컨벤션을 사용합니다.
|
|
9
|
+
- 브랜치 네이밍 형식: `type/[branch/]description[-#issue]`
|
|
10
|
+
- [] 안의 내용은 선택 사항입니다.
|
|
11
|
+
- `type`: 브랜치 타입
|
|
12
|
+
- `branch`: 분기한 브랜치명 (e.g. `dev`, `main`)
|
|
13
|
+
- `description`: 브랜치 설명
|
|
14
|
+
- `issue`: 관련된 이슈 번호
|
|
15
|
+
|
|
16
|
+
## Branch Type Description
|
|
17
|
+
|
|
18
|
+
- **feat** (feature)
|
|
19
|
+
새로운 기능을 추가할 때 사용합니다.
|
|
20
|
+
예: `feat/login-#123`
|
|
21
|
+
- **fix** (bug fix)
|
|
22
|
+
버그를 수정할 때 사용합니다.
|
|
23
|
+
예: `fix/button-click-#456`
|
|
24
|
+
- **docs** (documentation)
|
|
25
|
+
문서 작업(README, 주석 등)을 할 때 사용합니다.
|
|
26
|
+
예: `docs/api-docs-#789`
|
|
27
|
+
- **style** (formatting, missing semi colons, …)
|
|
28
|
+
코드 스타일(포맷 수정, 세미콜론 추가 등)을 수정할 때 사용합니다. 기능 수정은 포함되지 않습니다.
|
|
29
|
+
예: `style/css-format-#101`
|
|
30
|
+
- **refactor**
|
|
31
|
+
코드 리팩토링(기능 변경 없이 코드 구조 개선)을 할 때 사용합니다.
|
|
32
|
+
예: `refactor/auth-service-#102`
|
|
33
|
+
- **test** (when adding missing tests)
|
|
34
|
+
테스트 코드를 추가하거나 수정할 때 사용합니다.
|
|
35
|
+
예: `test/unit-tests-#103`
|
|
36
|
+
- **chore** (maintain)
|
|
37
|
+
프로젝트 유지 보수 작업(빌드 설정, 패키지 업데이트 등)을 할 때 사용합니다.
|
|
38
|
+
예: `chore/dependency-update-#104`
|
|
39
|
+
|
|
40
|
+
## Commit Message Convention
|
|
41
|
+
|
|
42
|
+
`git config --local commit.template .github/.gitmessage` 명령어를 통해 커밋 메시지 템플릿을 설정할 수 있습니다.
|
|
43
|
+
컨벤션 내용은 AngularJS Git Commit Message Conventions와 Conventional Commits을 기반으로 작성되어 있으며 `.github/.gitmessage` 파일에 작성되어 있습니다.
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
# commit message template
|
|
47
|
+
#=================#
|
|
48
|
+
# <type>(<scope>): <subject>
|
|
49
|
+
# <BLANK LINE>
|
|
50
|
+
# <body>
|
|
51
|
+
# <BLANK LINE>
|
|
52
|
+
# <footer>
|
|
53
|
+
#=================#
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
# Any line of the commit message cannot be longer 100 characters! This allows the message to be easier to read on github as well as in various git tools.
|
|
57
|
+
|
|
58
|
+
## Subject line
|
|
59
|
+
# Subject line contains succinct description of the change.
|
|
60
|
+
|
|
61
|
+
# Allowed `<type>`
|
|
62
|
+
# feat (feature): 새로운 기능 추가
|
|
63
|
+
# fix (bug fix): 버그 수정
|
|
64
|
+
# docs (documentation): 문서 작업
|
|
65
|
+
# style (formatting, missing semi colons, …): 코드 스타일 수정
|
|
66
|
+
# refactor: 기능 변경 없이 코드 구조 개선
|
|
67
|
+
# test (when adding missing tests): 테스트 코드 추가 또는 기존 테스트 수정
|
|
68
|
+
# chore (maintain): 빌드, 패키지 매니저 설정 등 코드 수정이 없는 작업
|
|
69
|
+
|
|
70
|
+
# Allowed `<scope>`
|
|
71
|
+
# Scope could be anything specifying place of the commit change. For example $location, $browser, $compile, $rootScope, ngHref, ngClick, ngView, etc...
|
|
72
|
+
|
|
73
|
+
# `<subject>` text
|
|
74
|
+
# - use imperative, present tense: “change” not “changed” nor “changes”
|
|
75
|
+
# - don't capitalize first letter
|
|
76
|
+
# - no dot (.) at the end
|
|
77
|
+
|
|
78
|
+
## Message body
|
|
79
|
+
# - just as in <subject> use imperative, present tense: “change” not “changed” nor “changes”
|
|
80
|
+
# - includes motivation for the change and contrasts with previous behavior
|
|
81
|
+
...
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Issue Label Setting
|
|
85
|
+
|
|
86
|
+
`github-label-sync --access-token <access_token> --labels .github/labels.json <owner>/<repo>`
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Guidelines for continuously improving Cursor rules based on emerging code patterns and best practices.
|
|
3
|
+
globs: **/*
|
|
4
|
+
alwaysApply: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
- **Rule Improvement Triggers:**
|
|
8
|
+
- New code patterns not covered by existing rules
|
|
9
|
+
- Repeated similar implementations across files
|
|
10
|
+
- Common error patterns that could be prevented
|
|
11
|
+
- New libraries or tools being used consistently
|
|
12
|
+
- Emerging best practices in the codebase
|
|
13
|
+
|
|
14
|
+
- **Analysis Process:**
|
|
15
|
+
- Compare new code with existing rules
|
|
16
|
+
- Identify patterns that should be standardized
|
|
17
|
+
- Look for references to external documentation
|
|
18
|
+
- Check for consistent error handling patterns
|
|
19
|
+
- Monitor test patterns and coverage
|
|
20
|
+
|
|
21
|
+
- **Rule Updates:**
|
|
22
|
+
- **Add New Rules When:**
|
|
23
|
+
- A new technology/pattern is used in 3+ files
|
|
24
|
+
- Common bugs could be prevented by a rule
|
|
25
|
+
- Code reviews repeatedly mention the same feedback
|
|
26
|
+
- New security or performance patterns emerge
|
|
27
|
+
|
|
28
|
+
- **Modify Existing Rules When:**
|
|
29
|
+
- Better examples exist in the codebase
|
|
30
|
+
- Additional edge cases are discovered
|
|
31
|
+
- Related rules have been updated
|
|
32
|
+
- Implementation details have changed
|
|
33
|
+
|
|
34
|
+
- **Example Pattern Recognition:**
|
|
35
|
+
```typescript
|
|
36
|
+
// If you see repeated patterns like:
|
|
37
|
+
const data = await prisma.user.findMany({
|
|
38
|
+
select: { id: true, email: true },
|
|
39
|
+
where: { status: 'ACTIVE' }
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// Consider adding to [prisma.mdc](mdc:.cursor/rules/prisma.mdc):
|
|
43
|
+
// - Standard select fields
|
|
44
|
+
// - Common where conditions
|
|
45
|
+
// - Performance optimization patterns
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
- **Rule Quality Checks:**
|
|
49
|
+
- Rules should be actionable and specific
|
|
50
|
+
- Examples should come from actual code
|
|
51
|
+
- References should be up to date
|
|
52
|
+
- Patterns should be consistently enforced
|
|
53
|
+
|
|
54
|
+
- **Continuous Improvement:**
|
|
55
|
+
- Monitor code review comments
|
|
56
|
+
- Track common development questions
|
|
57
|
+
- Update rules after major refactors
|
|
58
|
+
- Add links to relevant documentation
|
|
59
|
+
- Cross-reference related rules
|
|
60
|
+
|
|
61
|
+
- **Rule Deprecation:**
|
|
62
|
+
- Mark outdated patterns as deprecated
|
|
63
|
+
- Remove rules that no longer apply
|
|
64
|
+
- Update references to deprecated rules
|
|
65
|
+
- Document migration paths for old patterns
|
|
66
|
+
|
|
67
|
+
- **Documentation Updates:**
|
|
68
|
+
- Keep examples synchronized with code
|
|
69
|
+
- Update references to external docs
|
|
70
|
+
- Maintain links between related rules
|
|
71
|
+
- Document breaking changes
|
|
72
|
+
Follow [cursor_rules.mdc](mdc:.cursor/rules/cursor_rules.mdc) for proper rule formatting and structure.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Guidelines for writing tests and implementing code following TDD and Tidy First principles.
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Always follow the instructions in plan.md. When I say "go", find the next unmarked test in plan.md, implement the test, then implement only enough code to make that test pass.
|
|
7
|
+
|
|
8
|
+
# ROLE AND EXPERTISE
|
|
9
|
+
|
|
10
|
+
You are a senior software engineer who follows Kent Beck's Test-Driven Development (TDD) and Tidy First principles. Your purpose is to guide development following these methodologies precisely.
|
|
11
|
+
|
|
12
|
+
# CORE DEVELOPMENT PRINCIPLES
|
|
13
|
+
|
|
14
|
+
- Always follow the TDD cycle: Red → Green → Refactor
|
|
15
|
+
- Write the simplest failing test first
|
|
16
|
+
- Implement the minimum code needed to make tests pass
|
|
17
|
+
- Refactor only after tests are passing
|
|
18
|
+
- Follow Beck's "Tidy First" approach by separating structural changes from behavioral changes
|
|
19
|
+
- Maintain high code quality throughout development
|
|
20
|
+
|
|
21
|
+
# TDD METHODOLOGY GUIDANCE
|
|
22
|
+
|
|
23
|
+
- Start by writing a failing test that defines a small increment of functionality
|
|
24
|
+
- Use meaningful test names that describe behavior (e.g., "shouldSumTwoPositiveNumbers")
|
|
25
|
+
- Make test failures clear and informative
|
|
26
|
+
- Write just enough code to make the test pass - no more
|
|
27
|
+
- Once tests pass, consider if refactoring is needed
|
|
28
|
+
- Repeat the cycle for new functionality
|
|
29
|
+
|
|
30
|
+
# TIDY FIRST APPROACH
|
|
31
|
+
|
|
32
|
+
- Separate all changes into two distinct types:
|
|
33
|
+
1. STRUCTURAL CHANGES: Rearranging code without changing behavior (renaming, extracting methods, moving code)
|
|
34
|
+
2. BEHAVIORAL CHANGES: Adding or modifying actual functionality
|
|
35
|
+
- Never mix structural and behavioral changes in the same commit
|
|
36
|
+
- Always make structural changes first when both are needed
|
|
37
|
+
- Validate structural changes do not alter behavior by running tests before and after
|
|
38
|
+
|
|
39
|
+
# COMMIT DISCIPLINE
|
|
40
|
+
|
|
41
|
+
- Only commit when:
|
|
42
|
+
1. ALL tests are passing
|
|
43
|
+
2. ALL compiler/linter warnings have been resolved
|
|
44
|
+
3. The change represents a single logical unit of work
|
|
45
|
+
4. Commit messages clearly state whether the commit contains structural or behavioral changes
|
|
46
|
+
- Use small, frequent commits rather than large, infrequent ones
|
|
47
|
+
|
|
48
|
+
# CODE QUALITY STANDARDS
|
|
49
|
+
|
|
50
|
+
- Eliminate duplication ruthlessly
|
|
51
|
+
- Express intent clearly through naming and structure
|
|
52
|
+
- Make dependencies explicit
|
|
53
|
+
- Keep methods small and focused on a single responsibility
|
|
54
|
+
- Minimize state and side effects
|
|
55
|
+
- Use the simplest solution that could possibly work
|
|
56
|
+
|
|
57
|
+
# REFACTORING GUIDELINES
|
|
58
|
+
|
|
59
|
+
- Refactor only when tests are passing (in the "Green" phase)
|
|
60
|
+
- Use established refactoring patterns with their proper names
|
|
61
|
+
- Make one refactoring change at a time
|
|
62
|
+
- Run tests after each refactoring step
|
|
63
|
+
- Prioritize refactorings that remove duplication or improve clarity
|
|
64
|
+
|
|
65
|
+
# EXAMPLE WORKFLOW
|
|
66
|
+
|
|
67
|
+
When approaching a new feature:
|
|
68
|
+
|
|
69
|
+
1. Write a simple failing test for a small part of the feature
|
|
70
|
+
2. Implement the bare minimum to make it pass
|
|
71
|
+
3. Run tests to confirm they pass (Green)
|
|
72
|
+
4. Make any necessary structural changes (Tidy First), running tests after each change
|
|
73
|
+
5. Commit structural changes separately
|
|
74
|
+
6. Add another test for the next small increment of functionality
|
|
75
|
+
7. Repeat until the feature is complete, committing behavioral changes separately from structural ones
|
|
76
|
+
|
|
77
|
+
Follow this process precisely, always prioritizing clean, well-tested code over quick implementation.
|
|
78
|
+
|
|
79
|
+
Always write one test at a time, make it run, then improve structure. Always run all the tests (except long-running tests) each time.
|
|
80
|
+
|
|
81
|
+
<!-- https://www.stdy.blog/warning-signs-for-off-track-ai-and-tdd-system-prompts-by-kent-beck/ -->
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Core rules for AI-assisted Vibe Coding: Focus on TDD with mandatory external search for error resolution, robust context management (early file documentation, small modules, .cursor & README usage), incremental refactoring, and supportive user interaction, including automated quality fixes.
|
|
3
|
+
globs:
|
|
4
|
+
alwaysApply: true
|
|
5
|
+
---
|
|
6
|
+
# Rules for Vibe Coding
|
|
7
|
+
|
|
8
|
+
## General Coding Guidance
|
|
9
|
+
|
|
10
|
+
- 생성하는 모든 코드는 명확하고, 간결하며, 유지보수 가능해야 합니다.
|
|
11
|
+
- 복잡한 로직은 단순화하고 불필요한 추상화는 피하십시오. 꼭 필요한 경우에만 도입하여 복잡성을 관리하십시오.
|
|
12
|
+
- 모든 공개 API 및 복잡한 로직에는 명확한 주석(예: JSDoc, Python Docstrings)을 작성하십시오. 코드의 의도와 작동 방식을 설명해야 합니다.
|
|
13
|
+
- 오류 처리는 항상 명시적으로 수행하며, 사용자에게 친화적인 오류 메시지를 제공하십시오. 단순한 try-catch 블록으로 오류를 숨기지 마십시오.
|
|
14
|
+
- 보안을 최우선으로 고려하여 코드를 작성하십시오. 잠재적인 취약점(예: SQL 인젝션, XSS, API 키 노출)을 방지하기 위한 검증 및 이스케이프 처리를 철저히 하십시오.
|
|
15
|
+
- 성능을 고려하여 효율적인 알고리즘과 데이터 구조를 선택하십시오. 불필요한 반복이나 계산을 피하십시오.
|
|
16
|
+
|
|
17
|
+
## Test-Driven Development (TDD)
|
|
18
|
+
|
|
19
|
+
- 기능 구현 요청 시, 먼저 해당 기능의 요구사항을 충족하는 포괄적인 단위 테스트 케이스를 작성하십시오. (필요시 통합 테스트 포함)
|
|
20
|
+
- 테스트 케이스는 긍정적 케이스, 부정적 케이스, 엣지 케이스를 모두 포함해야 합니다.
|
|
21
|
+
- 테스트 케이스 작성 후, 해당 테스트를 통과하는 최소한의 코드를 구현하십시오.
|
|
22
|
+
- 코드 구현 후 모든 테스트를 실행하고, 실패하는 테스트가 있다면 해당 테스트를 통과하도록 코드를 수정하십시오. 이 과정을 모든 테스트가 통과할 때까지 반복하십시오. 각 수정 시도 전, 웹 검색 또는 공식 문서 (context7 mcp 활용 등) 조사를 필수로 수행해야 합니다.
|
|
23
|
+
- 최대 3회를 초과하여 동일한 오류 수정 루프에 빠지지 않도록 주의하고, 해결이 어려울 경우 사용자에게 도움을 요청하십시오.
|
|
24
|
+
- 사용자로부터 테스트 실패 로그가 제공되면, 해당 로그를 분석하여 문제의 원인을 파악하고 코드를 수정하십시오.
|
|
25
|
+
- 생성된 테스트 코드는 사람이 쉽게 이해하고 유지보수할 수 있도록 명확하게 작성하십시오.
|
|
26
|
+
|
|
27
|
+
## Feature Implementation Workflow
|
|
28
|
+
|
|
29
|
+
기능을 구현할 때는 **반드시** 다음의 조건과 단계를 따릅니다:
|
|
30
|
+
1. **계획 수립 및 검토:**
|
|
31
|
+
- 요구사항 분석을 바탕으로 구체적인 구현 계획을 세웁니다.
|
|
32
|
+
- 수립된 계획을 사용자에게 제시하고, 진행 전에 반드시 검토와 승인을 받습니다.
|
|
33
|
+
2. **단계적 구현 및 검증:**
|
|
34
|
+
- 기능 구현 과정을 논리적인 작은 단위로 세분화하여 단계적으로 진행합니다.
|
|
35
|
+
- 각 단계의 핵심 로직에는 서버 및 클라이언트 환경 모두에 로그(예: `console.group`, `console.log`)를 추가합니다.
|
|
36
|
+
- 로그는 기능의 정상 작동 여부를 확인하고, 잠재적인 문제를 조기에 발견하여 디버깅하는 데 활용됩니다.
|
|
37
|
+
- 구현이 완료되고 안정화된 후에는 디버깅 목적의 로그는 제거하거나, 필요한 경우 최소한으로 유지하는 것을 고려합니다.
|
|
38
|
+
- 각 단계 구현 후에는 충분한 테스트와 검증을 통해 의도한 대로 작동하는지 확인합니다.
|
|
39
|
+
|
|
40
|
+
## Context Management
|
|
41
|
+
|
|
42
|
+
- 각 코드 파일의 첫 100줄 이내에 해당 파일의 기능, 구현 로직, 주요 의존성을 명확히 문서화하세요. 이는 AI가 파일을 빠르고 정확하게 이해하는 데 도움을 줍니다. 아래 예시 형식을 따르십시오:
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
/**
|
|
46
|
+
* @file UserProfile.tsx
|
|
47
|
+
* @description 사용자 프로필 페이지 컴포넌트
|
|
48
|
+
*
|
|
49
|
+
* 이 컴포넌트는 사용자의 프로필 정보를 표시하고 수정하는 기능을 제공합니다.
|
|
50
|
+
*
|
|
51
|
+
* 주요 기능:
|
|
52
|
+
* 1. 사용자 기본 정보 표시 (이름, 이메일, 프로필 이미지)
|
|
53
|
+
* 2. 프로필 정보 수정
|
|
54
|
+
* 3. 프로필 이미지 업로드
|
|
55
|
+
*
|
|
56
|
+
* 핵심 구현 로직:
|
|
57
|
+
* - Supabase Auth를 통한 사용자 인증 상태 확인
|
|
58
|
+
* - React Query를 사용한 프로필 데이터 fetching 및 Caching
|
|
59
|
+
* - 이미지 업로드를 위한 Supabase Storage 활용 (클라이언트 측 직접 업로드)
|
|
60
|
+
* - Form 상태 관리를 위한 React Hook Form 사용 (유효성 검사 포함)
|
|
61
|
+
*
|
|
62
|
+
* @dependencies
|
|
63
|
+
* - @supabase/ssr: 인증 및 서버 사이드 Supabase 클라이언트
|
|
64
|
+
* - @tanstack/react-query: 데이터 동기화 및 캐싱
|
|
65
|
+
* - react-hook-form: 폼 관리 및 유효성 검사
|
|
66
|
+
* - @heroicons/react: UI 아이콘
|
|
67
|
+
*
|
|
68
|
+
* @see {@link /docs/user-profile-design.md} - 관련 디자인 문서
|
|
69
|
+
* @see {@link /docs/api/users.md#PUT /api/users/:id} - 프로필 업데이트 API 명세
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
import { useEffect } from "react";
|
|
73
|
+
import { useForm } from "react-hook-form";
|
|
74
|
+
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query"; // QueryClient 추가
|
|
75
|
+
import { createClient } from "@/utils/supabase/client";
|
|
76
|
+
import { UserCircleIcon } from "@heroicons/react/24/outline";
|
|
77
|
+
|
|
78
|
+
// ... 컴포넌트 구현 ...
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
- 기능은 논리적으로 분리된 작은 모듈 또는 패키지로 구성하십시오. 단일 파일이 500 라인을 넘지 않도록 노력하고, 필요시 파일을 분리하는 것을 적극적으로 제안하십시오.
|
|
82
|
+
- 새로운 기능을 구현할 때, 기존 프로젝트의 디렉토리 구조와 네이밍 컨벤션을 철저히 준수하십시오.
|
|
83
|
+
- 파일 및 디렉토리 이름은 해당 내용물의 기능을 명확하게 나타내도록 작성하십시오. (예: `user-auth-service.ts`, `product-display-component.tsx`)
|
|
84
|
+
- 전체 컨텍스트가 주어질 경우, 주요 파일 및 사용자 지침에 따라 필요한 정보를 요약 및 활용하되, 중요한 세부사항(특히 사용자가 명시한 제약 조건이나 우선순위)을 놓치지 않도록 주의하십시오.
|
|
85
|
+
- 프로젝트 루트의 `.cursor` 폴더에 위치한 디자인 문서, 작업 체크리스트(`todo.md`), 제품 요구사항 문서(`prd.md`), 추가 규칙 파일들을 항상 최우선으로 참조하여 작업의 일관성과 정확성을 유지하십시오.
|
|
86
|
+
- 프로젝트의 상태와 구조, 주요 결정 사항을 `README.md`와 같은 중앙 문서에 정기적으로 문서화하도록 사용자에게 상기시키거나, 직접 초안을 작성하여 제안하십시오.
|
|
87
|
+
|
|
88
|
+
## Refactoring (리팩토링)
|
|
89
|
+
|
|
90
|
+
- 리팩토링은 점진적으로, 작은 단위로 수행하십시오. 대규모의 전면적인 변경은 사용자에게 항상 확인받고 진행하십시오.
|
|
91
|
+
- 기존 코드의 스타일과 패러다임을 일관되게 유지하십시오. 새로운 라이브러리나 스타일을 도입해야 할 경우, 반드시 사용자에게 명시적인 확인과 승인을 요청하십시오.
|
|
92
|
+
- 불필요한 추상화 계층을 만들지 마십시오. 코드는 가능한 단순하게 유지하되, 명확성을 희생해서는 안 됩니다. 모든 추상화는 그 필요성을 명확히 설명할 수 있어야 합니다.
|
|
93
|
+
- 리팩토링 전후로 반드시 테스트를 실행하여 기존 기능이 손상되지 않았는지 확인하십시오. 필요한 경우, 리팩토링 범위에 맞춰 테스트 케이스를 업데이트하거나 추가 작성하십시오.
|
|
94
|
+
- 사용자로부터 '잘못된 리팩토링 함정'(예: 비즈니스 컨텍스트 미이해, 과도한 통합, 성능 저하 유발)에 대한 지적을 받으면, 해당 피드백을 최우선으로 반영하여 수정하고, 수정 내용을 사용자에게 명확히 설명하십시오.
|
|
95
|
+
|
|
96
|
+
## User Instructions (사용자 지침 준수)
|
|
97
|
+
|
|
98
|
+
- 사용자의 요청이 모호하거나 불완전하다고 판단되면, 주저하지 말고 명확화를 위한 구체적인 질문을 하십시오. 추측에 기반하여 코드를 생성하지 마십시오.
|
|
99
|
+
- 사용자가 '아이디어 구체화' 또는 '계획 수립' 단계를 요청하면, 체계적인 질문(예: 목표, 주요 기능, 사용자, 기술 제약)을 통해 상세한 명세(`.cursor/prd.md`) 또는 실행 가능한 작업 목록(`.cursor/todo.md`)을 도출하도록 적극적으로 지원하십시오.
|
|
100
|
+
- 사용자가 '일회용 코드' 또는 '학습 목적의 코드'를 요청할 경우, 유지보수성보다는 기능 구현 및 개념 설명에 더 중점을 둘 수 있습니다. 단, 이 경우에도 기본적인 코드 품질(가독성, 보안 기초)은 유지하고, 해당 코드의 한계를 사용자에게 명확히 고지하십시오.
|
|
101
|
+
- 사용자가 제공하는 `prd.md`, `todo.md`, `README.md` 등의 문서는 작업의 핵심적인 가이드라인이므로 반드시 숙지하고 철저히 따르십시오. 내용이 상충되거나 불분명한 경우 즉시 사용자에게 확인 요청하십시오.
|
|
102
|
+
|
|
103
|
+
## Automation (자동화)
|
|
104
|
+
|
|
105
|
+
- 품질 검사 도구(린터, 정적 분석기 등)에서 오류나 경고가 발생하면, 해당 내용을 분석하여 코드를 자동으로 수정하십시오. 이 과정에서 오류/경고가 없을 때까지 반복할 수 있으나, 각 수정 시도 전, 해당 오류/경고에 대한 웹 검색 또는 공식 문서(context7 mcp 활용 ) 조사를 필수로 수행하여 최적의 해결책을 적용해야 합니다.
|
|
106
|
+
- 최대 3회를 초과하여 동일한 오류 수정 루프에 빠지지 않도록 주의하고, 해결이 어려울 경우 사용자에게 현재까지의 시도와 문제점을 요약하여 보고하고 도움을 요청하십시오.
|
|
107
|
+
|
|
108
|
+
## Supporting (사용자 지원)
|
|
109
|
+
|
|
110
|
+
- 사용자가 기술 용어나 개발 프로세스에 익숙하지 않을 수 있음을 인지하고, 가능한 쉬운 용어로 설명하거나, 필요한 경우 비유나 구체적인 예시를 들어 추가적인 설명을 제공하십시오.
|
|
111
|
+
- 사용자가 문제 정의(PRD, 와이어프레임)를 명확히 하도록 돕고, 이를 기반으로 신속하게 프로토타입을 생성하여 시각적인 피드백 루프를 형성하고 사용자의 아이디어를 구체화하는 데 기여하십시오.
|
|
112
|
+
- 사용자가 'AI가 코드를 잘 작성하도록 프롬프팅'하는 방법을 문의하면, 명확한 역할 부여, 충분한 컨텍스트 제공, 구체적인 작업 지시의 중요성을 설명하고, 효과적인 프롬프트 패턴 예시를 제공하십시오.
|
|
113
|
+
- 사용자가 '내가 더 똑똑해지기'를 원할 경우, 관련 기술 키워드, 데이터 흐름, 실행 환경, 아키텍처 패턴 등에 대한 학습 자료(요약, 링크 등)를 제공하거나 관련 질문에 상세히 답변하여 사용자의 이해를 돕고 성장을 지원하십시오.
|
|
114
|
+
- 사용자가 '기능이 스펙대로 동작한다'는 목표를 달성하도록, 테스트 코드 작성의 중요성과 방법, 테스트 실행 및 결과 해석 과정을 명확히 안내하고, 버전 관리 시스템(예: Git)을 통한 커밋(저장)의 중요성과 기본 워크플로우를 설명하십시오.
|