@olegkoval/agent-skills 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +58 -0
- package/.cursor-plugin/index.json +55 -0
- package/LICENSE +21 -0
- package/README.md +181 -0
- package/catalog/skills.json +202 -0
- package/collections/creative-tools.json +5 -0
- package/collections/docs-tools.json +5 -0
- package/collections/git-tools.json +5 -0
- package/collections/marketing.json +5 -0
- package/collections/music.json +5 -0
- package/collections/photography.json +5 -0
- package/collections/product-tools.json +5 -0
- package/collections/prompt-tools.json +5 -0
- package/collections/release-tools.json +5 -0
- package/collections/software-development.json +13 -0
- package/package.json +47 -0
- package/packages/marketing/viral-launch/SKILL.md +101 -0
- package/packages/marketing/viral-launch/adapters/claude/plugin.json +10 -0
- package/packages/marketing/viral-launch/adapters/codex/README.md +3 -0
- package/packages/marketing/viral-launch/adapters/cursor/plugin.json +6 -0
- package/packages/marketing/viral-launch/adapters/cursor/skills/viral-launch/SKILL.md +103 -0
- package/packages/marketing/viral-launch/references/external-skills.md +12 -0
- package/packages/marketing/viral-launch/references/launch-checklist.md +42 -0
- package/packages/music/fill-music-player/LICENSE +21 -0
- package/packages/music/fill-music-player/SKILL.md +108 -0
- package/packages/music/fill-music-player/adapters/claude/plugin.json +10 -0
- package/packages/music/fill-music-player/adapters/codex/README.md +3 -0
- package/packages/music/fill-music-player/adapters/cursor/plugin.json +6 -0
- package/packages/music/fill-music-player/adapters/cursor/skills/fill-music-player/SKILL.md +110 -0
- package/packages/photography/gallery/.skillfish.json +10 -0
- package/packages/photography/gallery/SKILL.md +233 -0
- package/packages/photography/gallery/adapters/claude/plugin.json +10 -0
- package/packages/photography/gallery/adapters/codex/README.md +3 -0
- package/packages/photography/gallery/adapters/cursor/plugin.json +6 -0
- package/packages/photography/gallery/adapters/cursor/skills/gallery/SKILL.md +235 -0
- package/packages/software-development/changelog-generator/SKILL.md +111 -0
- package/packages/software-development/changelog-generator/adapters/claude/plugin.json +10 -0
- package/packages/software-development/changelog-generator/adapters/codex/README.md +3 -0
- package/packages/software-development/changelog-generator/adapters/cursor/plugin.json +6 -0
- package/packages/software-development/changelog-generator/adapters/cursor/skills/changelog-generator/SKILL.md +113 -0
- package/packages/software-development/docs-index-keeper/SKILL.md +62 -0
- package/packages/software-development/docs-index-keeper/adapters/claude/plugin.json +10 -0
- package/packages/software-development/docs-index-keeper/adapters/codex/README.md +5 -0
- package/packages/software-development/docs-index-keeper/adapters/cursor/plugin.json +6 -0
- package/packages/software-development/docs-index-keeper/adapters/cursor/skills/docs-index-keeper/SKILL.md +64 -0
- package/packages/software-development/gh-cli/SKILL.md +2196 -0
- package/packages/software-development/gh-cli/adapters/claude/plugin.json +10 -0
- package/packages/software-development/gh-cli/adapters/codex/README.md +3 -0
- package/packages/software-development/gh-cli/adapters/cursor/plugin.json +6 -0
- package/packages/software-development/gh-cli/adapters/cursor/skills/gh-cli/SKILL.md +2198 -0
- package/packages/software-development/git-commit/SKILL.md +131 -0
- package/packages/software-development/git-commit/adapters/claude/plugin.json +10 -0
- package/packages/software-development/git-commit/adapters/codex/README.md +3 -0
- package/packages/software-development/git-commit/adapters/cursor/plugin.json +6 -0
- package/packages/software-development/git-commit/adapters/cursor/skills/git-commit/SKILL.md +133 -0
- package/packages/software-development/product-builder/LICENSE +21 -0
- package/packages/software-development/product-builder/SKILL.md +221 -0
- package/packages/software-development/product-builder/adapters/claude/plugin.json +10 -0
- package/packages/software-development/product-builder/adapters/codex/README.md +3 -0
- package/packages/software-development/product-builder/adapters/cursor/plugin.json +6 -0
- package/packages/software-development/product-builder/adapters/cursor/skills/product-builder/SKILL.md +223 -0
- package/packages/software-development/promptctl/SKILL.md +86 -0
- package/packages/software-development/promptctl/adapters/claude/plugin.json +10 -0
- package/packages/software-development/promptctl/adapters/codex/README.md +3 -0
- package/packages/software-development/promptctl/adapters/cursor/plugin.json +6 -0
- package/packages/software-development/promptctl/adapters/cursor/skills/promptctl/SKILL.md +88 -0
- package/packages/software-development/semantic-release-beta/SKILL.md +55 -0
- package/packages/software-development/semantic-release-beta/adapters/claude/plugin.json +10 -0
- package/packages/software-development/semantic-release-beta/adapters/codex/README.md +3 -0
- package/packages/software-development/semantic-release-beta/adapters/cursor/plugin.json +6 -0
- package/packages/software-development/semantic-release-beta/adapters/cursor/skills/semantic-release-beta/SKILL.md +57 -0
- package/packages/software-development/semantic-release-beta/references/github-actions.md +16 -0
- package/packages/software-development/semantic-release-beta/references/node-semantic-release.md +13 -0
- package/packages/software-development/semantic-release-beta/references/preset.md +47 -0
- package/packages/software-development/semantic-release-beta/references/validation.md +17 -0
- package/scripts/build-adapters.sh +115 -0
- package/scripts/install-codex-symlinks.sh +37 -0
- package/scripts/sync-from-sources.sh +44 -0
- package/scripts/validate-catalog.sh +90 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-commit
|
|
3
|
+
description: 'Execute git commit with conventional commit message analysis, intelligent staging, and message generation. Use when user asks to commit changes, create a git commit, or mentions "/commit". Supports: (1) Auto-detecting type and scope from changes, (2) Generating conventional commit messages from diff, (3) Interactive commit with optional type/scope/description overrides, (4) Intelligent file staging for logical grouping'
|
|
4
|
+
license: MIT
|
|
5
|
+
allowed-tools: Bash
|
|
6
|
+
compatibility: Codex, Claude Code, Cursor, and other Agent Skills compatible tools. Requires git and a writable repository.
|
|
7
|
+
metadata:
|
|
8
|
+
author: Oleg Koval
|
|
9
|
+
tags:
|
|
10
|
+
- git
|
|
11
|
+
- commit
|
|
12
|
+
- conventional-commits
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Git Commit with Conventional Commits
|
|
16
|
+
|
|
17
|
+
## Overview
|
|
18
|
+
|
|
19
|
+
Create standardized, semantic git commits using the Conventional Commits specification. Analyze the actual diff to determine appropriate type, scope, and message.
|
|
20
|
+
|
|
21
|
+
## Conventional Commit Format
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
<type>[optional scope]: <description>
|
|
25
|
+
|
|
26
|
+
[optional body]
|
|
27
|
+
|
|
28
|
+
[optional footer(s)]
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Commit Types
|
|
32
|
+
|
|
33
|
+
| Type | Purpose |
|
|
34
|
+
| ---------- | ------------------------------ |
|
|
35
|
+
| `feat` | New feature |
|
|
36
|
+
| `fix` | Bug fix |
|
|
37
|
+
| `docs` | Documentation only |
|
|
38
|
+
| `style` | Formatting/style (no logic) |
|
|
39
|
+
| `refactor` | Code refactor (no feature/fix) |
|
|
40
|
+
| `perf` | Performance improvement |
|
|
41
|
+
| `test` | Add/update tests |
|
|
42
|
+
| `build` | Build system/dependencies |
|
|
43
|
+
| `ci` | CI/config changes |
|
|
44
|
+
| `chore` | Maintenance/misc |
|
|
45
|
+
| `revert` | Revert commit |
|
|
46
|
+
|
|
47
|
+
## Breaking Changes
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
# Exclamation mark after type/scope
|
|
51
|
+
feat!: remove deprecated endpoint
|
|
52
|
+
|
|
53
|
+
# BREAKING CHANGE footer
|
|
54
|
+
feat: allow config to extend other configs
|
|
55
|
+
|
|
56
|
+
BREAKING CHANGE: `extends` key behavior changed
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Workflow
|
|
60
|
+
|
|
61
|
+
### 1. Analyze Diff
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# If files are staged, use staged diff
|
|
65
|
+
git diff --staged
|
|
66
|
+
|
|
67
|
+
# If nothing staged, use working tree diff
|
|
68
|
+
git diff
|
|
69
|
+
|
|
70
|
+
# Also check status
|
|
71
|
+
git status --porcelain
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### 2. Stage Files (if needed)
|
|
75
|
+
|
|
76
|
+
If nothing is staged or you want to group changes differently:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# Stage specific files
|
|
80
|
+
git add path/to/file1 path/to/file2
|
|
81
|
+
|
|
82
|
+
# Stage by pattern
|
|
83
|
+
git add *.test.*
|
|
84
|
+
git add src/components/*
|
|
85
|
+
|
|
86
|
+
# Interactive staging
|
|
87
|
+
git add -p
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Never commit secrets** (.env, credentials.json, private keys).
|
|
91
|
+
|
|
92
|
+
### 3. Generate Commit Message
|
|
93
|
+
|
|
94
|
+
Analyze the diff to determine:
|
|
95
|
+
|
|
96
|
+
- **Type**: What kind of change is this?
|
|
97
|
+
- **Scope**: What area/module is affected?
|
|
98
|
+
- **Description**: One-line summary of what changed (present tense, imperative mood, <72 chars)
|
|
99
|
+
|
|
100
|
+
### 4. Execute Commit
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# Single line
|
|
104
|
+
git commit -m "<type>[scope]: <description>"
|
|
105
|
+
|
|
106
|
+
# Multi-line with body/footer
|
|
107
|
+
git commit -m "$(cat <<'EOF'
|
|
108
|
+
<type>[scope]: <description>
|
|
109
|
+
|
|
110
|
+
<optional body>
|
|
111
|
+
|
|
112
|
+
<optional footer>
|
|
113
|
+
EOF
|
|
114
|
+
)"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Best Practices
|
|
118
|
+
|
|
119
|
+
- One logical change per commit
|
|
120
|
+
- Present tense: "add" not "added"
|
|
121
|
+
- Imperative mood: "fix bug" not "fixes bug"
|
|
122
|
+
- Reference issues: `Closes #123`, `Refs #456`
|
|
123
|
+
- Keep description under 72 characters
|
|
124
|
+
|
|
125
|
+
## Git Safety Protocol
|
|
126
|
+
|
|
127
|
+
- NEVER update git config
|
|
128
|
+
- NEVER run destructive commands (--force, hard reset) without explicit request
|
|
129
|
+
- NEVER skip hooks (--no-verify) unless user asks
|
|
130
|
+
- NEVER force push to main/master
|
|
131
|
+
- If commit fails due to hooks, fix and create NEW commit (don't amend)
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
<!-- Generated by scripts/build-adapters.sh. Do not edit directly. -->
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
name: git-commit
|
|
5
|
+
description: 'Execute git commit with conventional commit message analysis, intelligent staging, and message generation. Use when user asks to commit changes, create a git commit, or mentions "/commit". Supports: (1) Auto-detecting type and scope from changes, (2) Generating conventional commit messages from diff, (3) Interactive commit with optional type/scope/description overrides, (4) Intelligent file staging for logical grouping'
|
|
6
|
+
license: MIT
|
|
7
|
+
allowed-tools: Bash
|
|
8
|
+
compatibility: Codex, Claude Code, Cursor, and other Agent Skills compatible tools. Requires git and a writable repository.
|
|
9
|
+
metadata:
|
|
10
|
+
author: Oleg Koval
|
|
11
|
+
tags:
|
|
12
|
+
- git
|
|
13
|
+
- commit
|
|
14
|
+
- conventional-commits
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Git Commit with Conventional Commits
|
|
18
|
+
|
|
19
|
+
## Overview
|
|
20
|
+
|
|
21
|
+
Create standardized, semantic git commits using the Conventional Commits specification. Analyze the actual diff to determine appropriate type, scope, and message.
|
|
22
|
+
|
|
23
|
+
## Conventional Commit Format
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
<type>[optional scope]: <description>
|
|
27
|
+
|
|
28
|
+
[optional body]
|
|
29
|
+
|
|
30
|
+
[optional footer(s)]
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Commit Types
|
|
34
|
+
|
|
35
|
+
| Type | Purpose |
|
|
36
|
+
| ---------- | ------------------------------ |
|
|
37
|
+
| `feat` | New feature |
|
|
38
|
+
| `fix` | Bug fix |
|
|
39
|
+
| `docs` | Documentation only |
|
|
40
|
+
| `style` | Formatting/style (no logic) |
|
|
41
|
+
| `refactor` | Code refactor (no feature/fix) |
|
|
42
|
+
| `perf` | Performance improvement |
|
|
43
|
+
| `test` | Add/update tests |
|
|
44
|
+
| `build` | Build system/dependencies |
|
|
45
|
+
| `ci` | CI/config changes |
|
|
46
|
+
| `chore` | Maintenance/misc |
|
|
47
|
+
| `revert` | Revert commit |
|
|
48
|
+
|
|
49
|
+
## Breaking Changes
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
# Exclamation mark after type/scope
|
|
53
|
+
feat!: remove deprecated endpoint
|
|
54
|
+
|
|
55
|
+
# BREAKING CHANGE footer
|
|
56
|
+
feat: allow config to extend other configs
|
|
57
|
+
|
|
58
|
+
BREAKING CHANGE: `extends` key behavior changed
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Workflow
|
|
62
|
+
|
|
63
|
+
### 1. Analyze Diff
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# If files are staged, use staged diff
|
|
67
|
+
git diff --staged
|
|
68
|
+
|
|
69
|
+
# If nothing staged, use working tree diff
|
|
70
|
+
git diff
|
|
71
|
+
|
|
72
|
+
# Also check status
|
|
73
|
+
git status --porcelain
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 2. Stage Files (if needed)
|
|
77
|
+
|
|
78
|
+
If nothing is staged or you want to group changes differently:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Stage specific files
|
|
82
|
+
git add path/to/file1 path/to/file2
|
|
83
|
+
|
|
84
|
+
# Stage by pattern
|
|
85
|
+
git add *.test.*
|
|
86
|
+
git add src/components/*
|
|
87
|
+
|
|
88
|
+
# Interactive staging
|
|
89
|
+
git add -p
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**Never commit secrets** (.env, credentials.json, private keys).
|
|
93
|
+
|
|
94
|
+
### 3. Generate Commit Message
|
|
95
|
+
|
|
96
|
+
Analyze the diff to determine:
|
|
97
|
+
|
|
98
|
+
- **Type**: What kind of change is this?
|
|
99
|
+
- **Scope**: What area/module is affected?
|
|
100
|
+
- **Description**: One-line summary of what changed (present tense, imperative mood, <72 chars)
|
|
101
|
+
|
|
102
|
+
### 4. Execute Commit
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# Single line
|
|
106
|
+
git commit -m "<type>[scope]: <description>"
|
|
107
|
+
|
|
108
|
+
# Multi-line with body/footer
|
|
109
|
+
git commit -m "$(cat <<'EOF'
|
|
110
|
+
<type>[scope]: <description>
|
|
111
|
+
|
|
112
|
+
<optional body>
|
|
113
|
+
|
|
114
|
+
<optional footer>
|
|
115
|
+
EOF
|
|
116
|
+
)"
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Best Practices
|
|
120
|
+
|
|
121
|
+
- One logical change per commit
|
|
122
|
+
- Present tense: "add" not "added"
|
|
123
|
+
- Imperative mood: "fix bug" not "fixes bug"
|
|
124
|
+
- Reference issues: `Closes #123`, `Refs #456`
|
|
125
|
+
- Keep description under 72 characters
|
|
126
|
+
|
|
127
|
+
## Git Safety Protocol
|
|
128
|
+
|
|
129
|
+
- NEVER update git config
|
|
130
|
+
- NEVER run destructive commands (--force, hard reset) without explicit request
|
|
131
|
+
- NEVER skip hooks (--no-verify) unless user asks
|
|
132
|
+
- NEVER force push to main/master
|
|
133
|
+
- If commit fails due to hooks, fix and create NEW commit (don't amend)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Oleg Koval
|
|
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.
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: product-builder
|
|
3
|
+
description: Use when a user asks to build a full-stack web application, SaaS product, dashboard, or any complete working app from a description. Generates production-ready code with auth, database, API, UI, and tests instead of asking clarifying questions. Activates on "build me X", "create an app that", or any product-building request.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Codex, Claude Code, Cursor, and other Agent Skills compatible tools. Requires a writable application repository and a stack compatible with the generated implementation.
|
|
6
|
+
metadata:
|
|
7
|
+
author: Oleg Koval
|
|
8
|
+
tags:
|
|
9
|
+
- product
|
|
10
|
+
- full-stack
|
|
11
|
+
- saas
|
|
12
|
+
- web-app
|
|
13
|
+
- builder
|
|
14
|
+
- nextjs
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Product Builder
|
|
18
|
+
|
|
19
|
+
You are a full-stack product builder. Your goal: **build real, working products — not prototypes**.
|
|
20
|
+
|
|
21
|
+
## Core Philosophy
|
|
22
|
+
|
|
23
|
+
- **Ship immediately** — No explanations, no questions about architecture. Code first.
|
|
24
|
+
- **Full-stack defaults** — Every product includes auth, database, APIs, and UI.
|
|
25
|
+
- **Real code patterns** — Use production-ready patterns, not toy examples.
|
|
26
|
+
- **Minimal diffs** — Change only what's necessary. Respect existing code.
|
|
27
|
+
|
|
28
|
+
## When a user asks to "build X"
|
|
29
|
+
|
|
30
|
+
You MUST:
|
|
31
|
+
1. Generate a working product, not a skeleton
|
|
32
|
+
2. Include authentication
|
|
33
|
+
3. Include database schema with migrations
|
|
34
|
+
4. Include API routes with input validation
|
|
35
|
+
5. Include a polished, responsive UI
|
|
36
|
+
6. Include tests
|
|
37
|
+
|
|
38
|
+
You MUST NOT:
|
|
39
|
+
- Ask "what framework do you want?"
|
|
40
|
+
- Ask "should we use a database?"
|
|
41
|
+
- Ask "how many features?"
|
|
42
|
+
- Create TODO comments for later implementation
|
|
43
|
+
|
|
44
|
+
## Default Tech Stack
|
|
45
|
+
|
|
46
|
+
| Layer | Technology |
|
|
47
|
+
|-------|-----------|
|
|
48
|
+
| **Framework** | Next.js 14 (App Router) |
|
|
49
|
+
| **Language** | TypeScript (strict) |
|
|
50
|
+
| **Styling** | Tailwind CSS + shadcn/ui |
|
|
51
|
+
| **Database** | Prisma + PostgreSQL |
|
|
52
|
+
| **Auth** | NextAuth.js |
|
|
53
|
+
| **Validation** | Zod |
|
|
54
|
+
| **State** | React Query + Zustand |
|
|
55
|
+
| **Testing** | Vitest + React Testing Library + Playwright |
|
|
56
|
+
|
|
57
|
+
The user can override any of these. If the project already uses a different stack, follow the existing stack.
|
|
58
|
+
|
|
59
|
+
## Specialist Domains
|
|
60
|
+
|
|
61
|
+
When building a product, apply expertise from these domains as needed:
|
|
62
|
+
|
|
63
|
+
### UI Design
|
|
64
|
+
- Tailwind CSS utility-first, mobile-first responsive
|
|
65
|
+
- shadcn/ui components over custom solutions
|
|
66
|
+
- Dark mode support with `class` strategy
|
|
67
|
+
- Accessibility: semantic HTML, ARIA labels, keyboard nav, WCAG AA contrast
|
|
68
|
+
- Animations with Framer Motion or CSS transitions
|
|
69
|
+
- Component pattern: `cn()` utility for conditional classes
|
|
70
|
+
|
|
71
|
+
### Database Architecture
|
|
72
|
+
- Prisma schema with proper indexes and relations
|
|
73
|
+
- Multi-tenant patterns when applicable (org-scoped data)
|
|
74
|
+
- Referential integrity and cascade rules
|
|
75
|
+
- Query optimization: use `select` and `include` deliberately
|
|
76
|
+
- Migration strategy: always generate and review migrations
|
|
77
|
+
- Audit fields: `createdAt`, `updatedAt` on every model
|
|
78
|
+
|
|
79
|
+
### API Design
|
|
80
|
+
- Consistent response format: `{ success: true, data }` / `{ success: false, error: { code, message } }`
|
|
81
|
+
- Zod validation schemas for all inputs
|
|
82
|
+
- Proper HTTP status codes (201 for creation, 400 for validation, 401/403 for auth)
|
|
83
|
+
- Pagination: `page`, `limit`, `total`, `totalPages`
|
|
84
|
+
- Rate limiting for public endpoints
|
|
85
|
+
- Server Actions for form submissions
|
|
86
|
+
|
|
87
|
+
### Testing
|
|
88
|
+
- Vitest for unit and integration tests
|
|
89
|
+
- React Testing Library for component tests
|
|
90
|
+
- Playwright for E2E tests
|
|
91
|
+
- Test critical paths: auth flows, CRUD operations, edge cases
|
|
92
|
+
- Mock external services, not internal code
|
|
93
|
+
- Factories/fixtures for test data
|
|
94
|
+
|
|
95
|
+
## Code Quality Standards
|
|
96
|
+
|
|
97
|
+
- TypeScript strict mode, no `any` types without justification
|
|
98
|
+
- Error boundaries and proper error handling at every layer
|
|
99
|
+
- Security-first: validate inputs, sanitize outputs, check permissions
|
|
100
|
+
- Performance: memoize expensive renders, optimize queries, pagination
|
|
101
|
+
- Accessibility: semantic HTML, ARIA labels, keyboard navigation
|
|
102
|
+
|
|
103
|
+
## File Organization
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
app/
|
|
107
|
+
(auth)/ # Auth routes group
|
|
108
|
+
login/page.tsx
|
|
109
|
+
register/page.tsx
|
|
110
|
+
(app)/ # Protected routes group
|
|
111
|
+
dashboard/page.tsx
|
|
112
|
+
settings/page.tsx
|
|
113
|
+
api/ # API routes
|
|
114
|
+
auth/route.ts
|
|
115
|
+
[resource]/route.ts
|
|
116
|
+
actions/ # Server actions
|
|
117
|
+
lib/
|
|
118
|
+
db.ts # Database client
|
|
119
|
+
auth.ts # Auth config
|
|
120
|
+
api-response.ts # Response helpers
|
|
121
|
+
validation.ts # Zod schemas
|
|
122
|
+
components/
|
|
123
|
+
ui/ # shadcn/ui components
|
|
124
|
+
forms/ # Form components
|
|
125
|
+
layouts/ # Layout components
|
|
126
|
+
prisma/
|
|
127
|
+
schema.prisma
|
|
128
|
+
migrations/
|
|
129
|
+
__tests__/
|
|
130
|
+
unit/
|
|
131
|
+
integration/
|
|
132
|
+
e2e/
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## API Response Pattern
|
|
136
|
+
|
|
137
|
+
```typescript
|
|
138
|
+
// lib/api-response.ts
|
|
139
|
+
export type ApiResponse<T = unknown> =
|
|
140
|
+
| { success: true; data: T }
|
|
141
|
+
| { success: false; error: { code: string; message: string; details?: Record<string, string[]> } };
|
|
142
|
+
|
|
143
|
+
export function successResponse<T>(data: T): ApiResponse<T> {
|
|
144
|
+
return { success: true, data };
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export function errorResponse(code: string, message: string, details?: Record<string, string[]>): ApiResponse<never> {
|
|
148
|
+
return { success: false, error: { code, message, details } };
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Route Handler Pattern
|
|
153
|
+
|
|
154
|
+
```typescript
|
|
155
|
+
// app/api/posts/route.ts
|
|
156
|
+
import { NextRequest, NextResponse } from 'next/server';
|
|
157
|
+
import { z } from 'zod';
|
|
158
|
+
import { prisma } from '@/lib/db';
|
|
159
|
+
import { auth } from '@/lib/auth';
|
|
160
|
+
import { successResponse, errorResponse } from '@/lib/api';
|
|
161
|
+
|
|
162
|
+
const createPostSchema = z.object({
|
|
163
|
+
title: z.string().min(1).max(200),
|
|
164
|
+
content: z.string().min(1),
|
|
165
|
+
status: z.enum(['DRAFT', 'PUBLISHED']).default('DRAFT'),
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
export async function POST(request: NextRequest) {
|
|
169
|
+
const session = await auth();
|
|
170
|
+
if (!session?.user) {
|
|
171
|
+
return NextResponse.json(errorResponse('UNAUTHORIZED', 'Authentication required'), { status: 401 });
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const body = await request.json();
|
|
175
|
+
const result = createPostSchema.safeParse(body);
|
|
176
|
+
|
|
177
|
+
if (!result.success) {
|
|
178
|
+
return NextResponse.json(
|
|
179
|
+
errorResponse('VALIDATION_ERROR', 'Invalid input', result.error.flatten().fieldErrors),
|
|
180
|
+
{ status: 400 },
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const post = await prisma.post.create({
|
|
185
|
+
data: { ...result.data, authorId: session.user.id },
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
return NextResponse.json(successResponse(post), { status: 201 });
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Component Pattern
|
|
193
|
+
|
|
194
|
+
```typescript
|
|
195
|
+
import { cn } from '@/lib/utils';
|
|
196
|
+
|
|
197
|
+
interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
198
|
+
children: React.ReactNode;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export function Card({ className, ...props }: CardProps) {
|
|
202
|
+
return (
|
|
203
|
+
<div
|
|
204
|
+
className={cn(
|
|
205
|
+
'rounded-lg border border-slate-200 bg-white p-6 shadow-sm',
|
|
206
|
+
'dark:border-slate-800 dark:bg-slate-950',
|
|
207
|
+
className,
|
|
208
|
+
)}
|
|
209
|
+
{...props}
|
|
210
|
+
/>
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## When Stuck or Uncertain
|
|
216
|
+
|
|
217
|
+
Do not ask the user. Execute using best practices from the relevant domain. Default to the simplest solution that works.
|
|
218
|
+
|
|
219
|
+
## Example Prompts
|
|
220
|
+
|
|
221
|
+
See [examples.md](examples.md) for ready-to-use prompts covering SaaS dashboards, e-commerce, project management, AI chat apps, and more.
|