@husnudarici/claude-kit 1.0.0 → 1.1.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 +67 -38
- package/package.json +3 -2
- package/templates/.claude/agents/backend-helper.md +54 -0
- package/templates/.claude/agents/frontend-developer.md +60 -0
- package/templates/.claude/agents/mobile-developer.md +53 -0
- package/templates/.claude/agents/reverse-engineer.md +63 -0
- package/templates/.claude/commands/new-saas-feature.md +46 -0
- package/templates/.claude/rules/frontend.md +15 -0
- package/templates/.claude/rules/mobile.md +50 -0
- package/templates/.claude/rules/saas.md +46 -0
- package/templates/.claude/settings.json +3 -9
- package/templates/.claude/skills/saas-patterns/SKILL.md +57 -0
- package/templates/CLAUDE.md +23 -7
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 husnudarici
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
# claude-kit
|
|
1
|
+
# @husnudarici/claude-kit
|
|
2
2
|
|
|
3
3
|
Scaffold a complete `.claude/` folder structure for [Claude Code](https://docs.anthropic.com/en/docs/claude-code) projects with one command.
|
|
4
4
|
|
|
5
|
-
Sets up agents, commands, hooks, rules, skills, and settings so Claude Code works exactly the way you want.
|
|
5
|
+
Sets up agents, commands, hooks, rules, skills, and settings so Claude Code works exactly the way you want -- optimized for SaaS developers building Web, Android, and iOS apps.
|
|
6
6
|
|
|
7
7
|
## Quick Start
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npx claude-kit init
|
|
10
|
+
npx @husnudarici/claude-kit init
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
That's it. Your `.claude/` folder is ready.
|
|
@@ -16,35 +16,50 @@ That's it. Your `.claude/` folder is ready.
|
|
|
16
16
|
|
|
17
17
|
```
|
|
18
18
|
.claude/
|
|
19
|
-
├── agents/
|
|
20
|
-
│ ├── code-reviewer.md
|
|
21
|
-
│ ├── debugger.md
|
|
22
|
-
│ ├── test-writer.md
|
|
23
|
-
│ ├── refactorer.md
|
|
24
|
-
│ ├── doc-writer.md
|
|
25
|
-
│
|
|
26
|
-
├──
|
|
27
|
-
│ ├──
|
|
28
|
-
│ ├──
|
|
29
|
-
│ └──
|
|
30
|
-
├──
|
|
31
|
-
│ ├──
|
|
32
|
-
│
|
|
33
|
-
├──
|
|
34
|
-
│
|
|
35
|
-
|
|
36
|
-
│
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
│
|
|
40
|
-
|
|
41
|
-
|
|
19
|
+
├── agents/ # Custom AI agents
|
|
20
|
+
│ ├── code-reviewer.md # Reviews PRs for bugs, security, performance
|
|
21
|
+
│ ├── debugger.md # Systematic bug diagnosis
|
|
22
|
+
│ ├── test-writer.md # Generates comprehensive test suites
|
|
23
|
+
│ ├── refactorer.md # Improves code structure safely
|
|
24
|
+
│ ├── doc-writer.md # Generates documentation from code
|
|
25
|
+
│ ├── security-auditor.md # OWASP-based security audits
|
|
26
|
+
│ ├── frontend-developer.md # Builds complete UI features autonomously
|
|
27
|
+
│ ├── backend-helper.md # Backend work with simple explanations
|
|
28
|
+
│ ├── mobile-developer.md # Cross-platform Android & iOS development
|
|
29
|
+
│ └── reverse-engineer.md # Analyzes competitors and libraries
|
|
30
|
+
├── commands/ # One-word automations
|
|
31
|
+
│ ├── fix-issue.md # Diagnose and fix GitHub issues
|
|
32
|
+
│ ├── deploy.md # Deploy to production with all checks
|
|
33
|
+
│ ├── pr-review.md # Thorough PR review workflow
|
|
34
|
+
│ └── new-saas-feature.md # Build a full SaaS feature end-to-end
|
|
35
|
+
├── hooks/ # Auto-run scripts
|
|
36
|
+
│ ├── pre-commit.sh # Type check + lint + test before commit
|
|
37
|
+
│ └── lint-on-save.sh # Auto-lint after every file edit
|
|
38
|
+
├── rules/ # Guardrails scoped to file patterns
|
|
39
|
+
│ ├── frontend.md # Component structure, styling, performance, a11y
|
|
40
|
+
│ ├── database.md # Query safety and migration rules
|
|
41
|
+
│ ├── api.md # API route validation and error handling
|
|
42
|
+
│ ├── mobile.md # Mobile app platform rules
|
|
43
|
+
│ └── saas.md # SaaS patterns (auth, billing, onboarding)
|
|
44
|
+
├── skills/ # Reusable capability bundles
|
|
45
|
+
│ ├── frontend-design/
|
|
46
|
+
│ │ └── SKILL.md # Design system enforcement
|
|
47
|
+
│ └── saas-patterns/
|
|
48
|
+
│ └── SKILL.md # SaaS UI/UX patterns
|
|
49
|
+
└── settings.json # Permissions, model, hooks config
|
|
50
|
+
CLAUDE.md # Project brain -- root context file
|
|
42
51
|
```
|
|
43
52
|
|
|
44
53
|
## Features
|
|
45
54
|
|
|
46
|
-
### Agents
|
|
55
|
+
### Agents (10)
|
|
56
|
+
|
|
47
57
|
Custom AI teammates that handle specific tasks autonomously:
|
|
58
|
+
|
|
59
|
+
- **frontend-developer** -- Builds complete UI features; you review, it codes
|
|
60
|
+
- **backend-helper** -- Builds APIs and DB schemas, explains everything simply for frontend devs
|
|
61
|
+
- **mobile-developer** -- Cross-platform Android & iOS with React Native / Expo
|
|
62
|
+
- **reverse-engineer** -- Analyzes competitor apps, libraries, and npm packages
|
|
48
63
|
- **code-reviewer** -- Reviews code for bugs, security issues, and performance
|
|
49
64
|
- **debugger** -- Traces bugs systematically using evidence
|
|
50
65
|
- **test-writer** -- Generates unit, integration, and edge case tests
|
|
@@ -52,42 +67,56 @@ Custom AI teammates that handle specific tasks autonomously:
|
|
|
52
67
|
- **doc-writer** -- Creates clear documentation from code analysis
|
|
53
68
|
- **security-auditor** -- Audits code following OWASP top 10
|
|
54
69
|
|
|
55
|
-
### Commands
|
|
70
|
+
### Commands (4)
|
|
71
|
+
|
|
56
72
|
Slash commands that trigger multi-step workflows:
|
|
73
|
+
|
|
57
74
|
- `/deploy` -- Full deployment with pre-flight checks and verification
|
|
58
75
|
- `/fix-issue` -- End-to-end GitHub issue resolution
|
|
59
76
|
- `/pr-review` -- Thorough pull request review
|
|
77
|
+
- `/new-saas-feature` -- Plan and build a complete SaaS feature (DB + API + Web + Mobile)
|
|
78
|
+
|
|
79
|
+
### Hooks (2)
|
|
80
|
+
|
|
81
|
+
Shell scripts that auto-run after Claude's actions:
|
|
60
82
|
|
|
61
|
-
### Hooks
|
|
62
|
-
Shell scripts that auto-run before or after Claude's actions:
|
|
63
83
|
- **pre-commit.sh** -- Blocks commits if types, lint, or tests fail
|
|
64
84
|
- **lint-on-save.sh** -- Auto-lints files after every Edit/Write
|
|
65
85
|
|
|
66
|
-
### Rules
|
|
86
|
+
### Rules (5)
|
|
87
|
+
|
|
67
88
|
Guardrails scoped to specific file patterns:
|
|
68
|
-
|
|
89
|
+
|
|
90
|
+
- **frontend.md** -- Feature-based component structure (enforced), styling, performance, a11y
|
|
69
91
|
- **database.md** -- Query safety, migrations, RLS, performance
|
|
70
92
|
- **api.md** -- Input validation, auth, error handling, rate limiting
|
|
93
|
+
- **mobile.md** -- Navigation, safe areas, platform differences, offline, app store rules
|
|
94
|
+
- **saas.md** -- Auth flows, subscription/billing, multi-tenancy, onboarding
|
|
95
|
+
|
|
96
|
+
### Skills (2)
|
|
71
97
|
|
|
72
|
-
### Skills
|
|
73
98
|
Reusable capability bundles with prompts and triggers:
|
|
99
|
+
|
|
74
100
|
- **frontend-design** -- Enforces design system (colors, typography, spacing)
|
|
101
|
+
- **saas-patterns** -- SaaS UI patterns (pricing, dashboard, settings, onboarding, auth pages)
|
|
75
102
|
|
|
76
103
|
### Settings
|
|
104
|
+
|
|
77
105
|
Pre-configured `settings.json` with:
|
|
106
|
+
|
|
78
107
|
- Safe permission allow/deny lists
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
108
|
+
- Lint-on-save hook for auto-formatting
|
|
109
|
+
- Expo and React Native commands whitelisted
|
|
110
|
+
- Model selection, memory, and git instruction toggles
|
|
82
111
|
|
|
83
112
|
## Options
|
|
84
113
|
|
|
85
114
|
```bash
|
|
86
115
|
# Scaffold with defaults (skips existing files)
|
|
87
|
-
npx claude-kit init
|
|
116
|
+
npx @husnudarici/claude-kit init
|
|
88
117
|
|
|
89
118
|
# Overwrite existing files
|
|
90
|
-
npx claude-kit init --force
|
|
119
|
+
npx @husnudarici/claude-kit init --force
|
|
91
120
|
```
|
|
92
121
|
|
|
93
122
|
## Customization
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@husnudarici/claude-kit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Scaffold a .claude/ folder with agents, commands, hooks, rules, skills, and settings for Claude Code projects",
|
|
5
5
|
"main": "bin/cli.js",
|
|
6
6
|
"bin": {
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"bin/",
|
|
11
|
-
"templates/"
|
|
11
|
+
"templates/",
|
|
12
|
+
"LICENSE"
|
|
12
13
|
],
|
|
13
14
|
"scripts": {
|
|
14
15
|
"test": "node bin/cli.js --help"
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: backend-helper
|
|
3
|
+
description: Backend developer that explains everything simply.
|
|
4
|
+
Builds APIs, database schemas, and auth flows for front-end developers.
|
|
5
|
+
tools: Read, Glob, Grep, Bash, Edit, Write
|
|
6
|
+
model: sonnet
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You are a patient backend developer working with a front-end focused tech lead.
|
|
10
|
+
The user understands UI/UX deeply but has NO backend experience.
|
|
11
|
+
|
|
12
|
+
## Communication style
|
|
13
|
+
- Explain every backend decision in simple terms
|
|
14
|
+
- Use analogies from front-end world when possible
|
|
15
|
+
- Never assume backend knowledge
|
|
16
|
+
- When you create something, briefly explain WHY it's structured that way
|
|
17
|
+
- If there are multiple approaches, recommend the simplest one
|
|
18
|
+
|
|
19
|
+
## Step 1: Understand the need
|
|
20
|
+
- Ask what the frontend needs from the backend
|
|
21
|
+
- Map UI actions to required API endpoints
|
|
22
|
+
- Identify what data needs to be stored and how
|
|
23
|
+
|
|
24
|
+
## Step 2: Database design
|
|
25
|
+
- Design schemas with clear naming
|
|
26
|
+
- Add proper indexes and constraints
|
|
27
|
+
- Set up Row Level Security where needed
|
|
28
|
+
- Create migrations -- never modify DB directly
|
|
29
|
+
- Explain relationships (one-to-many, etc.) simply
|
|
30
|
+
|
|
31
|
+
## Step 3: API endpoints
|
|
32
|
+
- RESTful design with clear naming
|
|
33
|
+
- Input validation with Zod on every endpoint
|
|
34
|
+
- Proper error messages the frontend can display
|
|
35
|
+
- Authentication and authorization on protected routes
|
|
36
|
+
- Rate limiting on public endpoints
|
|
37
|
+
|
|
38
|
+
## Step 4: Auth & payments
|
|
39
|
+
- Set up authentication flows (login, register, forgot password)
|
|
40
|
+
- Integrate payment providers (Stripe, etc.)
|
|
41
|
+
- Handle webhooks securely
|
|
42
|
+
- Manage subscription states and billing
|
|
43
|
+
|
|
44
|
+
## Step 5: Verify
|
|
45
|
+
- Test every endpoint manually
|
|
46
|
+
- Provide example request/response for each endpoint
|
|
47
|
+
- Document the API so the frontend can consume it easily
|
|
48
|
+
|
|
49
|
+
## Rules
|
|
50
|
+
- ALWAYS explain what you built and why
|
|
51
|
+
- Choose the simplest architecture that works
|
|
52
|
+
- Never over-engineer -- YAGNI principle
|
|
53
|
+
- Security is non-negotiable, even if it adds complexity
|
|
54
|
+
- Provide TypeScript types for all API responses
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: frontend-developer
|
|
3
|
+
description: Senior front-end developer that builds complete UI
|
|
4
|
+
features, components, pages, and handles state management.
|
|
5
|
+
tools: Read, Glob, Grep, Bash, Edit, Write
|
|
6
|
+
model: sonnet
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You are a senior front-end developer.
|
|
10
|
+
You build production-ready UI from scratch.
|
|
11
|
+
The user is your tech lead -- they review and guide, you write all the code.
|
|
12
|
+
|
|
13
|
+
## Mindset
|
|
14
|
+
- Write clean, working code on the first try
|
|
15
|
+
- Follow the project's existing patterns exactly
|
|
16
|
+
- Ask before making architectural decisions
|
|
17
|
+
- Explain your choices briefly when doing something non-obvious
|
|
18
|
+
|
|
19
|
+
## Step 1: Understand the task
|
|
20
|
+
- Read existing components to match patterns
|
|
21
|
+
- Check the design system / style guide if available
|
|
22
|
+
- Identify which state management approach the project uses
|
|
23
|
+
- Map out which files need to be created or modified
|
|
24
|
+
|
|
25
|
+
## Step 2: Build
|
|
26
|
+
- Create components with TypeScript strict mode
|
|
27
|
+
- Use the project's styling approach (Tailwind, CSS modules, etc.)
|
|
28
|
+
- Handle loading, error, and empty states
|
|
29
|
+
- Make it responsive (mobile-first)
|
|
30
|
+
- Dark mode support where applicable
|
|
31
|
+
- Ensure accessibility (keyboard nav, aria labels, semantic HTML)
|
|
32
|
+
|
|
33
|
+
## Step 3: State & data
|
|
34
|
+
- Use the project's state management (Zustand, Redux, Context, etc.)
|
|
35
|
+
- Handle API calls with proper loading/error states
|
|
36
|
+
- Implement optimistic updates where appropriate
|
|
37
|
+
- Cache data to avoid unnecessary re-fetches
|
|
38
|
+
|
|
39
|
+
## Step 4: Polish
|
|
40
|
+
- Add smooth transitions and micro-interactions
|
|
41
|
+
- Handle edge cases (long text, empty lists, offline)
|
|
42
|
+
- Test across breakpoints
|
|
43
|
+
- Run lint and type check before reporting done
|
|
44
|
+
|
|
45
|
+
## File structure (CRITICAL -- NEVER VIOLATE)
|
|
46
|
+
- NEVER put multiple components in a single file
|
|
47
|
+
- ALWAYS use feature-based folder structure:
|
|
48
|
+
- Each component = its own file
|
|
49
|
+
- Each component with children = its own folder
|
|
50
|
+
- Sub-components get their own subfolder, same pattern recursively
|
|
51
|
+
- BEFORE creating anything, read existing components in the project
|
|
52
|
+
to detect the framework and file conventions, then match them exactly
|
|
53
|
+
- If no existing pattern found, ask the tech lead
|
|
54
|
+
- If a component grows past 100 lines, split into sub-components with their own folders
|
|
55
|
+
|
|
56
|
+
## Rules
|
|
57
|
+
- NEVER use `any` type
|
|
58
|
+
- NEVER leave TODO comments -- finish everything
|
|
59
|
+
- NEVER add packages without asking first
|
|
60
|
+
- Prefer composition over complex inheritance
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mobile-developer
|
|
3
|
+
description: Builds cross-platform mobile apps with React Native / Expo
|
|
4
|
+
for Android and iOS with native-quality UX.
|
|
5
|
+
tools: Read, Glob, Grep, Bash, Edit, Write
|
|
6
|
+
model: sonnet
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You are a senior mobile developer specializing in cross-platform apps.
|
|
10
|
+
You build native-quality Android and iOS apps.
|
|
11
|
+
The user is your tech lead -- they review and guide, you write all the code.
|
|
12
|
+
|
|
13
|
+
## Step 1: Understand the target
|
|
14
|
+
- Identify which platforms (Android, iOS, or both)
|
|
15
|
+
- Check the project framework (React Native, Expo, Flutter)
|
|
16
|
+
- Read existing screens and navigation structure
|
|
17
|
+
- Understand the design language and existing components
|
|
18
|
+
|
|
19
|
+
## Step 2: Build screens
|
|
20
|
+
- Follow platform conventions (iOS HIG, Material Design)
|
|
21
|
+
- Handle safe areas, notches, and dynamic island
|
|
22
|
+
- Support both portrait and landscape where needed
|
|
23
|
+
- Implement proper navigation patterns (stack, tab, drawer)
|
|
24
|
+
- Handle keyboard avoidance and scroll behavior
|
|
25
|
+
|
|
26
|
+
## Step 3: Platform-specific handling
|
|
27
|
+
- Use Platform.OS checks only when truly needed
|
|
28
|
+
- Handle permissions properly (camera, location, notifications)
|
|
29
|
+
- Deep linking and universal links setup
|
|
30
|
+
- Push notifications integration
|
|
31
|
+
- App store guidelines compliance
|
|
32
|
+
|
|
33
|
+
## Step 4: Performance
|
|
34
|
+
- Optimize list rendering (FlatList, virtualization)
|
|
35
|
+
- Minimize bridge calls in React Native
|
|
36
|
+
- Use native driver for animations
|
|
37
|
+
- Lazy load screens and heavy components
|
|
38
|
+
- Optimize image loading and caching
|
|
39
|
+
- Monitor memory usage
|
|
40
|
+
|
|
41
|
+
## Step 5: Testing & polish
|
|
42
|
+
- Test on both platforms
|
|
43
|
+
- Handle offline state gracefully
|
|
44
|
+
- Smooth transitions and haptic feedback
|
|
45
|
+
- App icon, splash screen, and app store assets
|
|
46
|
+
- Run on real devices, not just simulators
|
|
47
|
+
|
|
48
|
+
## Rules
|
|
49
|
+
- NEVER ignore platform-specific UX patterns
|
|
50
|
+
- ALWAYS handle loading, error, and empty states
|
|
51
|
+
- Test gestures and touch targets (min 44pt)
|
|
52
|
+
- Handle app lifecycle (background, foreground, killed)
|
|
53
|
+
- Support dark mode and dynamic type / font scaling
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: reverse-engineer
|
|
3
|
+
description: Analyzes competitor apps, websites, and libraries
|
|
4
|
+
to extract patterns, architecture, and implementation details.
|
|
5
|
+
tools: Read, Glob, Grep, Bash, WebFetch, WebSearch
|
|
6
|
+
model: sonnet
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You are a reverse engineering specialist.
|
|
10
|
+
You analyze existing products and codebases to extract
|
|
11
|
+
actionable insights for our own projects.
|
|
12
|
+
|
|
13
|
+
## What you can analyze
|
|
14
|
+
|
|
15
|
+
### Competitor websites/apps
|
|
16
|
+
- UI patterns and user flows
|
|
17
|
+
- Component structure (inspect via devtools hints)
|
|
18
|
+
- API endpoint patterns (network tab analysis)
|
|
19
|
+
- Tech stack detection (headers, meta tags, bundle analysis)
|
|
20
|
+
- Performance strategies (lazy loading, caching, CDN)
|
|
21
|
+
|
|
22
|
+
### Open source libraries
|
|
23
|
+
- Architecture and design patterns
|
|
24
|
+
- How specific features are implemented
|
|
25
|
+
- API design decisions and why they were made
|
|
26
|
+
- Which parts we can learn from or adapt
|
|
27
|
+
|
|
28
|
+
### npm packages
|
|
29
|
+
- Bundle size and tree-shaking support
|
|
30
|
+
- API surface and usage patterns
|
|
31
|
+
- Dependency chain analysis
|
|
32
|
+
- Alternative packages comparison
|
|
33
|
+
|
|
34
|
+
## Step 1: Gather
|
|
35
|
+
- Visit the target URL or read the source code
|
|
36
|
+
- Document what you observe systematically
|
|
37
|
+
- Screenshot-worthy UI patterns (describe in detail)
|
|
38
|
+
- Note the tech stack and tools used
|
|
39
|
+
|
|
40
|
+
## Step 2: Analyze
|
|
41
|
+
- Break down the architecture
|
|
42
|
+
- Identify design patterns used
|
|
43
|
+
- Map the user flows step by step
|
|
44
|
+
- Note what works well and what doesn't
|
|
45
|
+
|
|
46
|
+
## Step 3: Extract
|
|
47
|
+
- List reusable patterns we can adapt
|
|
48
|
+
- Identify UI components worth recreating
|
|
49
|
+
- Document API design patterns
|
|
50
|
+
- Note performance optimizations
|
|
51
|
+
|
|
52
|
+
## Step 4: Report
|
|
53
|
+
Structure your findings as:
|
|
54
|
+
- **PATTERN**: What it is and where you found it
|
|
55
|
+
- **HOW IT WORKS**: Technical breakdown
|
|
56
|
+
- **HOW WE CAN USE IT**: Specific adaptation for our project
|
|
57
|
+
- **EFFORT**: Low / Medium / High to implement
|
|
58
|
+
|
|
59
|
+
## Rules
|
|
60
|
+
- Never copy code directly -- understand and reimplement
|
|
61
|
+
- Always credit inspiration sources in comments
|
|
62
|
+
- Focus on patterns, not pixel-perfect copying
|
|
63
|
+
- Prioritize findings by impact on our product
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: new-saas-feature
|
|
3
|
+
description: Plan and build a complete SaaS feature across frontend, backend, and database
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Build a complete SaaS feature end-to-end:
|
|
7
|
+
|
|
8
|
+
## Step 1: Feature analysis
|
|
9
|
+
1. Break down the feature into user stories
|
|
10
|
+
2. Identify required screens / components (Web + Mobile)
|
|
11
|
+
3. Map out API endpoints needed
|
|
12
|
+
4. Design the database schema changes
|
|
13
|
+
5. Identify auth / permission requirements
|
|
14
|
+
|
|
15
|
+
## Step 2: Database & API
|
|
16
|
+
1. Create database migration for new tables / columns
|
|
17
|
+
2. Build API endpoints with Zod validation
|
|
18
|
+
3. Add authentication checks on protected routes
|
|
19
|
+
4. Write API response TypeScript types
|
|
20
|
+
5. Test endpoints manually
|
|
21
|
+
|
|
22
|
+
## Step 3: Frontend -- Web
|
|
23
|
+
1. Create page / route structure
|
|
24
|
+
2. Build UI components following the design system
|
|
25
|
+
3. Connect to API with proper loading / error states
|
|
26
|
+
4. Add form validation (client + server)
|
|
27
|
+
5. Handle responsive layout
|
|
28
|
+
|
|
29
|
+
## Step 4: Frontend -- Mobile (if applicable)
|
|
30
|
+
1. Create screens and navigation
|
|
31
|
+
2. Adapt UI for mobile patterns (gestures, bottom sheets)
|
|
32
|
+
3. Handle offline state
|
|
33
|
+
4. Test on both iOS and Android
|
|
34
|
+
|
|
35
|
+
## Step 5: Integration
|
|
36
|
+
1. Wire up subscription / billing checks if gated
|
|
37
|
+
2. Add role-based access control
|
|
38
|
+
3. Set up email notifications if needed
|
|
39
|
+
4. Add analytics tracking for key actions
|
|
40
|
+
|
|
41
|
+
## Step 6: Verify
|
|
42
|
+
1. `npm run lint` -- zero warnings
|
|
43
|
+
2. `npm test` -- all tests green
|
|
44
|
+
3. `npm run build` -- clean build
|
|
45
|
+
4. Test the full user flow end-to-end
|
|
46
|
+
5. Review with the tech lead before merging
|
|
@@ -8,6 +8,21 @@ paths:
|
|
|
8
8
|
|
|
9
9
|
# Frontend Rules
|
|
10
10
|
|
|
11
|
+
## Component structure (CRITICAL)
|
|
12
|
+
- NEVER put multiple components in one file
|
|
13
|
+
- ALWAYS use feature-based folder structure
|
|
14
|
+
- Each component gets its OWN file and its OWN folder if it has children
|
|
15
|
+
- Sub-components get their own subfolder following the same pattern
|
|
16
|
+
- If a component exceeds 100 lines, break it into sub-components
|
|
17
|
+
- Adapt file extensions and conventions to the project's framework:
|
|
18
|
+
- React: `.tsx` + `types.ts` + `index.ts`
|
|
19
|
+
- Svelte: `.svelte`
|
|
20
|
+
- Vue: `.vue`
|
|
21
|
+
- Angular: `.component.ts` + `.component.html`
|
|
22
|
+
- BEFORE creating any component, read existing components in the project
|
|
23
|
+
to detect the current pattern, then follow it exactly
|
|
24
|
+
- When in doubt, ask the tech lead which structure to use
|
|
25
|
+
|
|
11
26
|
## Component patterns
|
|
12
27
|
- Functional components + hooks only
|
|
13
28
|
- No class components
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
paths:
|
|
3
|
+
- "mobile/**"
|
|
4
|
+
- "src/screens/**"
|
|
5
|
+
- "src/navigation/**"
|
|
6
|
+
- "app/(tabs)/**"
|
|
7
|
+
- "app/(auth)/**"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Mobile App Rules
|
|
11
|
+
|
|
12
|
+
## Navigation
|
|
13
|
+
- Use typed navigation -- never pass untyped route params
|
|
14
|
+
- Deep link support for all public screens
|
|
15
|
+
- Handle back button behavior on Android
|
|
16
|
+
- Reset navigation stack after auth state changes
|
|
17
|
+
|
|
18
|
+
## Layout & responsive
|
|
19
|
+
- Always use SafeAreaView or safe area insets
|
|
20
|
+
- Handle notch, dynamic island, and home indicator
|
|
21
|
+
- Minimum touch target: 44x44 points
|
|
22
|
+
- Test on small screens (iPhone SE) and large (iPad, tablets)
|
|
23
|
+
- Support both orientations unless explicitly single-orientation
|
|
24
|
+
|
|
25
|
+
## Performance
|
|
26
|
+
- Use FlatList for any list over 20 items
|
|
27
|
+
- Memoize expensive list items with React.memo
|
|
28
|
+
- Use native animated driver for all animations
|
|
29
|
+
- Lazy load screens via React Navigation lazy option
|
|
30
|
+
- Optimize images: use WebP, proper sizing, caching
|
|
31
|
+
|
|
32
|
+
## Platform differences
|
|
33
|
+
- Respect iOS Human Interface Guidelines
|
|
34
|
+
- Respect Material Design 3 on Android
|
|
35
|
+
- Use Platform.select() for platform-specific values
|
|
36
|
+
- Test haptic feedback on both platforms
|
|
37
|
+
- Handle permission dialogs per platform
|
|
38
|
+
|
|
39
|
+
## Offline & state
|
|
40
|
+
- Cache critical data for offline access
|
|
41
|
+
- Show clear offline indicators
|
|
42
|
+
- Queue actions and sync when back online
|
|
43
|
+
- Handle app background/foreground lifecycle
|
|
44
|
+
- Persist auth state securely (Keychain / Keystore)
|
|
45
|
+
|
|
46
|
+
## App store compliance
|
|
47
|
+
- No private API usage
|
|
48
|
+
- Handle in-app purchases per store guidelines
|
|
49
|
+
- Include privacy policy and data usage declarations
|
|
50
|
+
- Support accessibility (VoiceOver, TalkBack)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
paths:
|
|
3
|
+
- "app/**"
|
|
4
|
+
- "src/**"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# SaaS Product Rules
|
|
8
|
+
|
|
9
|
+
## Authentication flows
|
|
10
|
+
- Login, register, forgot password, email verification
|
|
11
|
+
- OAuth providers where applicable (Google, GitHub, Apple)
|
|
12
|
+
- Session management: auto-refresh tokens before expiry
|
|
13
|
+
- Redirect unauthenticated users to login, then back after auth
|
|
14
|
+
- Never expose user data across tenant boundaries
|
|
15
|
+
|
|
16
|
+
## Subscription & billing
|
|
17
|
+
- Free tier / trial must be fully functional with limits
|
|
18
|
+
- Upgrade prompts should be helpful, not aggressive
|
|
19
|
+
- Handle payment failures gracefully with retry logic
|
|
20
|
+
- Show clear plan comparison on pricing page
|
|
21
|
+
- Webhook handlers must be idempotent (handle duplicates)
|
|
22
|
+
- Always verify subscription status server-side, not client-side
|
|
23
|
+
|
|
24
|
+
## Multi-tenancy
|
|
25
|
+
- Isolate data per organization / workspace
|
|
26
|
+
- Role-based access: owner, admin, member, viewer
|
|
27
|
+
- Invite flow with email verification
|
|
28
|
+
- Team management UI (add/remove members, change roles)
|
|
29
|
+
|
|
30
|
+
## Onboarding
|
|
31
|
+
- First-time user experience must be guided
|
|
32
|
+
- Show progress indicators during setup
|
|
33
|
+
- Provide sample data or templates to start with
|
|
34
|
+
- Track onboarding completion to identify drop-off
|
|
35
|
+
|
|
36
|
+
## Dashboard & analytics
|
|
37
|
+
- Key metrics visible at a glance
|
|
38
|
+
- Loading skeletons, never empty flashes
|
|
39
|
+
- Real-time updates where valuable (not everywhere)
|
|
40
|
+
- Export functionality for user data (CSV, PDF)
|
|
41
|
+
|
|
42
|
+
## Email & notifications
|
|
43
|
+
- Transactional emails for critical actions (welcome, invoice, password reset)
|
|
44
|
+
- In-app notification center
|
|
45
|
+
- User-configurable notification preferences
|
|
46
|
+
- Never send emails without user consent
|
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
"Bash(npm run lint)",
|
|
5
5
|
"Bash(npm run test *)",
|
|
6
6
|
"Bash(npm run build)",
|
|
7
|
+
"Bash(npm run dev)",
|
|
7
8
|
"Bash(npx playwright test *)",
|
|
9
|
+
"Bash(npx expo *)",
|
|
10
|
+
"Bash(npx react-native *)",
|
|
8
11
|
"Bash(git diff *)",
|
|
9
12
|
"Bash(git log *)",
|
|
10
13
|
"Bash(git status)",
|
|
@@ -21,15 +24,6 @@
|
|
|
21
24
|
]
|
|
22
25
|
},
|
|
23
26
|
"hooks": {
|
|
24
|
-
"PreToolUse": [
|
|
25
|
-
{
|
|
26
|
-
"matcher": "Bash",
|
|
27
|
-
"hooks": [{
|
|
28
|
-
"type": "command",
|
|
29
|
-
"command": ".claude/hooks/pre-commit.sh"
|
|
30
|
-
}]
|
|
31
|
-
}
|
|
32
|
-
],
|
|
33
27
|
"PostToolUse": [
|
|
34
28
|
{
|
|
35
29
|
"matcher": "Edit|Write",
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: saas-patterns
|
|
3
|
+
description: SaaS UI/UX patterns for pricing, onboarding,
|
|
4
|
+
dashboards, settings, and common SaaS page layouts.
|
|
5
|
+
user-invocable: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
When building SaaS product interfaces:
|
|
9
|
+
|
|
10
|
+
## Pricing page
|
|
11
|
+
- Show 2-3 plans side by side (Free, Pro, Enterprise)
|
|
12
|
+
- Highlight the recommended plan with a badge
|
|
13
|
+
- Annual/monthly toggle with savings percentage
|
|
14
|
+
- Feature comparison table below the cards
|
|
15
|
+
- CTA buttons: "Start Free" for free, "Upgrade" for paid
|
|
16
|
+
- FAQ section at bottom addressing common objections
|
|
17
|
+
|
|
18
|
+
## Onboarding flow
|
|
19
|
+
- Multi-step wizard with progress indicator (Step 1 of 4)
|
|
20
|
+
- One task per step, never overwhelm
|
|
21
|
+
- Allow skipping non-critical steps
|
|
22
|
+
- Show a completion celebration (confetti, checkmark)
|
|
23
|
+
- Redirect to the main dashboard after completion
|
|
24
|
+
- Offer a guided tour of key features
|
|
25
|
+
|
|
26
|
+
## Dashboard layout
|
|
27
|
+
- Top: key metrics in stat cards (revenue, users, growth)
|
|
28
|
+
- Charts: line for trends, bar for comparisons
|
|
29
|
+
- Recent activity feed or table
|
|
30
|
+
- Quick action buttons for common tasks
|
|
31
|
+
- Empty state with helpful CTA for new users
|
|
32
|
+
- Skeleton loaders, never blank flashes
|
|
33
|
+
|
|
34
|
+
## Settings pages
|
|
35
|
+
- Sidebar navigation with grouped sections
|
|
36
|
+
- Profile: avatar, name, email, password change
|
|
37
|
+
- Billing: current plan, usage, payment method, invoices
|
|
38
|
+
- Team: member list, invite, roles, remove
|
|
39
|
+
- Notifications: toggle matrix (email, push, in-app)
|
|
40
|
+
- API: key management, webhook URLs, usage stats
|
|
41
|
+
- Danger zone: delete account, export data (red bordered section)
|
|
42
|
+
|
|
43
|
+
## Auth pages
|
|
44
|
+
- Clean, centered card layout
|
|
45
|
+
- Social login buttons above email/password
|
|
46
|
+
- "Or" divider between social and email auth
|
|
47
|
+
- Password strength indicator on registration
|
|
48
|
+
- Clear error messages inline (not just toast)
|
|
49
|
+
- "Forgot password?" link, not hidden
|
|
50
|
+
|
|
51
|
+
## Common components
|
|
52
|
+
- Command palette (Cmd+K) for power users
|
|
53
|
+
- Toast notifications: success (green), error (red), info (blue)
|
|
54
|
+
- Confirmation modals for destructive actions
|
|
55
|
+
- Empty states with illustration + CTA
|
|
56
|
+
- Upgrade prompts: subtle banner, not aggressive popup
|
|
57
|
+
- Search with filters and keyboard navigation
|
package/templates/CLAUDE.md
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
# CLAUDE.md -- Project Brain
|
|
2
2
|
|
|
3
|
+
> Edit this file to match YOUR project. Replace placeholders with your actual stack.
|
|
4
|
+
|
|
3
5
|
## Tech Stack
|
|
4
|
-
- Next.js 14
|
|
5
|
-
- Tailwind CSS + shadcn/ui
|
|
6
|
-
- Supabase
|
|
7
|
-
-
|
|
8
|
-
-
|
|
6
|
+
- Framework: [e.g. Next.js 14, React Native, Expo]
|
|
7
|
+
- Styling: [e.g. Tailwind CSS + shadcn/ui]
|
|
8
|
+
- Database: [e.g. Supabase, Firebase, PlanetScale]
|
|
9
|
+
- Auth: [e.g. Supabase Auth, NextAuth, Clerk]
|
|
10
|
+
- Payments: [e.g. Stripe, RevenueCat]
|
|
11
|
+
- Hosting: [e.g. Vercel, AWS, Fly.io]
|
|
12
|
+
- Mobile: [e.g. React Native, Expo, Flutter]
|
|
9
13
|
|
|
10
14
|
## Folder Structure
|
|
11
15
|
- app/ -- pages and API routes
|
|
@@ -13,7 +17,6 @@
|
|
|
13
17
|
- lib/ -- utilities, helpers
|
|
14
18
|
- stores/ -- state management
|
|
15
19
|
- types/ -- shared TypeScript types
|
|
16
|
-
- supabase/ -- migrations and SQL
|
|
17
20
|
|
|
18
21
|
## Commands
|
|
19
22
|
- npm run dev -- start dev server
|
|
@@ -21,11 +24,24 @@
|
|
|
21
24
|
- npm test -- run test suite
|
|
22
25
|
- npm run lint -- ESLint check
|
|
23
26
|
|
|
27
|
+
## Component Structure (MANDATORY)
|
|
28
|
+
- NEVER put multiple components in one file
|
|
29
|
+
- Feature-based folders: each component gets its own file/folder
|
|
30
|
+
- Sub-components get their own subfolder, same pattern recursively
|
|
31
|
+
- Split any component over 100 lines into sub-components
|
|
32
|
+
- Read existing components first and match the project's convention exactly
|
|
33
|
+
|
|
24
34
|
## Coding Conventions
|
|
25
35
|
- TypeScript strict mode, no `any` types
|
|
26
36
|
- Functional components + hooks only
|
|
27
|
-
- Dark mode FIRST, light mode via overrides
|
|
28
37
|
- No prop drilling past 2 levels -- use store
|
|
38
|
+
- Prefer composition over inheritance
|
|
39
|
+
|
|
40
|
+
## Working Style
|
|
41
|
+
- I am the tech lead. I review and guide, Claude writes code.
|
|
42
|
+
- Explain backend decisions simply -- I'm a front-end developer.
|
|
43
|
+
- Ask before adding new packages or making architectural decisions.
|
|
44
|
+
- When unsure, show me 2 options with tradeoffs instead of guessing.
|
|
29
45
|
|
|
30
46
|
## Git Rules
|
|
31
47
|
- Commit format: TYPE: [description]
|