@champpaba/claude-agent-kit 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 +21 -0
- package/README.md +561 -0
- package/bin/cli.js +61 -0
- package/lib/init.js +52 -0
- package/lib/update.js +73 -0
- package/package.json +47 -0
- package/template/.claude/CHANGELOG-v1.1.1.md +259 -0
- package/template/.claude/CLAUDE.md +329 -0
- package/template/.claude/agents/01-integration.md +797 -0
- package/template/.claude/agents/02-uxui-frontend.md +899 -0
- package/template/.claude/agents/03-test-debug.md +759 -0
- package/template/.claude/agents/04-frontend.md +1099 -0
- package/template/.claude/agents/05-backend.md +1217 -0
- package/template/.claude/agents/06-database.md +969 -0
- package/template/.claude/commands/agentsetup.md +1464 -0
- package/template/.claude/commands/cdev.md +327 -0
- package/template/.claude/commands/csetup.md +447 -0
- package/template/.claude/commands/cstatus.md +60 -0
- package/template/.claude/commands/cview.md +364 -0
- package/template/.claude/commands/psetup.md +101 -0
- package/template/.claude/contexts/design/accessibility.md +611 -0
- package/template/.claude/contexts/design/box-thinking.md +553 -0
- package/template/.claude/contexts/design/color-theory.md +498 -0
- package/template/.claude/contexts/design/index.md +247 -0
- package/template/.claude/contexts/design/layout.md +400 -0
- package/template/.claude/contexts/design/responsive.md +551 -0
- package/template/.claude/contexts/design/shadows.md +522 -0
- package/template/.claude/contexts/design/spacing.md +428 -0
- package/template/.claude/contexts/design/typography.md +465 -0
- package/template/.claude/contexts/domain/README.md +164 -0
- package/template/.claude/contexts/patterns/agent-coordination.md +388 -0
- package/template/.claude/contexts/patterns/agent-discovery.md +182 -0
- package/template/.claude/contexts/patterns/change-workflow.md +538 -0
- package/template/.claude/contexts/patterns/code-standards.md +515 -0
- package/template/.claude/contexts/patterns/development-principles.md +513 -0
- package/template/.claude/contexts/patterns/error-handling.md +478 -0
- package/template/.claude/contexts/patterns/error-recovery.md +365 -0
- package/template/.claude/contexts/patterns/frontend-component-strategy.md +365 -0
- package/template/.claude/contexts/patterns/git-workflow.md +207 -0
- package/template/.claude/contexts/patterns/logging.md +424 -0
- package/template/.claude/contexts/patterns/task-breakdown.md +452 -0
- package/template/.claude/contexts/patterns/task-classification.md +523 -0
- package/template/.claude/contexts/patterns/tdd-classification.md +516 -0
- package/template/.claude/contexts/patterns/testing.md +413 -0
- package/template/.claude/contexts/patterns/ui-component-consistency.md +304 -0
- package/template/.claude/contexts/patterns/validation-framework.md +776 -0
- package/template/.claude/lib/README.md +39 -0
- package/template/.claude/lib/agent-executor.md +258 -0
- package/template/.claude/lib/agent-router.md +572 -0
- package/template/.claude/lib/flags-updater.md +469 -0
- package/template/.claude/lib/tdd-classifier.md +345 -0
- package/template/.claude/lib/validation-gates.md +484 -0
- package/template/.claude/settings.local.json +42 -0
- package/template/.claude/templates/context-template.md +45 -0
- package/template/.claude/templates/flags-template.json +42 -0
- package/template/.claude/templates/phase-templates.json +124 -0
- package/template/.claude/templates/phases-sections/accessibility-test.md +17 -0
- package/template/.claude/templates/phases-sections/api-design.md +37 -0
- package/template/.claude/templates/phases-sections/backend-tests.md +16 -0
- package/template/.claude/templates/phases-sections/backend.md +37 -0
- package/template/.claude/templates/phases-sections/business-logic-validation.md +16 -0
- package/template/.claude/templates/phases-sections/component-tests.md +17 -0
- package/template/.claude/templates/phases-sections/contract-backend.md +16 -0
- package/template/.claude/templates/phases-sections/contract-frontend.md +16 -0
- package/template/.claude/templates/phases-sections/database.md +35 -0
- package/template/.claude/templates/phases-sections/documentation.md +17 -0
- package/template/.claude/templates/phases-sections/e2e-tests.md +16 -0
- package/template/.claude/templates/phases-sections/fix-implementation.md +17 -0
- package/template/.claude/templates/phases-sections/frontend-integration.md +18 -0
- package/template/.claude/templates/phases-sections/frontend-mockup.md +123 -0
- package/template/.claude/templates/phases-sections/manual-flow-test.md +15 -0
- package/template/.claude/templates/phases-sections/manual-ux-test.md +16 -0
- package/template/.claude/templates/phases-sections/refactor-implementation.md +17 -0
- package/template/.claude/templates/phases-sections/refactor.md +16 -0
- package/template/.claude/templates/phases-sections/regression-tests.md +15 -0
- package/template/.claude/templates/phases-sections/report.md +16 -0
- package/template/.claude/templates/phases-sections/responsive-test.md +16 -0
- package/template/.claude/templates/phases-sections/script-implementation.md +43 -0
- package/template/.claude/templates/phases-sections/test-coverage.md +16 -0
- package/template/.claude/templates/phases-sections/user-approval.md +14 -0
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
# Frontend Component Strategy
|
|
2
|
+
|
|
3
|
+
## Core Principle: Reuse First, Create Second
|
|
4
|
+
|
|
5
|
+
**Before creating ANY new component, ALWAYS:**
|
|
6
|
+
1. Search existing codebase for similar components
|
|
7
|
+
2. Identify reusable sub-components
|
|
8
|
+
3. Extract and reuse existing styles
|
|
9
|
+
4. Maintain consistent design patterns
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 🔍 Component Discovery Workflow
|
|
14
|
+
|
|
15
|
+
### Step 1: Search for Existing Components
|
|
16
|
+
|
|
17
|
+
**Before creating a new component, search the codebase:**
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Search for component files
|
|
21
|
+
Glob: "**/*.tsx", "**/*.jsx", "**/*.vue"
|
|
22
|
+
|
|
23
|
+
# Search for similar functionality
|
|
24
|
+
Grep: "export.*function.*FormInput"
|
|
25
|
+
Grep: "export.*const.*Button"
|
|
26
|
+
Grep: "interface.*Props"
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Common component locations:**
|
|
30
|
+
- `components/` or `src/components/`
|
|
31
|
+
- `app/components/`
|
|
32
|
+
- `lib/components/`
|
|
33
|
+
- `ui/` or `src/ui/`
|
|
34
|
+
|
|
35
|
+
### Step 2: Analyze Existing Patterns
|
|
36
|
+
|
|
37
|
+
**Read and understand:**
|
|
38
|
+
1. **Component structure** - How are components organized?
|
|
39
|
+
2. **Naming conventions** - PascalCase? camelCase? Prefixes?
|
|
40
|
+
3. **Props patterns** - How are props typed? Common patterns?
|
|
41
|
+
4. **Style approach** - CSS Modules? Tailwind? Styled-components?
|
|
42
|
+
|
|
43
|
+
**Example analysis:**
|
|
44
|
+
```typescript
|
|
45
|
+
// Found: components/ui/Button.tsx
|
|
46
|
+
export interface ButtonProps {
|
|
47
|
+
variant?: 'primary' | 'secondary' | 'ghost'
|
|
48
|
+
size?: 'sm' | 'md' | 'lg'
|
|
49
|
+
children: React.ReactNode
|
|
50
|
+
onClick?: () => void
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Pattern detected:
|
|
54
|
+
// - Props interfaces exported
|
|
55
|
+
// - variant + size pattern used
|
|
56
|
+
// - children always required
|
|
57
|
+
// → Use this pattern for new components!
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## ♻️ Reuse Strategies
|
|
63
|
+
|
|
64
|
+
### Strategy 1: Direct Reuse (Best)
|
|
65
|
+
|
|
66
|
+
**Use existing component as-is:**
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
// ✅ GOOD: Reuse existing Button
|
|
70
|
+
import { Button } from '@/components/ui/Button'
|
|
71
|
+
|
|
72
|
+
export function LoginForm() {
|
|
73
|
+
return (
|
|
74
|
+
<form>
|
|
75
|
+
<Button variant="primary" size="lg">
|
|
76
|
+
Sign In
|
|
77
|
+
</Button>
|
|
78
|
+
</form>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// ❌ BAD: Create duplicate button
|
|
83
|
+
export function LoginButton() {
|
|
84
|
+
return <button className="primary-button">Sign In</button>
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Strategy 2: Composition (Good)
|
|
89
|
+
|
|
90
|
+
**Compose new component from existing ones:**
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
// ✅ GOOD: Compose from existing components
|
|
94
|
+
import { Button } from '@/components/ui/Button'
|
|
95
|
+
import { Input } from '@/components/ui/Input'
|
|
96
|
+
import { Card } from '@/components/ui/Card'
|
|
97
|
+
|
|
98
|
+
export function LoginForm() {
|
|
99
|
+
return (
|
|
100
|
+
<Card>
|
|
101
|
+
<Input label="Email" type="email" />
|
|
102
|
+
<Input label="Password" type="password" />
|
|
103
|
+
<Button>Sign In</Button>
|
|
104
|
+
</Card>
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Strategy 3: Extension (Acceptable)
|
|
110
|
+
|
|
111
|
+
**Extend existing component when needed:**
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
// ✅ ACCEPTABLE: Extend existing component
|
|
115
|
+
import { Button, ButtonProps } from '@/components/ui/Button'
|
|
116
|
+
|
|
117
|
+
interface IconButtonProps extends ButtonProps {
|
|
118
|
+
icon: React.ReactNode
|
|
119
|
+
iconPosition?: 'left' | 'right'
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function IconButton({ icon, iconPosition = 'left', children, ...props }: IconButtonProps) {
|
|
123
|
+
return (
|
|
124
|
+
<Button {...props}>
|
|
125
|
+
{iconPosition === 'left' && icon}
|
|
126
|
+
{children}
|
|
127
|
+
{iconPosition === 'right' && icon}
|
|
128
|
+
</Button>
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Strategy 4: New Component (Last Resort)
|
|
134
|
+
|
|
135
|
+
**Only create new component if:**
|
|
136
|
+
- ✅ No existing component matches functionality
|
|
137
|
+
- ✅ Cannot compose from existing components
|
|
138
|
+
- ✅ Extension would be too complex
|
|
139
|
+
|
|
140
|
+
**When creating new component:**
|
|
141
|
+
```typescript
|
|
142
|
+
// ✅ GOOD: Follow existing patterns
|
|
143
|
+
// 1. Check existing Button.tsx for patterns
|
|
144
|
+
// 2. Use same prop structure
|
|
145
|
+
// 3. Use same styling approach
|
|
146
|
+
// 4. Use same naming conventions
|
|
147
|
+
|
|
148
|
+
export interface NewComponentProps {
|
|
149
|
+
variant?: 'primary' | 'secondary' // ← Same pattern as Button
|
|
150
|
+
size?: 'sm' | 'md' | 'lg' // ← Same pattern as Button
|
|
151
|
+
children: React.ReactNode // ← Same pattern as Button
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export function NewComponent({ variant = 'primary', size = 'md', children }: NewComponentProps) {
|
|
155
|
+
// Implementation following existing patterns
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## 🎨 Style Consistency
|
|
162
|
+
|
|
163
|
+
### Step 1: Extract Existing Styles
|
|
164
|
+
|
|
165
|
+
**Before adding styles, find existing style patterns:**
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
# Search for style definitions
|
|
169
|
+
Grep: "className.*button"
|
|
170
|
+
Grep: "bg-blue-"
|
|
171
|
+
Grep: "@apply"
|
|
172
|
+
Grep: "styled\."
|
|
173
|
+
|
|
174
|
+
# Read style files
|
|
175
|
+
Read: "styles/globals.css"
|
|
176
|
+
Read: "tailwind.config.js"
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Step 2: Reuse Style Patterns
|
|
180
|
+
|
|
181
|
+
**Example: Found existing button styles**
|
|
182
|
+
|
|
183
|
+
```typescript
|
|
184
|
+
// Existing Button component uses:
|
|
185
|
+
className="bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded-md"
|
|
186
|
+
|
|
187
|
+
// ✅ GOOD: Reuse same colors and spacing
|
|
188
|
+
className="bg-blue-600 hover:bg-blue-700 px-6 py-3 rounded-md"
|
|
189
|
+
↑ ↑
|
|
190
|
+
Adjusted for larger size
|
|
191
|
+
|
|
192
|
+
// ❌ BAD: Introduce new colors
|
|
193
|
+
className="bg-indigo-500 hover:bg-indigo-600 p-3 rounded"
|
|
194
|
+
↑ New color! ↑ Different spacing pattern!
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Step 3: Extract to Shared Utilities (if needed)
|
|
198
|
+
|
|
199
|
+
**If you find repeated styles, suggest extraction:**
|
|
200
|
+
|
|
201
|
+
```typescript
|
|
202
|
+
// Found pattern:
|
|
203
|
+
// Button: "px-4 py-2 rounded-md font-medium"
|
|
204
|
+
// Card: "px-6 py-4 rounded-md shadow-sm"
|
|
205
|
+
// Input: "px-3 py-2 rounded-md border"
|
|
206
|
+
|
|
207
|
+
// Suggest extraction to design tokens:
|
|
208
|
+
const spacing = {
|
|
209
|
+
sm: 'px-3 py-2',
|
|
210
|
+
md: 'px-4 py-2',
|
|
211
|
+
lg: 'px-6 py-4'
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const rounded = 'rounded-md' // Consistent corner radius
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## 📋 Component Creation Checklist
|
|
220
|
+
|
|
221
|
+
Before creating a new component, complete this checklist:
|
|
222
|
+
|
|
223
|
+
### 1. Discovery Phase
|
|
224
|
+
- [ ] Searched for existing similar components
|
|
225
|
+
- [ ] Read at least 3 existing components to understand patterns
|
|
226
|
+
- [ ] Identified reusable sub-components
|
|
227
|
+
- [ ] Found existing style patterns
|
|
228
|
+
|
|
229
|
+
### 2. Planning Phase
|
|
230
|
+
- [ ] Can I reuse existing component? (Try first!)
|
|
231
|
+
- [ ] Can I compose from existing components?
|
|
232
|
+
- [ ] Can I extend existing component?
|
|
233
|
+
- [ ] Do I really need a new component?
|
|
234
|
+
|
|
235
|
+
### 3. Implementation Phase
|
|
236
|
+
- [ ] Follow existing naming conventions
|
|
237
|
+
- [ ] Use same prop patterns (variant, size, etc.)
|
|
238
|
+
- [ ] Reuse existing styles and colors
|
|
239
|
+
- [ ] Use existing spacing patterns
|
|
240
|
+
- [ ] Import and use existing sub-components
|
|
241
|
+
|
|
242
|
+
### 4. Validation Phase
|
|
243
|
+
- [ ] Component looks consistent with existing UI
|
|
244
|
+
- [ ] Props interface matches existing patterns
|
|
245
|
+
- [ ] Styles match existing color palette
|
|
246
|
+
- [ ] No duplicate functionality with existing components
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## 🛠️ Tools for Discovery
|
|
251
|
+
|
|
252
|
+
### Glob Tool - Find Components
|
|
253
|
+
```
|
|
254
|
+
Pattern: "**/*Button*.{tsx,jsx,vue}"
|
|
255
|
+
Pattern: "**/*Form*.{tsx,jsx,vue}"
|
|
256
|
+
Pattern: "**/components/**/*.{tsx,jsx,vue}"
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Grep Tool - Search Patterns
|
|
260
|
+
```
|
|
261
|
+
Pattern: "export.*function.*Button"
|
|
262
|
+
Pattern: "interface.*Props"
|
|
263
|
+
Pattern: "className=.*bg-blue"
|
|
264
|
+
Pattern: "@apply.*button"
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### Read Tool - Analyze Components
|
|
268
|
+
```
|
|
269
|
+
Read: "components/ui/Button.tsx"
|
|
270
|
+
Read: "styles/globals.css"
|
|
271
|
+
Read: "tailwind.config.js"
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
## 📊 Example Workflow
|
|
277
|
+
|
|
278
|
+
**Task:** Create a login form
|
|
279
|
+
|
|
280
|
+
### ❌ BAD Workflow (No Discovery)
|
|
281
|
+
```
|
|
282
|
+
1. Create LoginForm.tsx
|
|
283
|
+
2. Create LoginButton.tsx
|
|
284
|
+
3. Create LoginInput.tsx
|
|
285
|
+
4. Add custom styles
|
|
286
|
+
→ Result: Duplicate components, inconsistent styles
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### ✅ GOOD Workflow (Discovery First)
|
|
290
|
+
```
|
|
291
|
+
1. Search existing components:
|
|
292
|
+
Glob: "**/*{Button,Input,Form}*.tsx"
|
|
293
|
+
→ Found: components/ui/Button.tsx
|
|
294
|
+
→ Found: components/ui/Input.tsx
|
|
295
|
+
→ Found: components/ui/Card.tsx
|
|
296
|
+
|
|
297
|
+
2. Read existing components:
|
|
298
|
+
Read: "components/ui/Button.tsx"
|
|
299
|
+
→ Props: variant, size, children
|
|
300
|
+
→ Styles: bg-blue-600, px-4 py-2, rounded-md
|
|
301
|
+
|
|
302
|
+
3. Compose LoginForm:
|
|
303
|
+
import { Button } from '@/components/ui/Button'
|
|
304
|
+
import { Input } from '@/components/ui/Input'
|
|
305
|
+
import { Card } from '@/components/ui/Card'
|
|
306
|
+
|
|
307
|
+
4. Result: Consistent UI, reused components, minimal new code
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## 🎯 Key Principles
|
|
313
|
+
|
|
314
|
+
1. **Search Before Create** - Always search existing codebase first
|
|
315
|
+
2. **Reuse > Compose > Extend > Create** - Follow this priority
|
|
316
|
+
3. **Consistency Over Uniqueness** - Match existing patterns, don't innovate
|
|
317
|
+
4. **Extract Common Patterns** - Identify and suggest reusable utilities
|
|
318
|
+
5. **Document Reuse** - Comment where components are reused from
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
## 🚨 Anti-Patterns to Avoid
|
|
323
|
+
|
|
324
|
+
### ❌ Creating Duplicate Components
|
|
325
|
+
```typescript
|
|
326
|
+
// BAD: Creating new button when Button exists
|
|
327
|
+
export function LoginButton() { ... }
|
|
328
|
+
|
|
329
|
+
// GOOD: Reuse existing Button
|
|
330
|
+
import { Button } from '@/components/ui/Button'
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
### ❌ Inconsistent Styling
|
|
334
|
+
```typescript
|
|
335
|
+
// BAD: New color scheme
|
|
336
|
+
className="bg-indigo-500" // When project uses bg-blue-*
|
|
337
|
+
|
|
338
|
+
// GOOD: Reuse existing colors
|
|
339
|
+
className="bg-blue-600" // Match existing buttons
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
### ❌ Different Prop Patterns
|
|
343
|
+
```typescript
|
|
344
|
+
// BAD: Different naming
|
|
345
|
+
interface Props {
|
|
346
|
+
type: 'big' | 'small' // When existing uses 'size'
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// GOOD: Match existing patterns
|
|
350
|
+
interface Props {
|
|
351
|
+
size: 'sm' | 'md' | 'lg' // Same as Button component
|
|
352
|
+
}
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
---
|
|
356
|
+
|
|
357
|
+
## 📚 Related Patterns
|
|
358
|
+
|
|
359
|
+
- `@/.claude/contexts/design/` - Design system foundation
|
|
360
|
+
- `@/.claude/contexts/patterns/code-standards.md` - Code quality guidelines
|
|
361
|
+
- `@/.claude/contexts/patterns/development-principles.md` - KISS, YAGNI principles
|
|
362
|
+
|
|
363
|
+
---
|
|
364
|
+
|
|
365
|
+
**Remember:** The best code is code you don't have to write. Reuse first, create last.
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Git Workflow
|
|
2
|
+
|
|
3
|
+
## Commit Message Guidelines
|
|
4
|
+
|
|
5
|
+
### Format
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
<type>: <subject>
|
|
9
|
+
|
|
10
|
+
<body (optional)>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Types
|
|
14
|
+
- `feat`: New feature
|
|
15
|
+
- `fix`: Bug fix
|
|
16
|
+
- `docs`: Documentation changes
|
|
17
|
+
- `refactor`: Code refactoring
|
|
18
|
+
- `test`: Adding tests
|
|
19
|
+
- `chore`: Maintenance tasks
|
|
20
|
+
|
|
21
|
+
### Rules
|
|
22
|
+
|
|
23
|
+
**DO:**
|
|
24
|
+
- ✅ Write clear, concise commit messages
|
|
25
|
+
- ✅ Use imperative mood ("add feature" not "added feature")
|
|
26
|
+
- ✅ Keep subject line under 72 characters
|
|
27
|
+
- ✅ Explain WHY in the body, not WHAT (code shows what)
|
|
28
|
+
|
|
29
|
+
**DON'T:**
|
|
30
|
+
- ❌ **Do NOT add Claude Code footer** (`🤖 Generated with [Claude Code]...`)
|
|
31
|
+
- ❌ **Do NOT add Co-Authored-By: Claude** attribution
|
|
32
|
+
- ❌ Don't use vague messages ("fix bug", "update code")
|
|
33
|
+
- ❌ Don't commit commented-out code
|
|
34
|
+
- ❌ Don't commit secrets or credentials
|
|
35
|
+
|
|
36
|
+
### Examples
|
|
37
|
+
|
|
38
|
+
**✅ GOOD:**
|
|
39
|
+
```
|
|
40
|
+
feat: add user authentication with JWT
|
|
41
|
+
|
|
42
|
+
Implemented JWT-based authentication to replace session-based auth.
|
|
43
|
+
This improves security and enables stateless API design.
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**❌ BAD:**
|
|
47
|
+
```
|
|
48
|
+
feat: add user authentication
|
|
49
|
+
|
|
50
|
+
Added authentication stuff.
|
|
51
|
+
|
|
52
|
+
🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
|
53
|
+
|
|
54
|
+
Co-Authored-By: Claude <noreply@anthropic.com>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Branching Strategy
|
|
60
|
+
|
|
61
|
+
### Main Branch
|
|
62
|
+
- Always production-ready
|
|
63
|
+
- Never commit directly (use PRs)
|
|
64
|
+
- Protected branch with reviews
|
|
65
|
+
|
|
66
|
+
### Feature Branches
|
|
67
|
+
- Format: `feature/description` or `feat/description`
|
|
68
|
+
- Short-lived (merge within days)
|
|
69
|
+
- Delete after merge
|
|
70
|
+
|
|
71
|
+
### Bug Fix Branches
|
|
72
|
+
- Format: `fix/description` or `bugfix/description`
|
|
73
|
+
- Create from main
|
|
74
|
+
- Merge back to main
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Pull Request Workflow
|
|
79
|
+
|
|
80
|
+
### Before Creating PR
|
|
81
|
+
|
|
82
|
+
1. **Update from main:**
|
|
83
|
+
```bash
|
|
84
|
+
git checkout main
|
|
85
|
+
git pull
|
|
86
|
+
git checkout feature/your-feature
|
|
87
|
+
git rebase main
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
2. **Run tests:**
|
|
91
|
+
```bash
|
|
92
|
+
npm test
|
|
93
|
+
# or
|
|
94
|
+
pytest
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
3. **Review your changes:**
|
|
98
|
+
```bash
|
|
99
|
+
git diff main...HEAD
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### PR Description Template
|
|
103
|
+
|
|
104
|
+
```markdown
|
|
105
|
+
## Summary
|
|
106
|
+
Brief description of changes
|
|
107
|
+
|
|
108
|
+
## Changes
|
|
109
|
+
- Change 1
|
|
110
|
+
- Change 2
|
|
111
|
+
|
|
112
|
+
## Testing
|
|
113
|
+
- [ ] Unit tests pass
|
|
114
|
+
- [ ] Manual testing completed
|
|
115
|
+
- [ ] No breaking changes
|
|
116
|
+
|
|
117
|
+
## Screenshots (if UI changes)
|
|
118
|
+
[Add screenshots]
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**DO NOT include:**
|
|
122
|
+
- ❌ Claude Code attribution footer
|
|
123
|
+
- ❌ AI-generated disclaimers
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Best Practices
|
|
128
|
+
|
|
129
|
+
### Commits
|
|
130
|
+
|
|
131
|
+
1. **Atomic commits** - One logical change per commit
|
|
132
|
+
2. **Frequent commits** - Commit working code often
|
|
133
|
+
3. **Meaningful messages** - Future you will thank you
|
|
134
|
+
|
|
135
|
+
### Files to .gitignore
|
|
136
|
+
|
|
137
|
+
```gitignore
|
|
138
|
+
# Environment
|
|
139
|
+
.env
|
|
140
|
+
.env.local
|
|
141
|
+
*.local
|
|
142
|
+
|
|
143
|
+
# Dependencies
|
|
144
|
+
node_modules/
|
|
145
|
+
__pycache__/
|
|
146
|
+
*.pyc
|
|
147
|
+
|
|
148
|
+
# Build outputs
|
|
149
|
+
dist/
|
|
150
|
+
build/
|
|
151
|
+
.next/
|
|
152
|
+
|
|
153
|
+
# IDE
|
|
154
|
+
.vscode/
|
|
155
|
+
.idea/
|
|
156
|
+
*.swp
|
|
157
|
+
|
|
158
|
+
# OS
|
|
159
|
+
.DS_Store
|
|
160
|
+
Thumbs.db
|
|
161
|
+
|
|
162
|
+
# Logs
|
|
163
|
+
*.log
|
|
164
|
+
logs/
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Recovery Commands
|
|
170
|
+
|
|
171
|
+
### Undo last commit (keep changes)
|
|
172
|
+
```bash
|
|
173
|
+
git reset --soft HEAD~1
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Undo last commit (discard changes)
|
|
177
|
+
```bash
|
|
178
|
+
git reset --hard HEAD~1
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Undo changes to file
|
|
182
|
+
```bash
|
|
183
|
+
git checkout -- file.txt
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Unstage file
|
|
187
|
+
```bash
|
|
188
|
+
git restore --staged file.txt
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## IMPORTANT: No AI Attribution
|
|
194
|
+
|
|
195
|
+
**When committing code:**
|
|
196
|
+
|
|
197
|
+
- ❌ **Do NOT add:** `🤖 Generated with [Claude Code]`
|
|
198
|
+
- ❌ **Do NOT add:** `Co-Authored-By: Claude <noreply@anthropic.com>`
|
|
199
|
+
- ❌ **Do NOT add:** Any AI-related footers or attributions
|
|
200
|
+
|
|
201
|
+
**Reason:**
|
|
202
|
+
- Git history should reflect actual code changes, not tooling
|
|
203
|
+
- Attribution clutters git log
|
|
204
|
+
- Code ownership is clear from git author
|
|
205
|
+
- Professional projects don't need AI disclaimers
|
|
206
|
+
|
|
207
|
+
**Keep commits clean and professional.**
|