@claude-code-mastery/starter-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/.claude/.starter-kit/profiles/clean.md +113 -0
- package/.claude/.starter-kit/profiles/go.md +458 -0
- package/.claude/.starter-kit/profiles/node.md +429 -0
- package/.claude/.starter-kit/profiles/python.md +475 -0
- package/.claude/.starter-kit/shared/analytics-rybbit.md +55 -0
- package/.claude/.starter-kit/shared/claude-md-base.md +93 -0
- package/.claude/.starter-kit/shared/deployment-dokploy.md +158 -0
- package/.claude/.starter-kit/shared/feature-manifest.md +43 -0
- package/.claude/.starter-kit/shared/mcp-and-pooler.md +38 -0
- package/.claude/.starter-kit/shared/mongo-setup.md +20 -0
- package/.claude/.starter-kit/shared/profile-config.md +65 -0
- package/.claude/.starter-kit/shared/seo.md +113 -0
- package/.claude/.starter-kit/shared/sql-setup.md +37 -0
- package/.claude/commands/add-feature.md +349 -0
- package/.claude/commands/add-project-setup.md +156 -0
- package/.claude/commands/architecture.md +27 -0
- package/.claude/commands/commit.md +61 -0
- package/.claude/commands/convert-project-to-starter-kit.md +508 -0
- package/.claude/commands/create-api.md +385 -0
- package/.claude/commands/create-e2e.md +230 -0
- package/.claude/commands/diagram.md +301 -0
- package/.claude/commands/help.md +120 -0
- package/.claude/commands/install-global.md +145 -0
- package/.claude/commands/new-project.md +244 -0
- package/.claude/commands/optimize-docker.md +352 -0
- package/.claude/commands/progress.md +61 -0
- package/.claude/commands/projects-created.md +79 -0
- package/.claude/commands/quickstart.md +105 -0
- package/.claude/commands/refactor.md +267 -0
- package/.claude/commands/remove-project.md +95 -0
- package/.claude/commands/review.md +59 -0
- package/.claude/commands/security-check.md +77 -0
- package/.claude/commands/set-project-profile-default.md +79 -0
- package/.claude/commands/setup.md +337 -0
- package/.claude/commands/show-user-guide.md +58 -0
- package/.claude/commands/starter-kit.md +90 -0
- package/.claude/commands/test-plan.md +118 -0
- package/.claude/commands/update-project.md +413 -0
- package/.claude/commands/what-is-my-ai-doing.md +42 -0
- package/.claude/commands/worktree.md +124 -0
- package/.claude/hooks/block-dangerous-bash.py +55 -0
- package/.claude/hooks/check-branch.sh +116 -0
- package/.claude/hooks/check-e2e.sh +71 -0
- package/.claude/hooks/check-env-sync.sh +41 -0
- package/.claude/hooks/check-file-length.py +47 -0
- package/.claude/hooks/check-ports.sh +59 -0
- package/.claude/hooks/check-rulecatch.sh +33 -0
- package/.claude/hooks/check-rybbit.sh +63 -0
- package/.claude/hooks/lint-on-save.sh +59 -0
- package/.claude/hooks/verify-no-secrets.sh +80 -0
- package/.claude/settings.json +34 -0
- package/.claude/skills/api-conventions/SKILL.md +34 -0
- package/.claude/skills/code-review/SKILL.md +87 -0
- package/.claude/skills/code-review/references/mongodb-checks.md +25 -0
- package/.claude/skills/code-review/references/project-checks.md +38 -0
- package/.claude/skills/create-service/SKILL.md +222 -0
- package/.claude/skills/debugger/SKILL.md +39 -0
- package/.claude/skills/dependency-vetting/SKILL.md +46 -0
- package/.claude/skills/design-review/SKILL.md +50 -0
- package/.claude/skills/mcp-builder/SKILL.md +57 -0
- package/.claude/skills/mongodb-rules/SKILL.md +62 -0
- package/.claude/skills/terminal-tui/SKILL.md +106 -0
- package/.claude/skills/test-writer/SKILL.md +78 -0
- package/LICENSE +21 -0
- package/README.md +2152 -0
- package/bin/cli.js +205 -0
- package/claude-mastery-project.conf +220 -0
- package/global-claude-md/CLAUDE.md +212 -0
- package/global-claude-md/settings.json +3 -0
- package/package.json +81 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
<!-- Part of /new-project scaffolding. Read via .claude/commands/new-project.md when the selection requires it; not a standalone command. -->
|
|
2
|
+
|
|
3
|
+
## Dokploy on Hostinger VPS (if selected)
|
|
4
|
+
|
|
5
|
+
When Dokploy is selected as the hosting target, scaffold a complete deployment pipeline:
|
|
6
|
+
|
|
7
|
+
### Deployment Architecture
|
|
8
|
+
```
|
|
9
|
+
Code → Docker Build → Local Test → Docker Hub → Dokploy (webhook) → Live
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
### Required Environment Variables (.env.example additions)
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# Dokploy Deployment
|
|
16
|
+
DOKPLOY_URL=http://your-vps-ip:3000/api
|
|
17
|
+
DOKPLOY_API_KEY=your_dokploy_api_key
|
|
18
|
+
DOKPLOY_APP_ID=your_application_id
|
|
19
|
+
DOKPLOY_REFRESH_TOKEN=your_webhook_refresh_token
|
|
20
|
+
|
|
21
|
+
# Docker Hub
|
|
22
|
+
DOCKER_HUB_USER=your_docker_username
|
|
23
|
+
DOCKER_IMAGE_NAME=your_docker_username/your_app_name
|
|
24
|
+
|
|
25
|
+
# Region (if multi-region)
|
|
26
|
+
DEPLOY_REGION=us
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Deployment Script: scripts/deploy.sh
|
|
30
|
+
|
|
31
|
+
Create this deployment script:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
#!/usr/bin/env bash
|
|
35
|
+
set -euo pipefail
|
|
36
|
+
|
|
37
|
+
# Load environment
|
|
38
|
+
source .env
|
|
39
|
+
|
|
40
|
+
IMAGE="$DOCKER_IMAGE_NAME:latest"
|
|
41
|
+
TAG="${1:-latest}"
|
|
42
|
+
|
|
43
|
+
echo "=== Building Docker image ==="
|
|
44
|
+
docker build -t "$IMAGE" .
|
|
45
|
+
|
|
46
|
+
echo "=== Testing locally ==="
|
|
47
|
+
docker run -d -p 3000:3000 --name deploy-test "$IMAGE"
|
|
48
|
+
sleep 5
|
|
49
|
+
|
|
50
|
+
if ! curl -sf http://localhost:3000 > /dev/null; then
|
|
51
|
+
echo "ERROR: Local test FAILED. Aborting deployment."
|
|
52
|
+
docker logs deploy-test
|
|
53
|
+
docker stop deploy-test && docker rm deploy-test
|
|
54
|
+
exit 1
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
echo "Local test PASSED."
|
|
58
|
+
docker stop deploy-test && docker rm deploy-test
|
|
59
|
+
|
|
60
|
+
echo "=== Pushing to Docker Hub ==="
|
|
61
|
+
docker push "$IMAGE"
|
|
62
|
+
|
|
63
|
+
echo "=== Deploying via Dokploy ==="
|
|
64
|
+
RESPONSE=$(curl -s -X POST \
|
|
65
|
+
-H "x-api-key: $DOKPLOY_API_KEY" \
|
|
66
|
+
-H "Content-Type: application/json" \
|
|
67
|
+
"$DOKPLOY_URL/application.deploy" \
|
|
68
|
+
-d "{\"applicationId\":\"$DOKPLOY_APP_ID\"}")
|
|
69
|
+
|
|
70
|
+
echo "Dokploy response: $RESPONSE"
|
|
71
|
+
echo "=== Deployment complete ==="
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Dokploy API Reference (for CLAUDE.md)
|
|
75
|
+
|
|
76
|
+
Add these to the project's CLAUDE.md when Dokploy is selected:
|
|
77
|
+
|
|
78
|
+
```markdown
|
|
79
|
+
## Deployment Commands
|
|
80
|
+
|
|
81
|
+
### Deploy (build, test, push, deploy)
|
|
82
|
+
bash scripts/deploy.sh
|
|
83
|
+
|
|
84
|
+
### Dokploy API (direct)
|
|
85
|
+
# List all projects
|
|
86
|
+
curl -s -H "x-api-key: $DOKPLOY_API_KEY" "$DOKPLOY_URL/project.all"
|
|
87
|
+
|
|
88
|
+
# Deploy application
|
|
89
|
+
curl -s -X POST -H "x-api-key: $DOKPLOY_API_KEY" -H "Content-Type: application/json" \
|
|
90
|
+
"$DOKPLOY_URL/application.deploy" -d '{"applicationId":"APP_ID"}'
|
|
91
|
+
|
|
92
|
+
# Redeploy (rebuild)
|
|
93
|
+
curl -s -X POST -H "x-api-key: $DOKPLOY_API_KEY" -H "Content-Type: application/json" \
|
|
94
|
+
"$DOKPLOY_URL/application.redeploy" -d '{"applicationId":"APP_ID"}'
|
|
95
|
+
|
|
96
|
+
# Start / Stop
|
|
97
|
+
curl -s -X POST -H "x-api-key: $DOKPLOY_API_KEY" -H "Content-Type: application/json" \
|
|
98
|
+
"$DOKPLOY_URL/application.start" -d '{"applicationId":"APP_ID"}'
|
|
99
|
+
|
|
100
|
+
# Webhook deploy (no auth needed — use refresh token)
|
|
101
|
+
curl -X POST http://your-vps-ip:3000/api/deploy/REFRESH_TOKEN
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Multi-Region Support (if selected)
|
|
105
|
+
|
|
106
|
+
When `multiregion` is selected, scaffold for US + EU:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# .env.example additions for multi-region
|
|
110
|
+
DOKPLOY_URL_US=http://us-vps-ip:3000/api
|
|
111
|
+
DOKPLOY_API_KEY_US=your_us_api_key
|
|
112
|
+
DOKPLOY_APP_ID_US=your_us_app_id
|
|
113
|
+
|
|
114
|
+
DOKPLOY_URL_EU=http://eu-vps-ip:3000/api
|
|
115
|
+
DOKPLOY_API_KEY_EU=your_eu_api_key
|
|
116
|
+
DOKPLOY_APP_ID_EU=your_eu_app_id
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**CRITICAL multi-region rules (add to CLAUDE.md):**
|
|
120
|
+
- US containers NEVER connect to EU databases, and vice versa
|
|
121
|
+
- Each container gets region-specific `STRICTDB_URI` (e.g., `STRICTDB_URI_US`, `STRICTDB_URI_EU`)
|
|
122
|
+
- `DEPLOY_REGION` env var must match the VPS region
|
|
123
|
+
- When pushing images: push `:latest` for US, push `:eu` tag for EU
|
|
124
|
+
- ALWAYS deploy to both regions — never leave them out of sync
|
|
125
|
+
|
|
126
|
+
### scripts/deploy-all.sh (multi-region)
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
#!/usr/bin/env bash
|
|
130
|
+
set -euo pipefail
|
|
131
|
+
source .env
|
|
132
|
+
|
|
133
|
+
IMAGE="$DOCKER_IMAGE_NAME"
|
|
134
|
+
|
|
135
|
+
# Build and test locally first
|
|
136
|
+
docker build -t "$IMAGE:latest" .
|
|
137
|
+
docker run -d -p 3000:3000 --name deploy-test "$IMAGE:latest"
|
|
138
|
+
sleep 5
|
|
139
|
+
curl -sf http://localhost:3000 > /dev/null || { echo "FAILED"; docker logs deploy-test; docker stop deploy-test; docker rm deploy-test; exit 1; }
|
|
140
|
+
docker stop deploy-test && docker rm deploy-test
|
|
141
|
+
|
|
142
|
+
# Push both tags
|
|
143
|
+
docker push "$IMAGE:latest"
|
|
144
|
+
docker tag "$IMAGE:latest" "$IMAGE:eu"
|
|
145
|
+
docker push "$IMAGE:eu"
|
|
146
|
+
|
|
147
|
+
# Deploy to both regions
|
|
148
|
+
echo "Deploying to US..."
|
|
149
|
+
curl -s -X POST -H "x-api-key: $DOKPLOY_API_KEY_US" -H "Content-Type: application/json" \
|
|
150
|
+
"$DOKPLOY_URL_US/application.deploy" -d "{\"applicationId\":\"$DOKPLOY_APP_ID_US\"}"
|
|
151
|
+
|
|
152
|
+
echo "Deploying to EU..."
|
|
153
|
+
curl -s -X POST -H "x-api-key: $DOKPLOY_API_KEY_EU" -H "Content-Type: application/json" \
|
|
154
|
+
"$DOKPLOY_URL_EU/application.deploy" -d "{\"applicationId\":\"$DOKPLOY_APP_ID_EU\"}"
|
|
155
|
+
|
|
156
|
+
echo "=== Both regions deployed ==="
|
|
157
|
+
```
|
|
158
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<!-- Part of /new-project scaffolding. Read via .claude/commands/new-project.md when the selection requires it; not a standalone command. -->
|
|
2
|
+
|
|
3
|
+
## Feature Manifest — MANDATORY Final Step (ALL modes except Clean)
|
|
4
|
+
|
|
5
|
+
**After scaffolding completes and BEFORE the final verification checklist**, write `.claude/features.json` to the new project based on what was scaffolded.
|
|
6
|
+
|
|
7
|
+
### Map scaffolding choices to features
|
|
8
|
+
|
|
9
|
+
| Scaffolding Choice | Feature Name | Files to List |
|
|
10
|
+
|-------------------|-------------|---------------|
|
|
11
|
+
| `database = mongo` | `mongo` | `scripts/db-query.ts`, `scripts/queries/example-find-user.ts`, `scripts/queries/example-count-docs.ts` |
|
|
12
|
+
| `database = postgres\|mysql\|mssql\|sqlite` | `postgres` | `scripts/db-query.ts` |
|
|
13
|
+
| Vitest installed | `vitest` | `vitest.config.ts` |
|
|
14
|
+
| Playwright installed | `playwright` | `playwright.config.ts` |
|
|
15
|
+
| Docker selected | `docker` | `Dockerfile` |
|
|
16
|
+
| Content pipeline | `content` | `scripts/build-content.ts`, `scripts/content.config.json` |
|
|
17
|
+
|
|
18
|
+
### Write the manifest
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"schemaVersion": 1,
|
|
23
|
+
"installedBy": "claude-code-mastery-starter-kit",
|
|
24
|
+
"language": "<node|go|python>",
|
|
25
|
+
"features": {
|
|
26
|
+
"<feature-name>": {
|
|
27
|
+
"version": "1.0.0",
|
|
28
|
+
"installedAt": "<current-ISO-timestamp>",
|
|
29
|
+
"updatedAt": null,
|
|
30
|
+
"files": ["<list-of-files>"]
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Write to `$PROJECT_PATH/.claude/features.json`.
|
|
37
|
+
|
|
38
|
+
**For Clean mode:** The scaffold-clean.sh script already creates an empty manifest (`"features": {}`). No additional action needed.
|
|
39
|
+
|
|
40
|
+
**For Go/Python modes:** Map the same features (e.g., Go with MongoDB via StrictDB → `mongo` feature with `internal/database/mongo.go` in files).
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<!-- Part of /new-project scaffolding. Read via .claude/commands/new-project.md when the selection requires it; not a standalone command. -->
|
|
2
|
+
|
|
3
|
+
## AI-Pooler Setup (if @rulecatch/ai-pooler in npm list)
|
|
4
|
+
|
|
5
|
+
When the default profile or user selects ai-pooler:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Free monitor mode — works immediately, no API key needed
|
|
9
|
+
# Run in a separate terminal to see live AI activity
|
|
10
|
+
npx @rulecatch/ai-pooler monitor --no-api-key
|
|
11
|
+
|
|
12
|
+
# Full setup with API key (for violation tracking, dashboards, and alerts)
|
|
13
|
+
npx @rulecatch/ai-pooler init --api-key=dc_your_key --region=us
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Add to `.env.example`:
|
|
17
|
+
```bash
|
|
18
|
+
RULECATCH_API_KEY=dc_your_api_key_here
|
|
19
|
+
RULECATCH_REGION=us
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## MCP Server Setup (if selected)
|
|
23
|
+
|
|
24
|
+
When MCP servers are selected, add them to the project setup:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Context7 — Live documentation (eliminates outdated API answers)
|
|
28
|
+
claude mcp add context7 -- npx -y @upstash/context7-mcp@latest
|
|
29
|
+
|
|
30
|
+
# Playwright — E2E testing
|
|
31
|
+
claude mcp add playwright -- npx -y @anthropic-ai/playwright-mcp
|
|
32
|
+
|
|
33
|
+
# RuleCatch — AI development analytics & rule monitoring
|
|
34
|
+
npx @rulecatch/mcp-server init
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Add selected MCP servers to the project's CLAUDE.md under a "## MCP Servers" section.
|
|
38
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!-- Part of /new-project scaffolding. Read via .claude/commands/new-project.md when the selection requires it; not a standalone command. -->
|
|
2
|
+
|
|
3
|
+
## MongoDB Test Query System (projects with `mongo` database)
|
|
4
|
+
|
|
5
|
+
When the project uses MongoDB (via StrictDB), ALWAYS scaffold the db-query system:
|
|
6
|
+
|
|
7
|
+
1. Create `scripts/db-query.ts` — the master index/CLI runner
|
|
8
|
+
2. Create `scripts/queries/` directory for individual query files
|
|
9
|
+
3. Add the db-query rules to the project's `CLAUDE.md`
|
|
10
|
+
|
|
11
|
+
**The rule that MUST be in every StrictDB/MongoDB project's CLAUDE.md:**
|
|
12
|
+
|
|
13
|
+
> ALL ad-hoc / test / dev database queries go through `scripts/db-query.ts`.
|
|
14
|
+
> When asked to look something up in the database:
|
|
15
|
+
> 1. Create a query file in `scripts/queries/<name>.ts`
|
|
16
|
+
> 2. Register it in `scripts/db-query.ts`
|
|
17
|
+
> 3. NEVER create standalone scripts or inline queries in `src/`
|
|
18
|
+
|
|
19
|
+
This prevents Claude from scattering random query scripts all over the project.
|
|
20
|
+
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<!-- Part of /new-project scaffolding. Read via .claude/commands/new-project.md when the selection requires it; not a standalone command. -->
|
|
2
|
+
|
|
3
|
+
## Profile System: claude-mastery-project.conf
|
|
4
|
+
|
|
5
|
+
If the user passes `default` (or any profile name), read `claude-mastery-project.conf` from the project root. This file defines reusable presets so users don't re-type preferences.
|
|
6
|
+
|
|
7
|
+
### claude-mastery-project.conf Format
|
|
8
|
+
|
|
9
|
+
```ini
|
|
10
|
+
# Claude Mastery Project Configuration
|
|
11
|
+
# Define profiles with preset options for /new-project
|
|
12
|
+
|
|
13
|
+
[default]
|
|
14
|
+
type = fullstack
|
|
15
|
+
framework = next
|
|
16
|
+
hosting = dokploy
|
|
17
|
+
package_manager = pnpm
|
|
18
|
+
database = mongo
|
|
19
|
+
options = seo, tailwind, docker, ci
|
|
20
|
+
mcp = playwright, context7, rulecatch
|
|
21
|
+
|
|
22
|
+
[api]
|
|
23
|
+
type = api
|
|
24
|
+
framework = fastify
|
|
25
|
+
hosting = dokploy
|
|
26
|
+
package_manager = pnpm
|
|
27
|
+
database = mongo
|
|
28
|
+
options = docker, ci
|
|
29
|
+
mcp = context7, rulecatch
|
|
30
|
+
|
|
31
|
+
[static-site]
|
|
32
|
+
type = webapp
|
|
33
|
+
framework = astro
|
|
34
|
+
hosting = static
|
|
35
|
+
package_manager = pnpm
|
|
36
|
+
options = seo, tailwind
|
|
37
|
+
mcp = context7
|
|
38
|
+
|
|
39
|
+
[quick]
|
|
40
|
+
type = webapp
|
|
41
|
+
framework = vite
|
|
42
|
+
hosting = vercel
|
|
43
|
+
package_manager = pnpm
|
|
44
|
+
options = tailwind
|
|
45
|
+
mcp = context7
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### How Profiles Work
|
|
49
|
+
|
|
50
|
+
1. Read `claude-mastery-project.conf` from project root (or `~/.claude/claude-mastery-project.conf` for global defaults)
|
|
51
|
+
2. Parse the named profile section
|
|
52
|
+
3. Apply all settings from the profile
|
|
53
|
+
4. Any additional arguments OVERRIDE profile settings
|
|
54
|
+
5. Missing settings from profile = ask the user
|
|
55
|
+
|
|
56
|
+
Examples:
|
|
57
|
+
- `/new-project my-app default` — uses [default] profile for everything
|
|
58
|
+
- `/new-project my-app api` — uses [api] profile
|
|
59
|
+
- `/new-project my-app default vercel` — uses [default] but overrides hosting to Vercel
|
|
60
|
+
- `/new-project my-app` — no profile, asks all questions
|
|
61
|
+
|
|
62
|
+
### Create Default Config
|
|
63
|
+
|
|
64
|
+
When scaffolding the starter kit itself, create `claude-mastery-project.conf` with the profiles above as starting templates. Users customize to their preferences.
|
|
65
|
+
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<!-- Part of /new-project scaffolding. Read via .claude/commands/new-project.md when the selection requires it; not a standalone command. -->
|
|
2
|
+
|
|
3
|
+
## Mandatory SEO (ALL Web Projects)
|
|
4
|
+
|
|
5
|
+
Every web project MUST include these SEO fundamentals. This is non-negotiable for any page that serves HTML.
|
|
6
|
+
|
|
7
|
+
### 1. HTML Meta Tags (in layout/head)
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<head>
|
|
11
|
+
<meta charset="UTF-8">
|
|
12
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
13
|
+
<title>Page Title — Site Name</title>
|
|
14
|
+
<meta name="description" content="Concise page description (150-160 chars)">
|
|
15
|
+
<meta name="robots" content="index, follow">
|
|
16
|
+
<link rel="canonical" href="https://example.com/current-page">
|
|
17
|
+
|
|
18
|
+
<!-- Open Graph (Facebook, LinkedIn, Discord) -->
|
|
19
|
+
<meta property="og:type" content="website">
|
|
20
|
+
<meta property="og:title" content="Page Title">
|
|
21
|
+
<meta property="og:description" content="Page description">
|
|
22
|
+
<meta property="og:image" content="https://example.com/og-image.png">
|
|
23
|
+
<meta property="og:url" content="https://example.com/current-page">
|
|
24
|
+
<meta property="og:site_name" content="Site Name">
|
|
25
|
+
|
|
26
|
+
<!-- Twitter Card -->
|
|
27
|
+
<meta name="twitter:card" content="summary_large_image">
|
|
28
|
+
<meta name="twitter:title" content="Page Title">
|
|
29
|
+
<meta name="twitter:description" content="Page description">
|
|
30
|
+
<meta name="twitter:image" content="https://example.com/og-image.png">
|
|
31
|
+
</head>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### 2. JSON-LD Structured Data (schema.org)
|
|
35
|
+
|
|
36
|
+
EVERY web project must include at minimum an Organization or WebSite schema:
|
|
37
|
+
|
|
38
|
+
```html
|
|
39
|
+
<script type="application/ld+json">
|
|
40
|
+
{
|
|
41
|
+
"@context": "https://schema.org",
|
|
42
|
+
"@type": "WebSite",
|
|
43
|
+
"name": "Your Site Name",
|
|
44
|
+
"url": "https://example.com",
|
|
45
|
+
"description": "Site description",
|
|
46
|
+
"publisher": {
|
|
47
|
+
"@type": "Organization",
|
|
48
|
+
"name": "Your Organization",
|
|
49
|
+
"logo": {
|
|
50
|
+
"@type": "ImageObject",
|
|
51
|
+
"url": "https://example.com/logo.png"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
</script>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
For specific page types, add the appropriate schema:
|
|
59
|
+
- **Article pages:** `@type: "Article"` with author, datePublished, dateModified
|
|
60
|
+
- **Product pages:** `@type: "Product"` with price, availability, reviews
|
|
61
|
+
- **FAQ pages:** `@type: "FAQPage"` with question/answer pairs
|
|
62
|
+
- **How-to pages:** `@type: "HowTo"` with steps
|
|
63
|
+
- **Breadcrumbs:** `@type: "BreadcrumbList"` on all pages with navigation depth
|
|
64
|
+
|
|
65
|
+
### 3. Technical SEO Files
|
|
66
|
+
|
|
67
|
+
Create these in the project root (or public directory):
|
|
68
|
+
|
|
69
|
+
**robots.txt:**
|
|
70
|
+
```
|
|
71
|
+
User-agent: *
|
|
72
|
+
Allow: /
|
|
73
|
+
Sitemap: https://example.com/sitemap.xml
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**sitemap.xml** (or generate dynamically):
|
|
77
|
+
```xml
|
|
78
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
79
|
+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
80
|
+
<url>
|
|
81
|
+
<loc>https://example.com/</loc>
|
|
82
|
+
<lastmod>2025-01-01</lastmod>
|
|
83
|
+
<priority>1.0</priority>
|
|
84
|
+
</url>
|
|
85
|
+
</urlset>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### 4. Performance SEO
|
|
89
|
+
|
|
90
|
+
- Images MUST use WebP format with `alt` attributes
|
|
91
|
+
- Include `<link rel="preconnect">` for external domains (fonts, analytics, CDNs)
|
|
92
|
+
- Set proper cache headers for static assets
|
|
93
|
+
- Ensure Largest Contentful Paint (LCP) < 2.5 seconds
|
|
94
|
+
|
|
95
|
+
### 5. Framework-Specific SEO
|
|
96
|
+
|
|
97
|
+
**Next.js:**
|
|
98
|
+
- Use `metadata` export in layout.tsx / page.tsx (App Router)
|
|
99
|
+
- Use `generateMetadata()` for dynamic pages
|
|
100
|
+
- JSON-LD via `<script>` in layout or use `next-seo` package
|
|
101
|
+
- next/image for automatic WebP conversion and lazy loading
|
|
102
|
+
- Automatic sitemap generation with `next-sitemap`
|
|
103
|
+
|
|
104
|
+
**Vite + React (SPA):**
|
|
105
|
+
- Use `react-helmet-async` for dynamic `<head>` management
|
|
106
|
+
- For SEO-critical SPAs, consider prerendering with `vite-plugin-ssr` or `prerender-spa-plugin`
|
|
107
|
+
- NOTE: SPAs have inherent SEO limitations — if SEO is critical, recommend SSR
|
|
108
|
+
|
|
109
|
+
**Astro:**
|
|
110
|
+
- Built-in `<head>` management in `.astro` layouts
|
|
111
|
+
- Automatic sitemap with `@astrojs/sitemap`
|
|
112
|
+
- Built-in image optimization
|
|
113
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<!-- Part of /new-project scaffolding. Read via .claude/commands/new-project.md when the selection requires it; not a standalone command. -->
|
|
2
|
+
|
|
3
|
+
## SQL Database Setup (projects with `postgres`, `mysql`, `mssql`, or `sqlite` database)
|
|
4
|
+
|
|
5
|
+
When the project uses a SQL database (PostgreSQL, MySQL, MSSQL, or SQLite), StrictDB handles the connection via `STRICTDB_URI`:
|
|
6
|
+
|
|
7
|
+
1. Install StrictDB and the appropriate driver based on database choice:
|
|
8
|
+
- All databases: `npm install strictdb@^0.1.0`
|
|
9
|
+
- PostgreSQL: `npm install pg @types/pg`
|
|
10
|
+
- MySQL: `npm install mysql2`
|
|
11
|
+
- MSSQL: `npm install mssql`
|
|
12
|
+
- SQLite: `npm install better-sqlite3 @types/better-sqlite3`
|
|
13
|
+
2. Set `STRICTDB_URI` in `.env.example` with placeholder
|
|
14
|
+
3. Add StrictDB rules to the project's CLAUDE.md
|
|
15
|
+
|
|
16
|
+
**The rule that MUST be in every SQL project's CLAUDE.md:**
|
|
17
|
+
|
|
18
|
+
> ALL SQL database access goes through StrictDB. No exceptions.
|
|
19
|
+
> NEVER create connection pools manually — StrictDB manages connections.
|
|
20
|
+
> NEVER import database drivers directly — use StrictDB's API.
|
|
21
|
+
> ALWAYS use parameterized queries — NEVER string-interpolate values into SQL.
|
|
22
|
+
|
|
23
|
+
**STRICTDB_URI examples for .env.example:**
|
|
24
|
+
```bash
|
|
25
|
+
# PostgreSQL
|
|
26
|
+
STRICTDB_URI=postgresql://user:password@localhost:5432/mydb
|
|
27
|
+
|
|
28
|
+
# MySQL
|
|
29
|
+
STRICTDB_URI=mysql://user:password@localhost:3306/mydb
|
|
30
|
+
|
|
31
|
+
# MSSQL
|
|
32
|
+
STRICTDB_URI=mssql://user:password@localhost:1433/mydb
|
|
33
|
+
|
|
34
|
+
# SQLite
|
|
35
|
+
STRICTDB_URI=file:./data/app.db
|
|
36
|
+
```
|
|
37
|
+
|