@wondev/dotenv-example 1.0.2 → 1.0.3

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 (41) hide show
  1. package/AGENTS.md +38 -0
  2. package/CLAUDE.md +1 -40
  3. package/bin/index.js +64 -55
  4. package/package.json +8 -2
  5. package/prompts/20260102_165844.md +3 -0
  6. package/prompts/20260102_170026.md +3 -0
  7. package/prompts/20260102_170120.md +4 -0
  8. package/prompts/20260102_170500.md +3 -0
  9. package/prompts/20260102_170839.md +3 -0
  10. package/prompts/20260102_171046.md +3 -0
  11. package/prompts/20260102_171147.md +38 -0
  12. package/prompts/20260102_171336.md +76 -0
  13. package/prompts/20260102_171546.md +40 -0
  14. package/.claude/README.md +0 -60
  15. package/.claude/commands/business_logic.md +0 -143
  16. package/.claude/commands/generate-prd.md +0 -175
  17. package/.claude/commands/gotobackend.md +0 -569
  18. package/.claude/commands/playwrightMCP_install.md +0 -113
  19. package/.claude/commands/setting_dev.md +0 -731
  20. package/.claude/commands/tech-lead.md +0 -404
  21. package/.claude/commands/user-flow.md +0 -839
  22. package/.claude/settings.local.json +0 -9
  23. package/.cursor/README.md +0 -10
  24. package/.cursor/mcp.json +0 -31
  25. package/.cursor/rules/common/cursor-rules.mdc +0 -53
  26. package/.cursor/rules/common/git-convention.mdc +0 -86
  27. package/.cursor/rules/common/self-improve.mdc +0 -72
  28. package/.cursor/rules/common/tdd.mdc +0 -81
  29. package/.cursor/rules/common/vibe-coding.mdc +0 -114
  30. package/.cursor/rules/supabase/supabase-bootstrap-auth.mdc +0 -236
  31. package/.cursor/rules/supabase/supabase-create-db-functions.mdc +0 -136
  32. package/.cursor/rules/supabase/supabase-create-migration.mdc +0 -50
  33. package/.cursor/rules/supabase/supabase-create-rls-policies.mdc +0 -248
  34. package/.cursor/rules/supabase/supabase-declarative-database-schema.mdc +0 -78
  35. package/.cursor/rules/supabase/supabase-postgres-sql-style-guide.mdc +0 -133
  36. package/.cursor/rules/supabase/supabase-writing-edge-functions.mdc +0 -105
  37. package/.cursor/rules/web/design-rules.mdc +0 -381
  38. package/.cursor/rules/web/nextjs-convention.mdc +0 -237
  39. package/.cursor/rules/web/playwright-test-guide.mdc +0 -176
  40. package/.cursor/rules/web/toss-frontend.mdc +0 -695
  41. package/.env +0 -4
package/AGENTS.md ADDED
@@ -0,0 +1,38 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Project Overview
6
+
7
+ `dotenv-example`은 `.env` 파일을 읽어 값을 마스킹한 `.env.example` 파일을 생성하는 Node.js CLI 도구입니다.
8
+
9
+ ## Commands
10
+
11
+ ```bash
12
+ # 실행 (로컬 개발)
13
+ node bin/index.js
14
+
15
+ # 옵션
16
+ node bin/index.js --help # 도움말
17
+ node bin/index.js -f .env.local # 특정 파일 지정
18
+ node bin/index.js -o .env.sample # 출력 파일명 변경
19
+
20
+ # npm 배포
21
+ npm publish
22
+ ```
23
+
24
+ ## Architecture
25
+
26
+ ```
27
+ bin/index.js # CLI 진입점 (Commander.js 사용)
28
+ ```
29
+
30
+ 핵심 로직:
31
+ - `findEnvFile()`: `.env -> .env.local -> .env.production` 순서로 파일 탐색
32
+ - `maskLine()`: 환경변수 값을 `your_<key>` 형식으로 마스킹
33
+ - `generateEnvExample()`: 파일 읽기/쓰기 처리
34
+
35
+ ## Git Convention
36
+
37
+ Conventional Commits 형식 사용: `type(scope): subject`
38
+ - feat, fix, docs, style, refactor, test, chore
package/CLAUDE.md CHANGED
@@ -1,40 +1 @@
1
- <rules>
2
- The following rules should be considered foundational. Make sure you're familiar with them before working on this project:
3
- @.cursor/rules/common/cursor-rules.mdc
4
- @.cursor/rules/common/self-improve.mdc
5
- @.cursor/rules/common/vibe-coding.mdc
6
-
7
- Git convention defining branch naming, commit message format, and issue labeling based on GitFlow and Conventional Commits.:
8
- @.cursor/rules/common/git-convention.mdc
9
-
10
- Guidelines for writing tests and implementing code following TDD and Tidy First principles.:
11
- @.cursor/rules/common/tdd.mdc
12
-
13
- Guidelines for writing Next.js apps with Supabase Auth:
14
- @.cursor/rules/supabase/supabase-bootstrap-auth.mdc
15
-
16
- Guidelines for writing Supabase database functions:
17
- @.cursor/rules/supabase/supabase-create-db-functions.mdc
18
-
19
- Guidelines for writing Postgres migrations:
20
- @.cursor/rules/supabase/supabase-create-migration.mdc
21
-
22
- Guidelines for writing Postgres Row Level Security policies:
23
- @.cursor/rules/supabase/supabase-create-rls-policies.mdc
24
-
25
- For when modifying the Supabase database schema.:
26
- @.cursor/rules/supabase/supabase-declarative-database-schema.mdc
27
-
28
- Guidelines for writing Postgres SQL:
29
- @.cursor/rules/supabase/supabase-postgres-sql-style-guide.mdc
30
-
31
- Coding rules for Supabase Edge Functions:
32
- @.cursor/rules/supabase/supabase-writing-edge-functions.mdc
33
-
34
- Playwright 테스트 작성 가이드:
35
- @.cursor/rules/web/playwright-test-guide.mdc
36
-
37
- When working with files that match the following extensions (.js, .jsx, .ts, .tsx), review and apply the relevant rules:
38
- @.cursor/rules/web/nextjs-convention.mdc
39
- @.cursor/rules/web/toss-frontend.mdc
40
- </rules>
1
+ @AGENTS.md
package/bin/index.js CHANGED
@@ -2,65 +2,74 @@
2
2
 
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
+ const { program } = require('commander');
6
+ const { version, description } = require('../package.json');
5
7
 
6
- function generateEnvExample() {
7
- const envPath = path.join(process.cwd(), '.env');
8
- const examplePath = path.join(process.cwd(), '.env.example');
9
-
10
- try {
11
- // .env 파일 확인
12
- if (!fs.existsSync(envPath)) {
13
- console.error('Error: .env file not found in current directory');
14
- process.exit(1);
8
+ const DEFAULT_ENV_FILES = ['.env', '.env.local', '.env.production'];
9
+
10
+ program
11
+ .name('dotenv-example')
12
+ .version(version)
13
+ .description(description)
14
+ .option('-o, --output <file>', 'output file name', '.env.example')
15
+ .option('-f, --file <file>', 'specific env file to use')
16
+ .action((options) => {
17
+ generateEnvExample(options);
18
+ });
19
+
20
+ program.parse();
21
+
22
+ function findEnvFile(specificFile) {
23
+ if (specificFile) {
24
+ const filePath = path.join(process.cwd(), specificFile);
25
+ if (fs.existsSync(filePath)) {
26
+ return { path: filePath, name: specificFile };
15
27
  }
16
-
17
- // .env 파일 읽기
18
- const envContent = fs.readFileSync(envPath, 'utf-8');
19
-
20
- // 라인 처리
21
- const exampleContent = envContent
22
- .split('\n')
23
- .map(line => {
24
- // 빈 줄이나 주석은 그대로 유지
25
- if (!line.trim() || line.trim().startsWith('#')) {
26
- return line;
27
- }
28
-
29
- // KEY=VALUE 형식 파싱
30
- const match = line.match(/^([^=]+)=(.*)$/);
31
- if (match) {
32
- const key = match[1].trim();
33
- const value = match[2].trim();
34
-
35
- // 따옴표 제거
36
- const cleanValue = value.replace(/^["']|["']$/g, '');
37
-
38
- // 키 이름을 기반으로 example 값 생성
39
- let exampleValue = 'your_' + key.toLowerCase().replace(/_/g, '_');
40
-
41
- // 원래 값이 따옴표로 둘러싸여 있었다면 example 값도 따옴표로 감싸기
42
- if (value.startsWith('"') && value.endsWith('"')) {
43
- exampleValue = `"${exampleValue}"`;
44
- } else if (value.startsWith("'") && value.endsWith("'")) {
45
- exampleValue = `'${exampleValue}'`;
46
- }
47
-
48
- return `${key}=${exampleValue}`;
49
- }
50
-
51
- return line;
52
- })
53
- .join('\n');
54
-
55
- // .env.example 파일 생성
56
- fs.writeFileSync(examplePath, exampleContent);
57
- console.log('✅ Successfully created .env.example');
58
-
28
+ console.error(`Error: ${specificFile} not found`);
29
+ process.exit(1);
30
+ }
31
+
32
+ for (const file of DEFAULT_ENV_FILES) {
33
+ const filePath = path.join(process.cwd(), file);
34
+ if (fs.existsSync(filePath)) {
35
+ return { path: filePath, name: file };
36
+ }
37
+ }
38
+ return null;
39
+ }
40
+
41
+ function maskLine(line) {
42
+ const trimmed = line.trim();
43
+ if (!trimmed || trimmed.startsWith('#')) return line;
44
+
45
+ const match = line.match(/^([^=]+)=(.*)$/);
46
+ if (!match) return line;
47
+
48
+ const [, key, value] = match;
49
+ const placeholder = `your_${key.trim().toLowerCase()}`;
50
+
51
+ if (value.startsWith('"') && value.endsWith('"')) return `${key}="${placeholder}"`;
52
+ if (value.startsWith("'") && value.endsWith("'")) return `${key}='${placeholder}'`;
53
+ return `${key}=${placeholder}`;
54
+ }
55
+
56
+ function generateEnvExample(options) {
57
+ const envFile = findEnvFile(options.file);
58
+ if (!envFile) {
59
+ console.error(`Error: No env file found. Looked for: ${DEFAULT_ENV_FILES.join(', ')}`);
60
+ process.exit(1);
61
+ }
62
+
63
+ try {
64
+ console.log(`📁 Using ${envFile.name}`);
65
+ const content = fs.readFileSync(envFile.path, 'utf-8');
66
+ const masked = content.split('\n').map(maskLine).join('\n');
67
+
68
+ const outputPath = path.join(process.cwd(), options.output);
69
+ fs.writeFileSync(outputPath, masked);
70
+ console.log(`✅ Created ${options.output}`);
59
71
  } catch (error) {
60
72
  console.error('Error:', error.message);
61
73
  process.exit(1);
62
74
  }
63
75
  }
64
-
65
- // 실행
66
- generateEnvExample();
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@wondev/dotenv-example",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Generate .env.example from .env files with masked values",
5
5
  "main": "index.js",
6
6
  "bin": {
7
- "dotenvexample": "./bin/index.js"
7
+ "dotenv-example": "bin/index.js"
8
8
  },
9
9
  "scripts": {
10
10
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -18,6 +18,9 @@
18
18
  ],
19
19
  "author": "Aiden Ahn",
20
20
  "license": "MIT",
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
21
24
  "engines": {
22
25
  "node": ">=14.0.0"
23
26
  },
@@ -28,5 +31,8 @@
28
31
  "homepage": "https://github.com/seungwonme/dotexample#readme",
29
32
  "bugs": {
30
33
  "url": "https://github.com/seungwonme/dotexample/issues"
34
+ },
35
+ "dependencies": {
36
+ "commander": "^14.0.2"
31
37
  }
32
38
  }
@@ -0,0 +1,3 @@
1
+ seungwonan
2
+
3
+ .env -> .env.local -> .env.production 순으로 감지하게 해줘
@@ -0,0 +1,3 @@
1
+ seungwonan
2
+
3
+ 코드가 예외없이 동작하게끔, 유지보수하기 좋게 간결하게 리펙토링해줘
@@ -0,0 +1,4 @@
1
+ seungwonan
2
+
3
+ nodejs cli 도구 좋은 거 있지 않아?
4
+ 그거 사용해줘
@@ -0,0 +1,3 @@
1
+ seungwonan
2
+
3
+ /init
@@ -0,0 +1,3 @@
1
+ seungwonan
2
+
3
+ npm 레지스트리에 올려줘 https://www.npmjs.com/package/@wondev/dotenv-example
@@ -0,0 +1,3 @@
1
+ seungwonan
2
+
3
+ 1.0.3 버전으로 해야해
@@ -0,0 +1,38 @@
1
+ seungwonan
2
+
3
+ npm publish 17s resources_with_crawl4ai 05:11:31 오후
4
+ npm notice
5
+ npm notice 📦 @wondev/dotenv-example@1.0.3
6
+ npm notice Tarball Contents
7
+ npm notice 969B AGENTS.md
8
+ npm notice 11B CLAUDE.md
9
+ npm notice 241B README.md
10
+ npm notice 2.2kB bin/index.js
11
+ npm notice 820B package.json
12
+ npm notice 75B prompts/20250926_175606.md
13
+ npm notice 7.8kB prompts/20250926_180205.md
14
+ npm notice 134B prompts/20250926_180304.md
15
+ npm notice 693B prompts/20250926_180535.md
16
+ npm notice 81B prompts/20260102_165844.md
17
+ npm notice 111B prompts/20260102_170026.md
18
+ npm notice 77B prompts/20260102_170120.md
19
+ npm notice 19B prompts/20260102_170500.md
20
+ npm notice 98B prompts/20260102_170839.md
21
+ npm notice 42B prompts/20260102_171046.md
22
+ npm notice Tarball Details
23
+ npm notice name: @wondev/dotenv-example
24
+ npm notice version: 1.0.3
25
+ npm notice filename: wondev-dotenv-example-1.0.3.tgz
26
+ npm notice package size: 4.9 kB
27
+ npm notice unpacked size: 13.4 kB
28
+ npm notice shasum: ff0369aedafd1fa72ce90476d5bf5ec4df3f2a94
29
+ npm notice integria512-tanfQCdzm5Dmt[...]ZLEkLsLA+Hvmw==
30
+ npm notice total files: 15
31
+ npm notice
32
+ npm notice Publishing to https://registry.npmjs.org/ with tag latest and public access
33
+ npm error code E403
34
+ npm error 403 403 Forbidden - PUT https://registry.npmjs.org/@wondev%2fdotenv-example - Two-factor authentication or granular access token with bypass 2fa enabled is required to publish packages.
35
+ npm error 403 In most cases, you or one of your dependencies are requesting
36
+ npm error 403 a package version that is forbidden by your security policy, or
37
+ npm error 403 on a server you do not have access to.
38
+ npm error A complete log of this run can be found in: /Users/seungwonan/.npm/_logs/2026-01-02T08_11_37_481Z-debug-0.log
@@ -0,0 +1,76 @@
1
+ seungwonan
2
+
3
+ npm publish --otp=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
4
+ npm notice
5
+ npm notice 📦 @wondev/dotenv-example@1.0.3
6
+ npm notice Tarball Contents
7
+ npm notice 969B AGENTS.md
8
+ npm notice 11B CLAUDE.md
9
+ npm notice 241B README.md
10
+ npm notice 2.2kB bin/index.js
11
+ npm notice 820B package.json
12
+ npm notice 75B prompts/20250926_175606.md
13
+ npm notice 7.8kB prompts/20250926_180205.md
14
+ npm notice 134B prompts/20250926_180304.md
15
+ npm notice 693B prompts/20250926_180535.md
16
+ npm notice 81B prompts/20260102_165844.md
17
+ npm notice 111B prompts/20260102_170026.md
18
+ npm notice 77B prompts/20260102_170120.md
19
+ npm notice 19B prompts/20260102_170500.md
20
+ npm notice 98B prompts/20260102_170839.md
21
+ npm notice 42B prompts/20260102_171046.md
22
+ npm notice 1.7kB prompts/20260102_171147.md
23
+ npm notice Tarball Details
24
+ npm notice name: @wondev/dotenv-example
25
+ npm notice version: 1.0.3
26
+ npm notice filename: wondev-dotenv-example-1.0.3.tgz
27
+ npm notice package size: 5.4 kB
28
+ npm notice unpacked size: 15.1 kB
29
+ npm notice shasum: eec1790a2e8f64fd39f08cc986516606c29d89
30
+ npm notice integrity: sha512-8j4nrNy44xrQ5[...]AsfrOhuAPghGQ==
31
+ npm notice total files: 16
32
+ npm notice
33
+ npm notice Publishing to https://registry.npmjs.org/ with tag latest and public access
34
+ npm error code E403
35
+ npm error 403 403 Forbidden - PUT https://registry.npmjs.org/@wondev%2fdotenv-example - Two-factor authentication or granular access token with bypass 2fa enabled is required to publish packages.
36
+ npm error 403 In most cases, you or one of your dependencies are requesting
37
+ npm error 403 a package version that is forbidden by your security policy, or
38
+ npm error 403 on a server you do not have access to.
39
+ npm error A complete log of this run can be found in: /Users/seungwonan/.npm/_logs/2026-01-02T08_13_24_510Z-debug-0.log
40
+ ~/Dev/3-tool/cli-tools/dotexample main* ❯ npm publish --otp="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"
41
+ npm notice
42
+ npm notice 📦 @wondev/dotenv-example@1.0.3
43
+ npm notice Tarball Contents
44
+ npm notice 969B AGENTS.md
45
+ npm notice 11B CLAUDE.md
46
+ npm notice 241B README.md
47
+ npm notice 2.2kB bin/x.js
48
+ npm notice 820B package.json
49
+ npm notice 75B prompts/20250926_175606.md
50
+ npm notice 7.8kB prompts/20250926_180205.md
51
+ npm notice 134B prompts/20250926_180304.md
52
+ npm notice 693B prompts/20250926_180535.md
53
+ npm notice 81B prompts/20260102_165844.md
54
+ npm notice 111B prompts/20260102_170026.md
55
+ npm notice 77B prompts/20260102_170120.md
56
+ npm notice 19B prompts/20260102_170500.md
57
+ npm notice 98B prompts/20260102_170839.md
58
+ npm notice 42B prompts/20260102_171046.md
59
+ npm notice 1.7kB prompts/20260102_171147.md
60
+ npm notice Tarball Details
61
+ npm notice name: @wondev/dotenv-example
62
+ npm notice version: 1.0.3
63
+ npm notice filename: wondev-dotenv-example-1.0.3.tgz
64
+ npm notice package size: 5.4 kB
65
+ npm notice unpacked size: 15.1 kB
66
+ npm notice shasum: eec1790a2e8f64fd39f08cc986516606c29dd689
67
+ npm notice integrity: sha512-8j4nrNy44xrQ5[...]AsfrOhuAPghGQ==
68
+ npm notice total files: 16
69
+ npm notice
70
+ npm notice Publishing to https://registry.npmjs.org/ with tag latest and public access
71
+ npm error code E403
72
+ npm error 403 403 Forbidden - PUT https://registry.npmjs.org/@wondev%2fdotenv-example - Two-factor authentication or granular access token with bypass 2fa enabled is required to publish packages.
73
+ npm error 403 In most cases, you or one of your dependencies are requesting
74
+ npm error 403 a package version that is forbidden by your security policy, or
75
+ npm error 403 on a server you do not have access to.
76
+ npm error A complete log of this run can be found in: /Users/seungwonan/.npm/_logs/2026-01-02T08_13_28_347Z-debug-0.log
@@ -0,0 +1,40 @@
1
+ seungwonan
2
+
3
+ ~/Dev/3-tool/cli-tools/dotexample main* ❯ npm publish --otp="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"
4
+ npm notice
5
+ npm notice 📦 @wondev/dotenv-example@1.0.3
6
+ npm notice Tarball Contents
7
+ npm notice 969B AGENTS.md
8
+ npm notice 11B CLAUDE.md
9
+ npm notice 241B README.md
10
+ npm notice 2.2kB bin/index.js
11
+ npm notice 820B package.json
12
+ npm notice 75B prompts/20250926_175606.md
13
+ npm notice 7.8kB prompts/20250926_180205.md
14
+ npm notice 134B prompts/20250926_180304.md
15
+ npm notice 693B prompts/20250926_180535.md
16
+ npm notice 81B prompts/20260102_165844.md
17
+ npm notice 111B prompts/20260102_170026.md
18
+ npm notice 77B prompts/20260102_170120.md
19
+ npm notice 19B prompts/20260102_170500.md
20
+ npm notice 98B prompts/20260102_170839.md
21
+ npm notice 42B prompts/20260102_171046.md
22
+ npm notice 1.7kB prompts/20260102_171147.md
23
+ npm notice 3.6kB prompts/20260102_171336.md
24
+ npm notice Tarball Details
25
+ npm notice name: @wondev/dotenv-example
26
+ npm notice version: 1.0.3
27
+ npm notice filename: wondev-dotenv-example-1.0.3.tgz
28
+ npm notice package size: 5.6 kB notice unpacked size: 18.7 kB
29
+ npm notice shasum: 804c37149df05a893961bb76d97a3b5834b22649
30
+ npm notice integrity: sha512-Y0rD56miIggJx[...]aUBocO3eREfFQ==
31
+ npm notice total files: 17
32
+ npm notice
33
+ npm notice Publishing to https://registry.npmjs.org/ with tag latest and public access
34
+ npm error code E403
35
+ npm error 403 403 Forbidden - PUT https://registry.npmjs.org/@wondev%2fdotenv-example - Two-factor authentication or granular access token with bypass 2fa enabled is required to publish packages.
36
+ npm error 403 In most cases, you or one of your dependencies are requesting
37
+ npm error 403 a package version that is forbidden by your security policy, or
38
+ npm error 403 on a server you do not have access to.
39
+ npm error A complete log of this run can be found in: /Users/seungwonan/.npm/_logs/2026-01-02T08_15_34_609Z-debug-0.log
40
+ ~/Dev/3-tool/cli-tools/dotexample main* ❯ resources_with_crawl4ai 05:15:35 오후
package/.claude/README.md DELETED
@@ -1,60 +0,0 @@
1
- # .claude
2
-
3
- 이 저장소는 Claude Code를 효과적으로 활용하기 위한 프롬프트 템플릿과 가이드라인을 제공합니다.
4
-
5
- ## 디렉토리 구조
6
-
7
- ```shell
8
- .claude/
9
- ├── commands/ # Claude Code 명령어 모음
10
- └── README.md
11
- ```
12
-
13
- ## 시작하기
14
-
15
- 1. 이 저장소를 클론하거나 다운로드합니다
16
- 2. 필요한 프롬프트 템플릿을 선택합니다
17
- 3. 프로젝트에 맞게 커스터마이징합니다
18
-
19
- ## 주요 내용
20
-
21
- ### `commands` 내용 정리
22
-
23
- #### .claude/commands/ 작업 순서
24
-
25
- 1. setting-dev.md
26
- - 기본적인 next.js 프레임워크와 로컬애서 DB를 다룰 수 있도록 폴더 구조를 정리했습니다.
27
- 2. generate-prd.md
28
- - 프로젝트 정의, 타겟 사용자, 핵심 기능(3~5개), 데이터 관리, 인증&권한, 결제&비즈니스, 부가 기능을 사용자에게 입력을 받고 prd를 생성합니다.
29
- - 생각보다 작업 시간이 오래 걸려 클로드에서 진행하는 것이 좋을 수 도 있을 것 같습니다.
30
- 3. tech-lead.md
31
- - 생성한 prd를 기준으로 의존성과 핵심기능의 작업 순위를 정리하여 todo(task)를 생성합니다. -> 추후, taskmaster mcp와 같이 세세한 기능을 쪼개서 정리할 수 있도록 디벨롭할 예정입니다.
32
- 4. business-logic.md
33
- - 생성한 prd와 todo를 갖고, 비즈니스 로직을 생성합니다.
34
- 5. playwright-install.md
35
- - playwright MCP를 설치합니다.
36
- **프론트 진행**
37
-
38
- ---
39
-
40
- **프론트 완료 후** 6. user-flow.md
41
-
42
- - 생성한 프론트 코드베이스와 각 문서를 참고하여 DB생성에 도움이 되는 user-flow를 생성합니다.
43
-
44
- 7. gotobackend.md
45
- - 프론트를 전부 진행을 했다면, 로컬애서 supabase와 DrizzleORM을 사용하도록 생성한 모든 문서를 업데이트 하고, 폴더를 생성합니다. 이에 맞게 환경설정을 진행합니다.
46
-
47
- ### CursorRules
48
-
49
- - Convert to CLAUDE.md
50
-
51
- https://github.com/seungwonme/rules-converter
52
-
53
- `npx rules-converter claude`
54
-
55
- - 커서룰을 claude memory에 넣는 작업
56
- - CLUADE.md 파일도 커서룰로 만들어서 깔끔하게 memory에 넣을 수 있도록 진행하면 좋을 것 같습니다.
57
-
58
- ### SupabaseRules
59
-
60
- - 프론트 완료 후, .claude/commands/ 에서 'gotobackend'를 실행하고 사용하면 됩니다.
@@ -1,143 +0,0 @@
1
- # Business Logic Prompt
2
-
3
- ## 시스템 컨텍스트
4
-
5
- ```markdown
6
- <expert_identity>
7
- 당신은 Next.js 15 + React 19 바이브 코딩 전문가로, PRD와 Tasks를 기반으로
8
- AI 코드 생성에 최적화된 간결한 비즈니스 로직을 작성하는 전문가입니다.
9
-
10
- **핵심 목표:**
11
- - PRD/Tasks → Server/Client Components 분류 및 AI 프롬프트 템플릿 생성
12
- - 로컬 Repository → Supabase 마이그레이션 고려한 타입 안전 설계
13
- - 바이브 코딩에 최적화된 2-5일 단위 구현 가능한 명세 작성
14
- </expert_identity>
15
-
16
- <technical_stack>
17
- Next.js 15 + TypeScript + Server Components 우선 + Server Actions
18
- + shadcn/ui + TailwindCSS + 로컬 Repository
19
- </technical_stack>
20
- ```
21
-
22
- ## 📋 입력 요구사항
23
-
24
- <input_structure>
25
- <prd_document>
26
- {docs/PRD.md 문서 내용}
27
- </prd_document>
28
-
29
- <tasks_list>
30
- {docs/TODO.md 문서 내용}
31
- </tasks_list>
32
-
33
- <target_phase>
34
- {Phase 1: 로컬 DB / Phase 2: UX 최적화}
35
- </target_phase>
36
- </input_structure>
37
-
38
- ## 🎨 간결한 출력 형식
39
-
40
- <output_format>
41
- ## 📋 Next.js 15 비즈니스 로직 명세서
42
-
43
- ### 1. 핵심 기능 분류
44
-
45
- **Server Components (SEO/초기렌더링)**
46
- - [기능명]: src/app/[route]/page.tsx - [용도 설명]
47
- - [기능명]: src/components/features/[feature]/[component].tsx - [용도 설명]
48
-
49
- **Client Components (상호작용)**
50
- - [기능명]: src/components/features/[feature]/[component].tsx - [상호작용 내용]
51
- - [기능명]: src/components/features/[feature]/[component].tsx - [상호작용 내용]
52
-
53
- **Server Actions (데이터 처리)**
54
- - [액션명]: src/actions/[feature]-actions.ts - [처리 내용]
55
- - [액션명]: src/actions/[feature]-actions.ts - [처리 내용]
56
-
57
- **Repository 패턴 (데이터 계층)**
58
- - [엔티티명]: src/lib/db/local/repositories/[feature]-repository.ts - [CRUD 작업]
59
-
60
- ### 2. 비즈니스 플로우 (핵심만)
61
-
62
- **P0 Critical Flow:**
63
- ```
64
- 사용자 접속 → Server Component (초기 데이터) → Client Component (상호작용)
65
- → Server Action (처리) → Repository (저장) → UI 업데이트
66
- ```
67
-
68
- **주요 비즈니스 규칙:**
69
- 1. [규칙 1]: [간단한 설명]
70
- 2. [규칙 2]: [간단한 설명]
71
- 3. [규칙 3]: [간단한 설명]
72
-
73
- ### 3. 타입 안전성 전략
74
-
75
- **핵심 인터페이스:**
76
- - User, Post, Comment 등 주요 엔티티 타입 정의 필요
77
- - Server Actions는 ActionResult<T> 타입 반환 통일
78
- - Zod 스키마로 런타임 검증 (특히 폼 입력)
79
-
80
- **로컬 → Supabase 호환성:**
81
- - camelCase (로컬) → snake_case (Supabase) 필드명 매핑 고려
82
- - Date 타입 → ISO 문자열 변환 로직 필요
83
-
84
- ### 4. AI 코드 생성 가이드
85
-
86
- **Server Component 생성 시:**
87
- "Next.js 15 Server Component로 [기능명] 구현. 서버에서 [데이터소스]로부터 데이터 페칭하여 [UI요소] 렌더링. 'use client' 없이 구현하고 TypeScript 타입 안전성 보장."
88
-
89
- **Client Component 생성 시:**
90
- "'use client' 지시어로 시작하는 [기능명] 컴포넌트 구현. [상호작용내용] 처리하고 [Server Action명] 호출. useState로 로딩/에러 상태 관리하며 shadcn/ui 컴포넌트 사용."
91
-
92
- **Server Action 생성 시:**
93
- "'use server' 지시어로 시작하는 [액션명] 구현. FormData 받아서 Zod로 검증 후 [비즈니스로직] 처리. Repository 패턴으로 데이터 저장하고 revalidatePath로 캐시 무효화."
94
-
95
- **Repository 생성 시:**
96
- "BaseRepository 확장하는 [엔티티명]Repository 구현. 로컬 스토리지 기반 CRUD 메서드와 [특화기능] 제공. Supabase 마이그레이션 고려한 인터페이스 설계."
97
-
98
- ### 5. Phase별 구현 전략
99
-
100
- **Phase 1 (Week 1-8): 로컬 DB 기반**
101
- - 기본 Server Components + Client Components 구현
102
- - 로컬 Repository 패턴으로 빠른 프로토타이핑
103
- - 핵심 비즈니스 로직 검증
104
-
105
- **Phase 2 (Week 5-8): UX 최적화**
106
- - 로딩 상태, 에러 처리, 반응형 디자인 강화
107
- - TanStack Query 도입으로 서버 상태 최적화
108
- - shadcn/ui 고급 컴포넌트 활용
109
-
110
-
111
- ### 6. 개발 시 주의사항
112
-
113
- **필수 체크포인트:**
114
- - Server Components에 'use client' 사용 금지
115
- - Client Components에서 직접 DB 접근 금지
116
- - Server Actions에서 반드시 타입 안전 에러 처리
117
- - 파일명 kebab-case, 컴포넌트명 PascalCase 준수
118
-
119
- **성능 고려사항:**
120
- - Server Components 우선 사용으로 번들 크기 최소화
121
- - Client Components는 상호작용 필수 요소만
122
- - 이미지 최적화 및 Core Web Vitals 기준 준수
123
-
124
- ---
125
-
126
- **🎯 AI 코드 생성 준비 완료!**
127
- 위 가이드의 "AI 코드 생성 가이드" 섹션 프롬프트를 사용하여
128
- 각 컴포넌트/액션/Repository를 순차적으로 구현하세요.
129
- </output_format>
130
-
131
- ## 💡 사용법
132
-
133
- ### 입력 → 실행 → 활용
134
- 1. **PRD + TODO 탐색** → 이 프롬프트 실행 → **간결한 비즈니스 로직 명세서** 생성
135
- 2. **명세서의 "AI 코드 생성 가이드"** → AI 코딩 도구에 복붙 → **즉시 코드 생성**
136
- 3. **Phase별 전략** → 점진적 구현 → **3개월 완성**
137
-
138
- ### 자동 저장
139
- ```bash
140
- # docs/business-logic.md 생성
141
- mkdir -p docs
142
- echo "# 📋 [프로젝트명] 비즈니스 로직 명세서" > docs/BUSINESS-LOGIC.md
143
- ```