codesyncer 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/LICENSE +31 -0
- package/README.ko.md +417 -0
- package/README.md +417 -0
- package/bin/codesyncer.js +3 -0
- package/dist/commands/add-repo.d.ts +3 -0
- package/dist/commands/add-repo.d.ts.map +1 -0
- package/dist/commands/add-repo.js +145 -0
- package/dist/commands/add-repo.js.map +1 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +489 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/update.d.ts +3 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +123 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/constants/keywords.d.ts +23 -0
- package/dist/constants/keywords.d.ts.map +1 -0
- package/dist/constants/keywords.js +133 -0
- package/dist/constants/keywords.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -0
- package/dist/templates/en/architecture.md +147 -0
- package/dist/templates/en/claude.md +267 -0
- package/dist/templates/en/comment_guide.md +324 -0
- package/dist/templates/en/decisions.md +227 -0
- package/dist/templates/en/master.md +179 -0
- package/dist/templates/ko/architecture.md +147 -0
- package/dist/templates/ko/claude.md +267 -0
- package/dist/templates/ko/comment_guide.md +324 -0
- package/dist/templates/ko/decisions.md +227 -0
- package/dist/templates/ko/master.md +179 -0
- package/dist/types.d.ts +78 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +16 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/messages.d.ts +129 -0
- package/dist/utils/messages.d.ts.map +1 -0
- package/dist/utils/messages.js +168 -0
- package/dist/utils/messages.js.map +1 -0
- package/dist/utils/scanner.d.ts +11 -0
- package/dist/utils/scanner.d.ts.map +1 -0
- package/dist/utils/scanner.js +311 -0
- package/dist/utils/scanner.js.map +1 -0
- package/dist/utils/template-loader.d.ts +18 -0
- package/dist/utils/template-loader.d.ts.map +1 -0
- package/dist/utils/template-loader.js +496 -0
- package/dist/utils/template-loader.js.map +1 -0
- package/package.json +70 -0
- package/src/templates/en/architecture.md +147 -0
- package/src/templates/en/claude.md +267 -0
- package/src/templates/en/comment_guide.md +324 -0
- package/src/templates/en/decisions.md +227 -0
- package/src/templates/en/master.md +179 -0
- package/src/templates/ko/architecture.md +147 -0
- package/src/templates/ko/claude.md +267 -0
- package/src/templates/ko/comment_guide.md +324 -0
- package/src/templates/ko/decisions.md +227 -0
- package/src/templates/ko/master.md +179 -0
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
# Comment Writing Guide
|
|
2
|
+
|
|
3
|
+
> **CodeSyncer Comment System** - Permanently record all inferences and decisions
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 📋 Comment Tag Reference
|
|
8
|
+
|
|
9
|
+
### 5 Essential Tags
|
|
10
|
+
|
|
11
|
+
| Tag | Purpose | When to Use | Importance |
|
|
12
|
+
|-----|---------|-------------|------------|
|
|
13
|
+
| `@codesyncer-rule` | Special rules | Non-standard implementations | ⭐⭐⭐ |
|
|
14
|
+
| `@codesyncer-inference` | Inference content | AI inferred content and rationale | ⭐⭐⭐⭐⭐ |
|
|
15
|
+
| `@codesyncer-decision` | Decision made | Post-discussion decisions | ⭐⭐⭐⭐⭐ |
|
|
16
|
+
| `@codesyncer-todo` | TODO | Needs user confirmation | ⭐⭐⭐⭐ |
|
|
17
|
+
| `@codesyncer-context` | Business context | Domain knowledge, background | ⭐⭐⭐ |
|
|
18
|
+
|
|
19
|
+
### Legacy Compatibility
|
|
20
|
+
|
|
21
|
+
Existing `@claude-*` tags are fully compatible:
|
|
22
|
+
```typescript
|
|
23
|
+
@claude-rule = @codesyncer-rule
|
|
24
|
+
@claude-inference = @codesyncer-inference
|
|
25
|
+
@claude-decision = @codesyncer-decision
|
|
26
|
+
@claude-todo = @codesyncer-todo
|
|
27
|
+
@claude-context = @codesyncer-context
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 📝 Comment Levels
|
|
33
|
+
|
|
34
|
+
### 1. 📄 File Level (JSDoc)
|
|
35
|
+
|
|
36
|
+
**When**: Top of file, module-wide description
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
/**
|
|
40
|
+
* User authentication service
|
|
41
|
+
*
|
|
42
|
+
* @codesyncer-context JWT-based authentication system
|
|
43
|
+
* @codesyncer-rule Store tokens in httpOnly cookies (XSS prevention)
|
|
44
|
+
* @author CodeSyncer
|
|
45
|
+
* @date 2024-10-17
|
|
46
|
+
*/
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 2. 🔧 Function/Class/Component Level
|
|
50
|
+
|
|
51
|
+
**When**: Above each function, class, component definition
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
/**
|
|
55
|
+
* Order creation form
|
|
56
|
+
*
|
|
57
|
+
* @codesyncer-context 6-step order process
|
|
58
|
+
* @codesyncer-inference Auto-save at each step (common UX pattern)
|
|
59
|
+
* @codesyncer-decision [2024-10-15] Zustand for state management (complex form state)
|
|
60
|
+
*/
|
|
61
|
+
export default function OrderForm() {
|
|
62
|
+
// ...
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 3. 📝 Inline Level
|
|
67
|
+
|
|
68
|
+
**When**: Above or beside code lines
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
// @codesyncer-inference: Page size 20 (standard table UX)
|
|
72
|
+
const PAGE_SIZE = 20;
|
|
73
|
+
|
|
74
|
+
// @codesyncer-todo: Need to confirm mainApi endpoint URL
|
|
75
|
+
const API_URL = '/api/temp';
|
|
76
|
+
|
|
77
|
+
// @codesyncer-decision: [2024-10-17] Soft Delete (30-day recovery)
|
|
78
|
+
async function deleteUser(id: string) {
|
|
79
|
+
// @codesyncer-inference: Using deleted_at flag (for recovery feature)
|
|
80
|
+
return db.update(id, { deleted_at: new Date() });
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const maxRetry = 3; // @codesyncer-inference: 3 retries (stability)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## ✅ Good Comment Examples
|
|
89
|
+
|
|
90
|
+
### Example 1: Business Logic
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
/**
|
|
94
|
+
* Calculate shipping fee
|
|
95
|
+
*
|
|
96
|
+
* @codesyncer-context Shipping fee policy
|
|
97
|
+
* - Over $300: Free shipping
|
|
98
|
+
* - Under $300: $30
|
|
99
|
+
* - Remote areas: +$30
|
|
100
|
+
*
|
|
101
|
+
* @codesyncer-decision [2024-10-10] Policy finalized (Marketing team agreement)
|
|
102
|
+
* @codesyncer-rule Policy changes require Marketing team approval
|
|
103
|
+
*/
|
|
104
|
+
function calculateShippingFee(orderAmount: number, region: string): number {
|
|
105
|
+
// @codesyncer-inference: $300 threshold (industry standard)
|
|
106
|
+
const FREE_SHIPPING_THRESHOLD = 30000;
|
|
107
|
+
|
|
108
|
+
// @codesyncer-decision: [2024-10-10] Base fee $30
|
|
109
|
+
const BASIC_FEE = 3000;
|
|
110
|
+
|
|
111
|
+
// @codesyncer-todo: Confirm remote area list
|
|
112
|
+
const EXTRA_FEE_REGIONS = ['Jeju', 'Ulleungdo'];
|
|
113
|
+
|
|
114
|
+
if (orderAmount >= FREE_SHIPPING_THRESHOLD) {
|
|
115
|
+
return 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const baseFee = BASIC_FEE;
|
|
119
|
+
const extraFee = EXTRA_FEE_REGIONS.includes(region) ? 3000 : 0;
|
|
120
|
+
|
|
121
|
+
return baseFee + extraFee;
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Example 2: Data Structure
|
|
126
|
+
|
|
127
|
+
```tsx
|
|
128
|
+
/**
|
|
129
|
+
* User interface
|
|
130
|
+
*
|
|
131
|
+
* @codesyncer-context GDPR compliance required
|
|
132
|
+
* @codesyncer-rule Personal data must be encrypted
|
|
133
|
+
*/
|
|
134
|
+
interface User {
|
|
135
|
+
id: string;
|
|
136
|
+
|
|
137
|
+
// @codesyncer-inference: Using email as username (common pattern)
|
|
138
|
+
email: string;
|
|
139
|
+
|
|
140
|
+
// @codesyncer-decision: [2024-10-12] bcrypt hashing (security team recommendation)
|
|
141
|
+
passwordHash: string;
|
|
142
|
+
|
|
143
|
+
// @codesyncer-context: For Soft Delete
|
|
144
|
+
// @codesyncer-decision: [2024-10-15] Permanent delete after 30 days (GDPR)
|
|
145
|
+
deletedAt?: Date;
|
|
146
|
+
|
|
147
|
+
createdAt: Date;
|
|
148
|
+
updatedAt: Date;
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Example 3: Component
|
|
153
|
+
|
|
154
|
+
```tsx
|
|
155
|
+
/**
|
|
156
|
+
* Order list table component
|
|
157
|
+
*
|
|
158
|
+
* @codesyncer-context Customer order history view
|
|
159
|
+
* @codesyncer-inference Pagination needed (large dataset)
|
|
160
|
+
* @codesyncer-decision [2024-10-16] Using TanStack Table (performance)
|
|
161
|
+
*/
|
|
162
|
+
export function OrderListTable({ orders }: OrderListTableProps) {
|
|
163
|
+
// @codesyncer-inference: 20 items per page (UX standard)
|
|
164
|
+
const [pageSize, setPageSize] = useState(20);
|
|
165
|
+
|
|
166
|
+
// @codesyncer-todo: Add sorting options (date, amount, status)
|
|
167
|
+
|
|
168
|
+
return (
|
|
169
|
+
<Table>
|
|
170
|
+
{/* @codesyncer-rule: Switch to card layout on mobile */}
|
|
171
|
+
{/* ... */}
|
|
172
|
+
</Table>
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## ❌ Bad Comment Examples
|
|
180
|
+
|
|
181
|
+
### Comments to Avoid
|
|
182
|
+
|
|
183
|
+
```tsx
|
|
184
|
+
// ❌ Too vague
|
|
185
|
+
// @codesyncer-inference: Did this
|
|
186
|
+
const value = 10;
|
|
187
|
+
|
|
188
|
+
// ❌ No rationale
|
|
189
|
+
// @codesyncer-decision: Changed
|
|
190
|
+
const API_URL = '/api/new';
|
|
191
|
+
|
|
192
|
+
// ❌ Meaningless
|
|
193
|
+
// @codesyncer-todo: Later
|
|
194
|
+
function doSomething() {}
|
|
195
|
+
|
|
196
|
+
// ❌ Lacks context
|
|
197
|
+
// @codesyncer-context: Important
|
|
198
|
+
const IMPORTANT_VALUE = 42;
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Improved Versions
|
|
202
|
+
|
|
203
|
+
```tsx
|
|
204
|
+
// ✅ Specific rationale
|
|
205
|
+
// @codesyncer-inference: Default 10 (typical retry wait time)
|
|
206
|
+
const RETRY_DELAY = 10;
|
|
207
|
+
|
|
208
|
+
// ✅ Clear reason and date
|
|
209
|
+
// @codesyncer-decision: [2024-10-17] Changed to /api/v2 (API version upgrade)
|
|
210
|
+
const API_URL = '/api/v2';
|
|
211
|
+
|
|
212
|
+
// ✅ Specific TODO
|
|
213
|
+
// @codesyncer-todo: Add error handling (network errors, timeouts)
|
|
214
|
+
function fetchData() {}
|
|
215
|
+
|
|
216
|
+
// ✅ Business context explanation
|
|
217
|
+
// @codesyncer-context: VAT rate (10% as of 2024)
|
|
218
|
+
const TAX_RATE = 0.1;
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## 🔍 Comment Search
|
|
224
|
+
|
|
225
|
+
### Bash Commands
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
# Find all inferences
|
|
229
|
+
grep -r "@codesyncer-inference" ./src
|
|
230
|
+
|
|
231
|
+
# Check TODO list
|
|
232
|
+
grep -r "@codesyncer-todo" ./src
|
|
233
|
+
|
|
234
|
+
# Discussion decisions
|
|
235
|
+
grep -r "@codesyncer-decision" ./src
|
|
236
|
+
|
|
237
|
+
# Special rules
|
|
238
|
+
grep -r "@codesyncer-rule" ./src
|
|
239
|
+
|
|
240
|
+
# Business context
|
|
241
|
+
grep -r "@codesyncer-context" ./src
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### VS Code Search
|
|
245
|
+
|
|
246
|
+
1. `Cmd/Ctrl + Shift + F` (Global search)
|
|
247
|
+
2. Enter search term: `@codesyncer-todo`
|
|
248
|
+
3. File filter: `src/**/*.{ts,tsx,js,jsx}`
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## 📊 Comment Statistics
|
|
253
|
+
|
|
254
|
+
ARCHITECTURE.md automatically provides statistics:
|
|
255
|
+
|
|
256
|
+
```markdown
|
|
257
|
+
## Comment Tag Statistics
|
|
258
|
+
- @codesyncer-inference: 45
|
|
259
|
+
- @codesyncer-decision: 12
|
|
260
|
+
- @codesyncer-todo: 8
|
|
261
|
+
- @codesyncer-rule: 5
|
|
262
|
+
- @codesyncer-context: 15
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
Manual refresh with "update stats" command
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## 💡 Comment Writing Tips
|
|
270
|
+
|
|
271
|
+
### 1. Always provide rationale for inferences
|
|
272
|
+
|
|
273
|
+
```tsx
|
|
274
|
+
// ❌ @codesyncer-inference: Using useState
|
|
275
|
+
// ✅ @codesyncer-inference: Using useState (simple local state, Zustand unnecessary)
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
### 2. Include date and reason for decisions
|
|
279
|
+
|
|
280
|
+
```tsx
|
|
281
|
+
// ❌ @codesyncer-decision: Using Stripe
|
|
282
|
+
// ✅ @codesyncer-decision: [2024-10-15] Using Stripe (international payment support needed)
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### 3. Be specific with TODOs
|
|
286
|
+
|
|
287
|
+
```tsx
|
|
288
|
+
// ❌ @codesyncer-todo: Needs fix
|
|
289
|
+
// ✅ @codesyncer-todo: Add error boundary (fallback UI for API failures)
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### 4. Focus on "why" for context
|
|
293
|
+
|
|
294
|
+
```tsx
|
|
295
|
+
// ❌ @codesyncer-context: Authentication
|
|
296
|
+
// ✅ @codesyncer-context: OAuth 2.0 authentication (Google, Kakao login support)
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### 5. Rules only for exceptional cases
|
|
300
|
+
|
|
301
|
+
```tsx
|
|
302
|
+
// ❌ @codesyncer-rule: Using TypeScript (this is obvious)
|
|
303
|
+
// ✅ @codesyncer-rule: This file only allows any type (external library has no types)
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
## 🎯 Checklist
|
|
309
|
+
|
|
310
|
+
After writing code, verify:
|
|
311
|
+
|
|
312
|
+
- [ ] Added `@codesyncer-inference` for inferences?
|
|
313
|
+
- [ ] Recorded discussion decisions with `@codesyncer-decision`?
|
|
314
|
+
- [ ] Marked items needing confirmation with `@codesyncer-todo`?
|
|
315
|
+
- [ ] Explained business logic with `@codesyncer-context`?
|
|
316
|
+
- [ ] Specified special rules with `@codesyncer-rule`?
|
|
317
|
+
- [ ] Included specific rationale in all comments?
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
**Version**: 1.0.0
|
|
322
|
+
**Last Updated**: [TODAY]
|
|
323
|
+
|
|
324
|
+
*This comment system permanently records all decisions in code.*
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
# DECISIONS.md - Discussion Decision Log
|
|
2
|
+
|
|
3
|
+
> **Decision Log** - Permanent record of all important decisions
|
|
4
|
+
>
|
|
5
|
+
> Created: [TODAY]
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 📋 Record Format
|
|
10
|
+
|
|
11
|
+
All discussion decisions are automatically recorded in this format:
|
|
12
|
+
|
|
13
|
+
```markdown
|
|
14
|
+
---
|
|
15
|
+
### [Date] - [Topic]
|
|
16
|
+
**Category**: [CRITICAL/IMPORTANT/MINOR]
|
|
17
|
+
**Decision**: [Decision made]
|
|
18
|
+
**Reason**: [Rationale for decision]
|
|
19
|
+
**Alternatives**: [Other options considered]
|
|
20
|
+
**Decided By**: [User name or team name]
|
|
21
|
+
**Code Location**: [file path:line]
|
|
22
|
+
**Related Issue**: [Issue number or link]
|
|
23
|
+
---
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 📝 Decision Records
|
|
29
|
+
|
|
30
|
+
<!-- Auto-added here during discussions -->
|
|
31
|
+
|
|
32
|
+
### Example Record
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
### 2024-10-17 - Data Deletion Method Selection
|
|
36
|
+
**Category**: CRITICAL
|
|
37
|
+
**Decision**: Using Soft Delete method
|
|
38
|
+
**Reason**:
|
|
39
|
+
- Need 30-day recovery period (customer request response)
|
|
40
|
+
- Maintain statistical data
|
|
41
|
+
- GDPR compliance (permanent delete after 30 days)
|
|
42
|
+
**Alternatives**:
|
|
43
|
+
- Hard Delete: Immediate deletion (no recovery)
|
|
44
|
+
- Archive: Move to separate table (increased complexity)
|
|
45
|
+
**Decided By**: Dev team + Planning team collaboration
|
|
46
|
+
**Code Location**: `src/services/UserService.ts:45`
|
|
47
|
+
**Related Issue**: #123
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## 📊 Category Statistics
|
|
53
|
+
|
|
54
|
+
- **CRITICAL**: 0 (Payment, Security, Data deletion, etc.)
|
|
55
|
+
- **IMPORTANT**: 0 (Business logic, Pricing, External integration, etc.)
|
|
56
|
+
- **MINOR**: 0 (UI/UX, Performance optimization, etc.)
|
|
57
|
+
|
|
58
|
+
**Total Decisions**: 0
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## 🔍 Category Descriptions
|
|
63
|
+
|
|
64
|
+
### CRITICAL (Required Discussion)
|
|
65
|
+
- 💰 Payment/Billing related
|
|
66
|
+
- 🔐 Authentication/Authorization/Security
|
|
67
|
+
- 🗑️ Data deletion/Migration
|
|
68
|
+
- 📜 Personal data/Legal regulations
|
|
69
|
+
|
|
70
|
+
### IMPORTANT (Recommended Discussion)
|
|
71
|
+
- 💵 Pricing/Business logic
|
|
72
|
+
- 🔌 External API integration
|
|
73
|
+
- 🚀 Deployment/Infrastructure changes
|
|
74
|
+
|
|
75
|
+
### MINOR (Optional Discussion)
|
|
76
|
+
- 🎨 UI/UX improvements
|
|
77
|
+
- ⚡ Performance optimization
|
|
78
|
+
- 📦 Library changes
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## 🔗 Related Documents
|
|
83
|
+
|
|
84
|
+
Decisions are also recorded as comments in code:
|
|
85
|
+
|
|
86
|
+
```tsx
|
|
87
|
+
/**
|
|
88
|
+
* @codesyncer-decision: [2024-10-17] Soft Delete method
|
|
89
|
+
* Reason: 30-day recovery, GDPR compliance
|
|
90
|
+
*/
|
|
91
|
+
async function deleteUser(id: string) {
|
|
92
|
+
return db.update(id, { deleted_at: new Date() });
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Search**: `grep -r "@codesyncer-decision" ./src`
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## 📅 Monthly Statistics
|
|
101
|
+
|
|
102
|
+
### October 2024
|
|
103
|
+
- Total Decisions: 0
|
|
104
|
+
- CRITICAL: 0
|
|
105
|
+
- IMPORTANT: 0
|
|
106
|
+
- MINOR: 0
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## 💡 Discussion Process
|
|
111
|
+
|
|
112
|
+
### 1. Auto Keyword Detection
|
|
113
|
+
AI automatically pauses when detecting:
|
|
114
|
+
- Payment, authentication, deletion, pricing, etc.
|
|
115
|
+
|
|
116
|
+
### 2. Present Options
|
|
117
|
+
```
|
|
118
|
+
⚠️ 'payment' keyword detected. Discussion needed.
|
|
119
|
+
|
|
120
|
+
💡 Recommendation:
|
|
121
|
+
Use Stripe
|
|
122
|
+
|
|
123
|
+
🔄 Alternatives:
|
|
124
|
+
A. Iamport
|
|
125
|
+
B. Toss Payments
|
|
126
|
+
C. Custom implementation
|
|
127
|
+
|
|
128
|
+
How would you like to proceed?
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### 3. User Response
|
|
132
|
+
- "Proceed" → Adopt recommendation
|
|
133
|
+
- "Alternative A" → Choose alternative
|
|
134
|
+
- "Hold" → Decide later
|
|
135
|
+
|
|
136
|
+
### 4. Auto Record
|
|
137
|
+
- Add to DECISIONS.md
|
|
138
|
+
- Add `@codesyncer-decision` comment to code
|
|
139
|
+
- Update ARCHITECTURE.md statistics
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## 🎯 Best Practices
|
|
144
|
+
|
|
145
|
+
### ✅ Good Decision Record
|
|
146
|
+
|
|
147
|
+
```markdown
|
|
148
|
+
### 2024-10-15 - Payment System Selection
|
|
149
|
+
**Category**: CRITICAL
|
|
150
|
+
**Decision**: Using Stripe
|
|
151
|
+
**Reason**:
|
|
152
|
+
- International payment support needed
|
|
153
|
+
- Built-in subscription payment feature
|
|
154
|
+
- Stable service
|
|
155
|
+
**Alternatives**:
|
|
156
|
+
- Iamport: Korea only (no international)
|
|
157
|
+
- Toss: Subscription feature still lacking
|
|
158
|
+
**Decided By**: CTO + Dev team
|
|
159
|
+
**Code Location**: `src/services/PaymentService.ts`
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### ❌ Bad Decision Record
|
|
163
|
+
|
|
164
|
+
```markdown
|
|
165
|
+
### Yesterday - Something decided
|
|
166
|
+
**Category**: Important
|
|
167
|
+
**Decision**: This one
|
|
168
|
+
**Reason**: Just because
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## 🔄 Auto-Updates
|
|
174
|
+
|
|
175
|
+
This document auto-updates in these situations:
|
|
176
|
+
|
|
177
|
+
1. **Discussion-required keyword** detected and decision made
|
|
178
|
+
2. User explicitly requests discussion
|
|
179
|
+
3. When `@codesyncer-decision` tag added
|
|
180
|
+
|
|
181
|
+
**Manual Addition**: Can write directly in above format
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## 📚 Search
|
|
186
|
+
|
|
187
|
+
### Find Recent Decisions
|
|
188
|
+
```bash
|
|
189
|
+
# Last 10 decisions
|
|
190
|
+
tail -n 50 .claude/DECISIONS.md
|
|
191
|
+
|
|
192
|
+
# Specific category
|
|
193
|
+
grep "CRITICAL" .claude/DECISIONS.md
|
|
194
|
+
|
|
195
|
+
# Specific date
|
|
196
|
+
grep "2024-10-" .claude/DECISIONS.md
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Find Decisions in Code
|
|
200
|
+
```bash
|
|
201
|
+
# All decision comments
|
|
202
|
+
grep -r "@codesyncer-decision" ./src
|
|
203
|
+
|
|
204
|
+
# Decisions in specific file
|
|
205
|
+
grep "@codesyncer-decision" src/services/PaymentService.ts
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## 🤝 Team Collaboration
|
|
211
|
+
|
|
212
|
+
### New Team Member Onboarding
|
|
213
|
+
1. Read this file from start
|
|
214
|
+
2. Understand key decisions
|
|
215
|
+
3. Learn "why it was implemented this way"
|
|
216
|
+
|
|
217
|
+
### Decision Review
|
|
218
|
+
- Monthly team meeting review
|
|
219
|
+
- Mark decisions needing reconsideration
|
|
220
|
+
- Add changed decisions as new entries
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
**Version**: 1.0.0
|
|
225
|
+
**Last Updated**: [TODAY]
|
|
226
|
+
|
|
227
|
+
*All important decisions are permanently recorded. This is your team's knowledge asset.*
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# 🤖 [PROJECT_NAME] Multi-Repository Auto-Switching System
|
|
2
|
+
|
|
3
|
+
> Just request a feature, and your AI coding assistant will automatically find and work in the right repository.
|
|
4
|
+
>
|
|
5
|
+
> **Powered by CodeSyncer** - AI-agnostic multi-repository collaboration system
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 🎯 Core Operating Principle
|
|
10
|
+
|
|
11
|
+
### Automatic Repository Detection & Switching
|
|
12
|
+
When you request a feature, the AI assistant automatically:
|
|
13
|
+
1. Analyzes request → Identifies required repositories
|
|
14
|
+
2. Switches to the relevant repository
|
|
15
|
+
3. Applies each repository's CLAUDE.md rules
|
|
16
|
+
4. Performs the task
|
|
17
|
+
|
|
18
|
+
## 📁 Project Repository Structure
|
|
19
|
+
|
|
20
|
+
| Repository | Folder | Role | Rules File Location |
|
|
21
|
+
|------------|--------|------|---------------------|
|
|
22
|
+
[REPO_TABLE]
|
|
23
|
+
|
|
24
|
+
## 🧠 Automatic Repository Selection Rules
|
|
25
|
+
|
|
26
|
+
### Keyword-Based Auto Detection
|
|
27
|
+
| Keywords | Target Repository | Auto Command |
|
|
28
|
+
|----------|------------------|--------------|
|
|
29
|
+
[KEYWORD_MAPPING]
|
|
30
|
+
|
|
31
|
+
### Task Type-Based Auto Detection
|
|
32
|
+
```javascript
|
|
33
|
+
function auto_select_repository(user_request) {
|
|
34
|
+
// API modification needed?
|
|
35
|
+
if (request.match(/API|data|server|auth|DB/)) {
|
|
36
|
+
work_repos.push("backend repo");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// UI modification needed?
|
|
40
|
+
if (request.match(/page|screen|button|form|UI/)) {
|
|
41
|
+
work_repos.push("frontend repo");
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Multiple repos needed?
|
|
45
|
+
if (request.includes("feature") && !specific_repo_mentioned) {
|
|
46
|
+
// Backend → Frontend → Mobile order
|
|
47
|
+
return ["backend", "frontend", "mobile"];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return work_repos;
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## 🔄 Auto-Switching Protocol
|
|
55
|
+
|
|
56
|
+
### Single Repository Task
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
User: "Create login API"
|
|
60
|
+
|
|
61
|
+
AI Auto Action:
|
|
62
|
+
1. Detect "API" keyword
|
|
63
|
+
2. cd [backend folder]
|
|
64
|
+
3. cat CLAUDE.md # Load backend rules
|
|
65
|
+
4. [Create API following backend rules]
|
|
66
|
+
5. "✅ Login API created in [backend repo]"
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Multi-Repository Task
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
User: "Add payment feature"
|
|
73
|
+
|
|
74
|
+
AI Auto Action:
|
|
75
|
+
1. "feature" keyword → Multiple repos needed
|
|
76
|
+
2. Determine work order:
|
|
77
|
+
- Step 1: [backend] - API
|
|
78
|
+
- Step 2: [frontend] - UI
|
|
79
|
+
- Step 3: [mobile] - App screen
|
|
80
|
+
|
|
81
|
+
3. Sequential work:
|
|
82
|
+
cd [backend folder] && cat CLAUDE.md
|
|
83
|
+
→ Create payment API
|
|
84
|
+
|
|
85
|
+
cd ../[frontend folder] && cat CLAUDE.md
|
|
86
|
+
→ Create payment page
|
|
87
|
+
|
|
88
|
+
cd ../[mobile folder] && cat CLAUDE.md
|
|
89
|
+
→ Create payment screen
|
|
90
|
+
|
|
91
|
+
4. "✅ Payment feature fully implemented"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## ⚠️ Important Rules
|
|
95
|
+
|
|
96
|
+
### When Switching Repositories, Always
|
|
97
|
+
|
|
98
|
+
1. Check current location: `pwd`
|
|
99
|
+
2. Move to target repo: `cd ../[repo name]`
|
|
100
|
+
3. Load rules file: `cat CLAUDE.md || cat .claude/CLAUDE.md`
|
|
101
|
+
4. Notify rules applied: "📁 [repo name] rules applied"
|
|
102
|
+
5. Work following those rules
|
|
103
|
+
|
|
104
|
+
### Priority Order
|
|
105
|
+
|
|
106
|
+
1. User-specified repo > Auto detection
|
|
107
|
+
2. Each repo's CLAUDE.md > This master document
|
|
108
|
+
3. Backend work > Frontend/Mobile work (order)
|
|
109
|
+
|
|
110
|
+
## 🚀 Usage
|
|
111
|
+
|
|
112
|
+
### Session Start
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
"[PROJECT_NAME] multi-repo mode start"
|
|
116
|
+
→ Load this document
|
|
117
|
+
→ Activate auto-switching system
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Task Requests (User doesn't need to know repos)
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
"Add user management" → Auto work in all needed repos
|
|
124
|
+
"Fix bug" → Auto explore related repos
|
|
125
|
+
"Login page only" → Work only in frontend repo
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## 📊 Work Log Format
|
|
129
|
+
|
|
130
|
+
```yaml
|
|
131
|
+
Request: "[User request content]"
|
|
132
|
+
Analysis:
|
|
133
|
+
required_repos: [[repo1], [repo2]]
|
|
134
|
+
work_order: [backend → frontend]
|
|
135
|
+
Execution:
|
|
136
|
+
[repo1]:
|
|
137
|
+
navigate: cd [folder]
|
|
138
|
+
rules: Apply CLAUDE.md
|
|
139
|
+
work: [performed task]
|
|
140
|
+
result: ✅
|
|
141
|
+
[repo2]:
|
|
142
|
+
navigate: cd [folder]
|
|
143
|
+
rules: Apply CLAUDE.md
|
|
144
|
+
work: [performed task]
|
|
145
|
+
result: ✅
|
|
146
|
+
Complete: "[summary]"
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## 🏷️ Comment Tag System
|
|
152
|
+
|
|
153
|
+
CodeSyncer supports both tag formats:
|
|
154
|
+
|
|
155
|
+
- **`@codesyncer-*`** (Recommended): New standard, compatible with all AI tools
|
|
156
|
+
- **`@claude-*`** (Legacy): Compatible with existing Claude Code projects
|
|
157
|
+
|
|
158
|
+
### Available Tags
|
|
159
|
+
|
|
160
|
+
```typescript
|
|
161
|
+
@codesyncer-rule // Special rules (@claude-rule compatible)
|
|
162
|
+
@codesyncer-inference // Inference and rationale (@claude-inference compatible)
|
|
163
|
+
@codesyncer-decision // Discussion decisions (@claude-decision compatible)
|
|
164
|
+
@codesyncer-todo // Needs confirmation (@claude-todo compatible)
|
|
165
|
+
@codesyncer-context // Business context (@claude-context compatible)
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Both formats work identically, so use whichever you prefer!
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
**GitHub**: https://github.com/[GITHUB_USERNAME]/[PROJECT_NAME]
|
|
173
|
+
**Version**: 1.0.0 (Powered by CodeSyncer)
|
|
174
|
+
**Created**: [TODAY]
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
*CodeSyncer - AI-powered multi-repository collaboration system*
|
|
179
|
+
*Currently Supported: Claude Code | Coming Soon: Cursor, GitHub Copilot, Continue.dev*
|