nextjs-hackathon-stack 0.1.40 → 0.1.42
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/dist/index.js +3 -63
- package/package.json +1 -1
- package/template/.claude/agents/backend.md +54 -0
- package/template/.claude/agents/business-analyst.md +195 -0
- package/template/.claude/agents/code-reviewer.md +76 -0
- package/template/.claude/agents/frontend.md +85 -0
- package/template/.claude/agents/security-researcher.md +54 -0
- package/template/.claude/agents/technical-lead.md +92 -0
- package/template/.claude/agents/test-qa.md +85 -0
- package/template/.claude/rules/architecture.mdc +48 -0
- package/template/.claude/rules/coding-standards.mdc +120 -0
- package/template/.claude/rules/components.mdc +49 -0
- package/template/.claude/rules/data-fetching.mdc +115 -0
- package/template/.claude/rules/forms.mdc +100 -0
- package/template/.claude/rules/general.mdc +54 -0
- package/template/.claude/rules/migrations.mdc +11 -0
- package/template/.claude/rules/nextjs.mdc +71 -0
- package/template/.claude/rules/security.mdc +108 -0
- package/template/.claude/rules/supabase.mdc +70 -0
- package/template/.claude/rules/testing.mdc +136 -0
- package/template/.claude/settings.json +16 -0
- package/template/.claude/skills/build-feature/SKILL.md +198 -0
- package/template/.claude/skills/build-feature/references/server-action-test-template.md +103 -0
- package/template/.claude/skills/create-api-route/SKILL.md +62 -0
- package/template/.claude/skills/discover-feature/SKILL.md +200 -0
- package/template/.claude/skills/memory/SKILL.md +208 -0
- package/template/.claude/skills/review-branch/SKILL.md +43 -0
- package/template/.claude/skills/review-branch/references/review-checklist.md +36 -0
- package/template/.claude/skills/security-audit/SKILL.md +40 -0
- package/template/.claude/skills/security-audit/references/audit-steps.md +41 -0
- package/template/.claude/skills/supabase/SKILL.md +105 -0
- package/template/.claude/skills/supabase/assets/feedback-issue-template.md +17 -0
- package/template/.claude/skills/supabase/references/skill-feedback.md +17 -0
- package/template/.claude/skills/supabase-postgres-best-practices/SKILL.md +65 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp__contributing.md +170 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp__sections.md +39 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp__template.md +34 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_advanced-full-text-search.md +55 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_advanced-jsonb-indexing.md +49 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_conn-idle-timeout.md +46 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_conn-limits.md +44 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_conn-pooling.md +41 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_conn-prepared-statements.md +46 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_data-batch-inserts.md +54 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_data-n-plus-one.md +53 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_data-pagination.md +50 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_data-upsert.md +50 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_lock-advisory.md +56 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_lock-deadlock-prevention.md +68 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_lock-short-transactions.md +50 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_lock-skip-locked.md +54 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_monitor-explain-analyze.md +45 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_monitor-pg-stat-statements.md +55 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_monitor-vacuum-analyze.md +55 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_query-composite-indexes.md +44 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_query-covering-indexes.md +40 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_query-index-types.md +48 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_query-missing-indexes.md +43 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_query-partial-indexes.md +45 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_schema-constraints.md +80 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_schema-data-types.md +46 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_schema-foreign-key-indexes.md +59 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_schema-lowercase-identifiers.md +55 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_schema-partitioning.md +55 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_schema-primary-keys.md +61 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_security-privileges.md +54 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_security-rls-basics.md +50 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_security-rls-performance.md +57 -0
- package/template/.cursor/agents/business-analyst.md +197 -0
- package/template/.cursor/agents/technical-lead.md +3 -3
- package/template/.cursor/mcp.json +6 -2
- package/template/.cursor/skills/build-feature/SKILL.md +20 -21
- package/template/.cursor/skills/discover-feature/SKILL.md +118 -29
- package/template/.cursor/skills/supabase/SKILL.md +104 -0
- package/template/.cursor/skills/supabase/assets/feedback-issue-template.md +17 -0
- package/template/.cursor/skills/supabase/references/skill-feedback.md +17 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/SKILL.md +64 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp__contributing.md +170 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp__sections.md +39 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp__template.md +34 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_advanced-full-text-search.md +55 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_advanced-jsonb-indexing.md +49 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_conn-idle-timeout.md +46 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_conn-limits.md +44 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_conn-pooling.md +41 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_conn-prepared-statements.md +46 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_data-batch-inserts.md +54 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_data-n-plus-one.md +53 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_data-pagination.md +50 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_data-upsert.md +50 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_lock-advisory.md +56 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_lock-deadlock-prevention.md +68 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_lock-short-transactions.md +50 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_lock-skip-locked.md +54 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_monitor-explain-analyze.md +45 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_monitor-pg-stat-statements.md +55 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_monitor-vacuum-analyze.md +55 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_query-composite-indexes.md +44 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_query-covering-indexes.md +40 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_query-index-types.md +48 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_query-missing-indexes.md +43 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_query-partial-indexes.md +45 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_schema-constraints.md +80 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_schema-data-types.md +46 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_schema-foreign-key-indexes.md +59 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_schema-lowercase-identifiers.md +55 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_schema-partitioning.md +55 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_schema-primary-keys.md +61 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_security-privileges.md +54 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_security-rls-basics.md +50 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_security-rls-performance.md +57 -0
- package/template/.mcp.json +16 -0
- package/template/.opencode/agents/backend.md +72 -0
- package/template/.opencode/agents/business-analyst.md +153 -0
- package/template/.opencode/agents/code-reviewer.md +80 -0
- package/template/.opencode/agents/frontend.md +84 -0
- package/template/.opencode/agents/security-researcher.md +58 -0
- package/template/.opencode/agents/technical-lead.md +131 -0
- package/template/.opencode/agents/test-qa.md +103 -0
- package/template/.opencode/memory/architecture-snapshot.md +127 -0
- package/template/.opencode/skills/build-feature/SKILL.md +208 -0
- package/template/.opencode/skills/create-api-route/SKILL.md +63 -0
- package/template/.opencode/skills/discover-feature/SKILL.md +194 -0
- package/template/.opencode/skills/memory/SKILL.md +199 -0
- package/template/.opencode/skills/review-branch/SKILL.md +43 -0
- package/template/.opencode/skills/security-audit/SKILL.md +40 -0
- package/template/.opencode/skills/supabase/SKILL.md +105 -0
- package/template/.opencode/skills/supabase/assets/feedback-issue-template.md +17 -0
- package/template/.opencode/skills/supabase/references/skill-feedback.md +17 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/SKILL.md +65 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp__contributing.md +170 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp__sections.md +39 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp__template.md +34 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_advanced-full-text-search.md +55 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_advanced-jsonb-indexing.md +49 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_conn-idle-timeout.md +46 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_conn-limits.md +44 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_conn-pooling.md +41 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_conn-prepared-statements.md +46 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_data-batch-inserts.md +54 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_data-n-plus-one.md +53 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_data-pagination.md +50 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_data-upsert.md +50 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_lock-advisory.md +56 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_lock-deadlock-prevention.md +68 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_lock-short-transactions.md +50 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_lock-skip-locked.md +54 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_monitor-explain-analyze.md +45 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_monitor-pg-stat-statements.md +55 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_monitor-vacuum-analyze.md +55 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_query-composite-indexes.md +44 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_query-covering-indexes.md +40 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_query-index-types.md +48 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_query-missing-indexes.md +43 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_query-partial-indexes.md +45 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_schema-constraints.md +80 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_schema-data-types.md +46 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_schema-foreign-key-indexes.md +59 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_schema-lowercase-identifiers.md +55 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_schema-partitioning.md +55 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_schema-primary-keys.md +61 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_security-privileges.md +54 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_security-rls-basics.md +50 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_security-rls-performance.md +57 -0
- package/template/.requirements/README.md +1 -1
- package/template/AGENTS.md +1 -1
- package/template/CLAUDE.md +1 -1
- package/template/Dockerfile.memory +7 -0
- package/template/README.md +15 -2
- package/template/_gitignore +3 -0
- package/template/docker-compose.yml +28 -0
- package/template/ia-flow.md +341 -0
- package/template/opencode.json +23 -0
- package/template/.cursor/agents/business-intelligence.md +0 -83
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: create-api-route
|
|
3
|
+
description: Create a new Next.js API route with Zod validation, auth check, and TDD tests. Use when adding API endpoints to a feature. Triggers: 'create API route', 'add endpoint', 'new route handler', 'API endpoint'. NOT for: Server Actions (those go in features/*/actions/).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Create API Route Skill
|
|
7
|
+
|
|
8
|
+
## Process
|
|
9
|
+
|
|
10
|
+
### 1. Define Schema
|
|
11
|
+
```typescript
|
|
12
|
+
const requestSchema = z.object({ /* fields */ });
|
|
13
|
+
const responseSchema = z.object({ /* fields */ });
|
|
14
|
+
type RequestBody = z.infer<typeof requestSchema>;
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### 2. Write Test First (TDD)
|
|
18
|
+
```typescript
|
|
19
|
+
describe("POST /api/my-route", () => {
|
|
20
|
+
it("returns 400 on invalid input", async () => { ... });
|
|
21
|
+
it("returns 401 when unauthenticated", async () => { ... });
|
|
22
|
+
it("returns 200 with valid input", async () => { ... });
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Run test — must FAIL (RED).
|
|
27
|
+
|
|
28
|
+
### 3. Implement Route
|
|
29
|
+
```typescript
|
|
30
|
+
// Determine runtime:
|
|
31
|
+
// - AI routes: export const runtime = "edge"
|
|
32
|
+
// - DB routes: no export (Node.js default)
|
|
33
|
+
|
|
34
|
+
export async function POST(request: Request) {
|
|
35
|
+
const supabase = await createClient();
|
|
36
|
+
const { data: { user } } = await supabase.auth.getUser();
|
|
37
|
+
if (!user) return Response.json({ error: "Unauthorized" }, { status: 401 });
|
|
38
|
+
|
|
39
|
+
const body = await request.json() as unknown;
|
|
40
|
+
const parsed = requestSchema.safeParse(body);
|
|
41
|
+
if (!parsed.success) return Response.json({ error: "Invalid input" }, { status: 400 });
|
|
42
|
+
|
|
43
|
+
// business logic...
|
|
44
|
+
|
|
45
|
+
return Response.json(result);
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 4. Verify
|
|
50
|
+
```bash
|
|
51
|
+
pnpm test:unit
|
|
52
|
+
pnpm lint
|
|
53
|
+
pnpm typecheck
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Checklist
|
|
57
|
+
- [ ] Zod schema for request/response
|
|
58
|
+
- [ ] Auth check (unless public endpoint)
|
|
59
|
+
- [ ] Input validation
|
|
60
|
+
- [ ] Correct runtime (`edge` for AI, `nodejs` default for DB)
|
|
61
|
+
- [ ] Tests written BEFORE implementation
|
|
62
|
+
- [ ] ≥95% statement/function/line coverage, ≥90% branch coverage
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: discover-feature
|
|
3
|
+
description: Run the BA+TL requirements discovery process for a new feature. BA asks questions, then collaborates with Technical Lead to produce a combined plan (Functional Tasks + Technical Tasks) in .requirements/<feature-name>-<timestamp>.md. Use this in Conversation 1, then start a new conversation and run /build-feature. Triggers: 'new feature', 'define requirements', 'discover feature', 'I want to build'. NOT for: already-defined features (use /build-feature directly).
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Discover Feature Skill
|
|
8
|
+
|
|
9
|
+
> **Invoke as:** `/discover-feature <feature-description>`
|
|
10
|
+
> Run in **Agent mode**. After this skill completes, **start a new conversation** before running `/build-feature`.
|
|
11
|
+
|
|
12
|
+
## IMPORTANT: Token Budget
|
|
13
|
+
|
|
14
|
+
This conversation is for requirements only. Do NOT start implementation here. When done, start a fresh conversation to keep the implementation context clean.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Process
|
|
19
|
+
|
|
20
|
+
### Step 1 — Load Existing Features via MCP Memory
|
|
21
|
+
|
|
22
|
+
1. Read `package.json` → get `<project-name>`
|
|
23
|
+
2. Call `search_memory` with `tags: ["project:<project-name>", "domain:features"]` to understand existing features
|
|
24
|
+
3. **Fallback**: if memory service is unavailable, read `.cursor/memory/architecture-snapshot.md` → "Existing Features" section
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
### Step 2 — Discovery Questions (BA role)
|
|
29
|
+
|
|
30
|
+
Ask ALL of the following before writing anything. Cover at minimum questions 1–3 + any relevant ones from 4–8.
|
|
31
|
+
|
|
32
|
+
1. **Problem & audience** — "What problem does this solve? Who experiences it?"
|
|
33
|
+
2. **User flows** — "Walk me through the happy path. What happens on error?"
|
|
34
|
+
3. **Edge cases & constraints** — "What are the limits? What should NOT happen?"
|
|
35
|
+
4. **Field constraints** — "Length limits, allowed formats, required vs optional fields?"
|
|
36
|
+
5. **Volume & scale** — "How many records? Do you need search or pagination?"
|
|
37
|
+
6. **File/upload specifics** — (if applicable) "What file types and size limits are allowed?"
|
|
38
|
+
7. **Privacy & access** — "Who can see this data? Per-user or shared?"
|
|
39
|
+
8. **Relationship to existing features** — (informed by MCP results) "Does this link to existing data?"
|
|
40
|
+
9. **Confirm understanding** — Restate what you heard and ask for explicit approval
|
|
41
|
+
|
|
42
|
+
If the user says "just do it" without answering, document all assumptions in an `## Assumptions` section.
|
|
43
|
+
|
|
44
|
+
Only after the user confirms your understanding should you proceed to Step 3.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
### Step 3 — Write Draft Functional Spec (BA role)
|
|
49
|
+
|
|
50
|
+
```markdown
|
|
51
|
+
## Feature: [Feature Name]
|
|
52
|
+
|
|
53
|
+
### User Story
|
|
54
|
+
As a [user type], I want [goal] so that [reason].
|
|
55
|
+
|
|
56
|
+
### Acceptance Criteria
|
|
57
|
+
- [ ] AC1: When [user does X], they see [Y]
|
|
58
|
+
- [ ] AC2: When [error condition], user sees [message/state]
|
|
59
|
+
- [ ] AC3: [Edge case]: [expected outcome]
|
|
60
|
+
|
|
61
|
+
### Functional Test Cases
|
|
62
|
+
- [ ] TC1 (AC1): User does X → sees Y (happy path)
|
|
63
|
+
- [ ] TC2 (AC2): User triggers error → sees error message
|
|
64
|
+
- [ ] TC3 (AC3): Edge case behavior
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Rules:**
|
|
68
|
+
- Acceptance criteria in plain functional language — no code, no implementation details
|
|
69
|
+
- Test cases describe what the **user sees**, not system internals
|
|
70
|
+
- Every AC maps to at least one test case
|
|
71
|
+
- No database tables, API calls, component names, or file paths
|
|
72
|
+
- Write requirements in the user's language; IDs (`AC1`, `TC1`) and technical terms stay in English
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
### Step 4 — Technical Lead Complexity Assessment
|
|
77
|
+
|
|
78
|
+
With the draft spec ready, use the `technical-lead` subagent:
|
|
79
|
+
|
|
80
|
+
> technical-lead: please review the draft spec above and the codebase, then report back:
|
|
81
|
+
> 1. What existing patterns/components/schemas apply to this feature?
|
|
82
|
+
> 2. What is the implementation complexity (S/M/L) and why?
|
|
83
|
+
> 3. Are there any technical constraints or risks the spec should mention?
|
|
84
|
+
> 4. Break down the technical tasks needed, grouped into parallel execution groups (A runs first, B/C can run in parallel after A completes)
|
|
85
|
+
|
|
86
|
+
**Wait for TL's response. Do not proceed until TL has responded.**
|
|
87
|
+
|
|
88
|
+
After TL responds: if TL identifies missing requirements (e.g., edge cases not covered), go back to the user with targeted follow-up questions before writing the combined plan.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
### Step 5 — Produce Combined Plan
|
|
93
|
+
|
|
94
|
+
Merge BA functional spec + TL technical breakdown into the final plan file.
|
|
95
|
+
|
|
96
|
+
**Filename**: `.requirements/{feature-name}-{YYYY-MM-DD-HHmm}.md`
|
|
97
|
+
|
|
98
|
+
```markdown
|
|
99
|
+
# Feature: [Feature Name]
|
|
100
|
+
> Created: {timestamp} | Status: ready-to-build
|
|
101
|
+
|
|
102
|
+
## Context
|
|
103
|
+
[One paragraph: what problem this solves, who it's for, why now]
|
|
104
|
+
|
|
105
|
+
## Assumptions
|
|
106
|
+
[List any assumptions made when user skipped discovery questions — empty if none]
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Functional Task List (BA-owned)
|
|
111
|
+
|
|
112
|
+
### User Story
|
|
113
|
+
As a [user type], I want [goal] so that [reason].
|
|
114
|
+
|
|
115
|
+
### Acceptance Criteria
|
|
116
|
+
- [ ] AC1: ...
|
|
117
|
+
- [ ] AC2: ...
|
|
118
|
+
- [ ] AC3: ...
|
|
119
|
+
|
|
120
|
+
### Functional Test Cases
|
|
121
|
+
- [ ] TC1 (AC1): ...
|
|
122
|
+
- [ ] TC2 (AC2): ...
|
|
123
|
+
- [ ] TC3 (AC3): ...
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Technical Task List (TL-owned)
|
|
128
|
+
|
|
129
|
+
### Complexity Assessment
|
|
130
|
+
[S/M/L with rationale from TL]
|
|
131
|
+
|
|
132
|
+
### Parallel Execution Plan
|
|
133
|
+
|
|
134
|
+
#### Group A — Foundation (runs first, no dependencies)
|
|
135
|
+
- [ ] A1: [task — assigned agent: backend/frontend]
|
|
136
|
+
- [ ] A2: [task — assigned agent: backend]
|
|
137
|
+
|
|
138
|
+
#### Group B — Feature Logic (runs after Group A, backend+frontend in parallel)
|
|
139
|
+
- [ ] B1: [task — assigned agent: backend]
|
|
140
|
+
- [ ] B2: [task — assigned agent: frontend]
|
|
141
|
+
|
|
142
|
+
#### Group C — Integration & Polish (runs after Group B)
|
|
143
|
+
- [ ] C1: [task — assigned agent: test-qa]
|
|
144
|
+
- [ ] C2: [task — assigned agent: frontend]
|
|
145
|
+
|
|
146
|
+
### Review Gate (runs after all groups complete, in parallel)
|
|
147
|
+
- [ ] R1: code-reviewer — full diff review
|
|
148
|
+
- [ ] R2: security-researcher — auth, RLS, input validation
|
|
149
|
+
|
|
150
|
+
### Architecture Sync
|
|
151
|
+
- [ ] Update `.cursor/memory/architecture-snapshot.md` (new tables, components, features)
|
|
152
|
+
- [ ] Run `/memory sync`
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
### Step 6 — Store Requirement in MCP Memory
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
store_memory({
|
|
161
|
+
content: "Requirement: <feature-name> — <one-line summary of what the feature does and key ACs>",
|
|
162
|
+
metadata: {
|
|
163
|
+
type: "architecture",
|
|
164
|
+
tags: ["project:<project-name>", "domain:features", "category:requirement", "feature:<feature-name>", "status:pending-snapshot"]
|
|
165
|
+
}
|
|
166
|
+
})
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
### Step 7 — Hand Off
|
|
172
|
+
|
|
173
|
+
Tell the user:
|
|
174
|
+
|
|
175
|
+
> Combined plan written to `.requirements/<feature-name>-<timestamp>.md`.
|
|
176
|
+
>
|
|
177
|
+
> **Next step**: Start a **fresh conversation** and run:
|
|
178
|
+
> ```
|
|
179
|
+
> /build-feature @.requirements/<feature-name>-<timestamp>.md
|
|
180
|
+
> ```
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Common Issues
|
|
185
|
+
|
|
186
|
+
| Problem | Cause | Fix |
|
|
187
|
+
|---------|-------|-----|
|
|
188
|
+
| User says "just do it" without answering | Wants to skip discovery | Document all assumptions in `## Assumptions` section |
|
|
189
|
+
| MCP memory unavailable | Service not running | Fall back to reading `.cursor/memory/architecture-snapshot.md` directly |
|
|
190
|
+
| TL finds missing edge cases | Spec incomplete | Go back to user with targeted follow-up questions |
|
|
191
|
+
| Feature overlaps with existing one | Missed relationship check in Step 1 | Re-query MCP with `domain:features`, clarify scope before writing spec |
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## Guardrails
|
|
196
|
+
- Always ask questions before writing — never assume requirements
|
|
197
|
+
- Do NOT start any implementation in this conversation
|
|
198
|
+
- Do NOT produce Technical Tasks without TL input
|
|
199
|
+
- Document all assumptions explicitly if user skips questions
|
|
200
|
+
- Hand off to `/build-feature` in a fresh conversation — never chain them in the same conversation
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: memory
|
|
3
|
+
description: Sync architecture-snapshot.md with MCP memory service and recall project knowledge semantically. Use when starting a new session, after completing a feature, or to search project context efficiently. Triggers: 'memory sync', 'memory recall', 'memory update', 'sync architecture', 'search project knowledge', 'what components are installed'.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Memory Skill
|
|
7
|
+
|
|
8
|
+
> **Invoke as:** `/memory sync`, `/memory recall "query"`, `/memory update`
|
|
9
|
+
|
|
10
|
+
## Preflight Check
|
|
11
|
+
|
|
12
|
+
Before running any subcommand, verify the memory service is running:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
retrieve_memory({ query: "test", n_results: 1 })
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
If this fails, tell the user: "Memory service is unavailable. Run `pip install mcp-memory-service` and ensure the `memory` binary is in PATH (check `.cursor/mcp.json`)."
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## `/memory sync` — Snapshot → MCP
|
|
23
|
+
|
|
24
|
+
Parses `architecture-snapshot.md` into individual entries and stores each in MCP memory. Run this after scaffolding a new project or after `/memory update`.
|
|
25
|
+
|
|
26
|
+
### Steps
|
|
27
|
+
|
|
28
|
+
1. Read `package.json` — get `name` field as `<project-name>`
|
|
29
|
+
2. Read `.cursor/memory/architecture-snapshot.md`
|
|
30
|
+
3. For each section, parse into individual entries and call `store_memory`:
|
|
31
|
+
|
|
32
|
+
**Installed shadcn/ui Components** (one memory for the full list):
|
|
33
|
+
```
|
|
34
|
+
store_memory({
|
|
35
|
+
content: "Installed shadcn/ui components: button, card, input, label, spinner",
|
|
36
|
+
metadata: {
|
|
37
|
+
type: "architecture",
|
|
38
|
+
tags: ["project:<project-name>", "domain:ui", "category:components"]
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**DB Schema** (one memory per table row):
|
|
44
|
+
```
|
|
45
|
+
store_memory({
|
|
46
|
+
content: "DB table: profiles — columns: id (uuid PK), email (text unique), createdAt, updatedAt",
|
|
47
|
+
metadata: {
|
|
48
|
+
type: "architecture",
|
|
49
|
+
tags: ["project:<project-name>", "domain:database", "category:schema", "table:profiles"]
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Existing Features** (one memory per feature row):
|
|
55
|
+
```
|
|
56
|
+
store_memory({
|
|
57
|
+
content: "Feature: auth — path: src/features/auth/ — Login/logout, cookie-based sessions via Supabase",
|
|
58
|
+
metadata: {
|
|
59
|
+
type: "architecture",
|
|
60
|
+
tags: ["project:<project-name>", "domain:features", "category:feature", "feature:auth"]
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**Canonical Pattern References** (one memory per pattern row):
|
|
66
|
+
```
|
|
67
|
+
store_memory({
|
|
68
|
+
content: "Canonical pattern: Server Action — file: src/features/todos/actions/todos.action.ts",
|
|
69
|
+
metadata: {
|
|
70
|
+
type: "architecture",
|
|
71
|
+
tags: ["project:<project-name>", "domain:patterns", "category:pattern", "pattern:server-action"]
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**Key Rules** (one memory per bullet):
|
|
77
|
+
```
|
|
78
|
+
store_memory({
|
|
79
|
+
content: "Rule: Runtime queries use Supabase client only — Drizzle is schema/migrations only",
|
|
80
|
+
metadata: {
|
|
81
|
+
type: "architecture",
|
|
82
|
+
tags: ["project:<project-name>", "domain:rules", "category:rule"]
|
|
83
|
+
}
|
|
84
|
+
})
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Shared Utilities** (one memory per utility row):
|
|
88
|
+
```
|
|
89
|
+
store_memory({
|
|
90
|
+
content: "Utility: formFieldText(formData, key) — location: src/shared/lib/form-utils.ts — Safe FormData text extraction, avoids no-base-to-string lint error",
|
|
91
|
+
metadata: {
|
|
92
|
+
type: "architecture",
|
|
93
|
+
tags: ["project:<project-name>", "domain:shared", "category:utility"]
|
|
94
|
+
}
|
|
95
|
+
})
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Strict Rules Reference** (one memory per `###` sub-heading group):
|
|
99
|
+
```
|
|
100
|
+
store_memory({
|
|
101
|
+
content: "TypeScript strict rules: noUncheckedIndexedAccess (guard arr[i]), exactOptionalPropertyTypes (omit key instead of undefined), noImplicitReturns (explicit return in all branches), noUnusedLocals/noUnusedParameters (prefix unused with _), useUnknownInCatchVariables (narrow with instanceof Error)",
|
|
102
|
+
metadata: {
|
|
103
|
+
type: "architecture",
|
|
104
|
+
tags: ["project:<project-name>", "domain:rules", "category:lint-rule", "subcategory:typescript"]
|
|
105
|
+
}
|
|
106
|
+
})
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
4. After all entries are stored, call:
|
|
110
|
+
```
|
|
111
|
+
trigger_consolidation({ time_horizon: "daily", immediate: true })
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
5. Report: "Stored N memories for project `<project-name>`. Consolidation triggered."
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## `/memory recall "query"` — Semantic Search
|
|
119
|
+
|
|
120
|
+
Use to find project context without reading the full snapshot.
|
|
121
|
+
|
|
122
|
+
### Steps
|
|
123
|
+
|
|
124
|
+
1. Read `package.json` — get `<project-name>`
|
|
125
|
+
2. Call broad semantic search:
|
|
126
|
+
```
|
|
127
|
+
retrieve_memory({ query: "<user-query>", n_results: 10 })
|
|
128
|
+
```
|
|
129
|
+
3. If results are too broad, narrow with tags:
|
|
130
|
+
```
|
|
131
|
+
search_memory({
|
|
132
|
+
query: "<user-query>",
|
|
133
|
+
tags: ["project:<project-name>"],
|
|
134
|
+
limit: 5,
|
|
135
|
+
min_score: 0.6
|
|
136
|
+
})
|
|
137
|
+
```
|
|
138
|
+
4. Present results as a summary. If no results found, tell the user to run `/memory sync` first.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## `/memory update` — MCP → Snapshot
|
|
143
|
+
|
|
144
|
+
Merges new entries (tagged `status:pending-snapshot`) back into `architecture-snapshot.md`. Run after agents store new knowledge via `store_memory`.
|
|
145
|
+
|
|
146
|
+
### Steps
|
|
147
|
+
|
|
148
|
+
1. Read `package.json` — get `<project-name>`
|
|
149
|
+
2. Search for pending entries:
|
|
150
|
+
```
|
|
151
|
+
search_memory({
|
|
152
|
+
query: "new pending architecture update",
|
|
153
|
+
tags: ["project:<project-name>", "status:pending-snapshot"],
|
|
154
|
+
limit: 50
|
|
155
|
+
})
|
|
156
|
+
```
|
|
157
|
+
3. For each result, determine the target section from the `domain` and `category` tags:
|
|
158
|
+
- `domain:ui` → "Installed shadcn/ui Components"
|
|
159
|
+
- `domain:database` → "DB Schema"
|
|
160
|
+
- `domain:features` → "Existing Features"
|
|
161
|
+
- `domain:patterns` → "Canonical Pattern References"
|
|
162
|
+
- `domain:rules` + `category:rule` → "Key Rules"
|
|
163
|
+
- `domain:shared` → "Shared Utilities"
|
|
164
|
+
4. Read `.cursor/memory/architecture-snapshot.md` and merge new entries into the correct sections
|
|
165
|
+
5. Write the updated snapshot
|
|
166
|
+
6. Re-store each processed memory WITHOUT the `status:pending-snapshot` tag:
|
|
167
|
+
```
|
|
168
|
+
store_memory({
|
|
169
|
+
content: "<same content>",
|
|
170
|
+
metadata: {
|
|
171
|
+
type: "architecture",
|
|
172
|
+
tags: ["project:<project-name>", "domain:...", "category:..."]
|
|
173
|
+
// pending-snapshot tag removed
|
|
174
|
+
}
|
|
175
|
+
})
|
|
176
|
+
```
|
|
177
|
+
7. Call `trigger_consolidation({ time_horizon: "daily", immediate: true })`
|
|
178
|
+
8. Report: "Merged N entries into architecture-snapshot.md."
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## Tag Schema Reference
|
|
183
|
+
|
|
184
|
+
All memories must include `type: "architecture"` and `project:<project-name>`. Use lowercase with hyphens for multi-word values.
|
|
185
|
+
|
|
186
|
+
| Snapshot Section | Required Tags | Optional Tags |
|
|
187
|
+
|---|---|---|
|
|
188
|
+
| shadcn Components | `domain:ui`, `category:components` | — |
|
|
189
|
+
| DB Schema | `domain:database`, `category:schema` | `table:<name>` |
|
|
190
|
+
| Existing Features | `domain:features`, `category:feature` | `feature:<name>` |
|
|
191
|
+
| Canonical Patterns | `domain:patterns`, `category:pattern` | `pattern:<type>` |
|
|
192
|
+
| Key Rules | `domain:rules`, `category:rule` | — |
|
|
193
|
+
| Shared Utilities | `domain:shared`, `category:utility` | — |
|
|
194
|
+
| Strict Rules (TS) | `domain:rules`, `category:lint-rule` | `subcategory:typescript` |
|
|
195
|
+
| Strict Rules (ESLint) | `domain:rules`, `category:lint-rule` | `subcategory:eslint` |
|
|
196
|
+
|
|
197
|
+
When storing **new** architecture knowledge (e.g., after `/build-feature`), add `status:pending-snapshot` so `/memory update` can sync it back.
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Guardrails
|
|
202
|
+
|
|
203
|
+
- NEVER store secrets, API keys, `.env` values, or credentials in memory
|
|
204
|
+
- ALWAYS scope memories with `project:<project-name>` to prevent cross-project pollution
|
|
205
|
+
- ALWAYS use `type: "architecture"` for snapshot-derived memories
|
|
206
|
+
- Keep individual memory content under 300 words for effective semantic retrieval
|
|
207
|
+
- The snapshot file (`.cursor/memory/architecture-snapshot.md`) is the source of truth — MCP memory is a search index
|
|
208
|
+
- If the memory service is unavailable, agents fall back to reading the snapshot file directly
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: review-branch
|
|
3
|
+
description: Review current branch changes against develop — runs full code quality, testing, architecture, and security checklist. Triggers: 'review branch', 'review my changes', 'check branch quality', 'review PR'.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Review Branch Skill
|
|
8
|
+
|
|
9
|
+
## Process
|
|
10
|
+
|
|
11
|
+
### 1. Get Changes
|
|
12
|
+
```bash
|
|
13
|
+
git diff develop...HEAD
|
|
14
|
+
```
|
|
15
|
+
Or for a specific branch:
|
|
16
|
+
```bash
|
|
17
|
+
git diff develop...<branch-name>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### 2. Check Each Changed File
|
|
21
|
+
Apply the full checklist from `references/review-checklist.md` — covers code quality, tests, architecture, security, performance, and accessibility.
|
|
22
|
+
|
|
23
|
+
**You MUST check every changed file individually. Do not summarize or skip files. Show your analysis for each file before moving to the next.**
|
|
24
|
+
|
|
25
|
+
### 3. Generate Report
|
|
26
|
+
```
|
|
27
|
+
## Branch Review: <branch-name>
|
|
28
|
+
|
|
29
|
+
### Changed Files
|
|
30
|
+
- [list each file]
|
|
31
|
+
|
|
32
|
+
### Issues Found
|
|
33
|
+
- [file:line]: [issue] → [fix]
|
|
34
|
+
|
|
35
|
+
### Verdict: PASS / FAIL
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 4. Run Automated Checks
|
|
39
|
+
```bash
|
|
40
|
+
pnpm lint
|
|
41
|
+
pnpm typecheck
|
|
42
|
+
pnpm test:coverage
|
|
43
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Review Checklist
|
|
2
|
+
|
|
3
|
+
## Code Quality
|
|
4
|
+
- Zero `any` types
|
|
5
|
+
- Zero comments (excluding test AAA labels: `// Arrange`, `// Act`, `// Assert`)
|
|
6
|
+
- Functions ≤ 20 lines
|
|
7
|
+
- Files ≤ 200 lines
|
|
8
|
+
- No magic numbers/strings
|
|
9
|
+
- Proper error handling
|
|
10
|
+
|
|
11
|
+
## Tests
|
|
12
|
+
- Tests written BEFORE implementation (TDD)
|
|
13
|
+
- ≥95% statement/function/line coverage on new/changed files
|
|
14
|
+
- ≥90% branch coverage (every if/else/ternary/catch)
|
|
15
|
+
- Behavior tested, not implementation
|
|
16
|
+
- AAA pattern with labeled comments on every test
|
|
17
|
+
- Tests NOT weakened (no removed assertions, no loosened matchers, no .skip)
|
|
18
|
+
- Edge cases covered: null, empty, boundaries, errors, auth expired
|
|
19
|
+
|
|
20
|
+
## Architecture
|
|
21
|
+
- Correct layer (features → shared only)
|
|
22
|
+
- Server Actions for mutations (not TanStack)
|
|
23
|
+
- Edge runtime on AI routes
|
|
24
|
+
|
|
25
|
+
## Security
|
|
26
|
+
- Input validation at boundaries
|
|
27
|
+
- Auth checks in protected routes
|
|
28
|
+
- No exposed secrets
|
|
29
|
+
|
|
30
|
+
## Performance
|
|
31
|
+
- No N+1 query patterns
|
|
32
|
+
- No unnecessary re-renders
|
|
33
|
+
|
|
34
|
+
## Accessibility
|
|
35
|
+
- Semantic HTML
|
|
36
|
+
- ARIA labels where needed
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: security-audit
|
|
3
|
+
description: Run a full security audit on the codebase — checks OWASP Top 10, RLS policies, hardcoded secrets, auth coverage, input validation, XSS vectors, and security headers. Triggers: 'security audit', 'audit security', 'check vulnerabilities', 'scan for secrets', 'check RLS'.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Security Audit Skill
|
|
8
|
+
|
|
9
|
+
## Process
|
|
10
|
+
|
|
11
|
+
**You MUST execute every step below. Do not skip or summarize steps. Show your findings for each step before moving to the next.**
|
|
12
|
+
|
|
13
|
+
Execute all 7 audit steps from `references/audit-steps.md`:
|
|
14
|
+
1. Dependency audit (`pnpm audit`)
|
|
15
|
+
2. Secret scan (hardcoded keys)
|
|
16
|
+
3. RLS verification (all tables)
|
|
17
|
+
4. Auth coverage (routes + actions)
|
|
18
|
+
5. Input validation (Zod at boundaries)
|
|
19
|
+
6. XSS check (`dangerouslySetInnerHTML`)
|
|
20
|
+
7. Security headers (`next.config.ts`)
|
|
21
|
+
|
|
22
|
+
## Output Format
|
|
23
|
+
```
|
|
24
|
+
## Security Audit Report
|
|
25
|
+
|
|
26
|
+
### Critical 🔴
|
|
27
|
+
[findings]
|
|
28
|
+
|
|
29
|
+
### High 🟠
|
|
30
|
+
[findings]
|
|
31
|
+
|
|
32
|
+
### Medium 🟡
|
|
33
|
+
[findings]
|
|
34
|
+
|
|
35
|
+
### Low 🟢
|
|
36
|
+
[findings]
|
|
37
|
+
|
|
38
|
+
### Passed ✅
|
|
39
|
+
[clean checks]
|
|
40
|
+
```
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Security Audit Steps
|
|
2
|
+
|
|
3
|
+
### 1. Dependency Audit
|
|
4
|
+
```bash
|
|
5
|
+
pnpm audit
|
|
6
|
+
```
|
|
7
|
+
Categorize findings by: Critical / High / Medium / Low
|
|
8
|
+
|
|
9
|
+
### 2. Secret Scan
|
|
10
|
+
Search for hardcoded secrets:
|
|
11
|
+
```bash
|
|
12
|
+
grep -r "sk_" src/ --include="*.ts"
|
|
13
|
+
grep -r "apiKey\s*=" src/ --include="*.ts"
|
|
14
|
+
grep -r "password\s*=" src/ --include="*.ts"
|
|
15
|
+
```
|
|
16
|
+
Check `.env.example` has no real values.
|
|
17
|
+
|
|
18
|
+
### 3. RLS Verification
|
|
19
|
+
For each table in `src/shared/db/*.schema.ts`:
|
|
20
|
+
- Confirm RLS is enabled in Supabase dashboard
|
|
21
|
+
- Confirm explicit policies exist
|
|
22
|
+
|
|
23
|
+
### 4. Auth Coverage
|
|
24
|
+
- Verify `proxy.ts` protects all non-public routes
|
|
25
|
+
- Check every `route.ts` in protected features has auth check
|
|
26
|
+
- Verify `app/(protected)/layout.tsx` has server-side auth check
|
|
27
|
+
|
|
28
|
+
### 5. Input Validation
|
|
29
|
+
- Every `route.ts` has Zod schema validation
|
|
30
|
+
- Every `.action.ts` has Zod schema validation
|
|
31
|
+
|
|
32
|
+
### 6. XSS Check
|
|
33
|
+
```bash
|
|
34
|
+
grep -r "dangerouslySetInnerHTML" src/ --include="*.tsx"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 7. Security Headers
|
|
38
|
+
Verify in `next.config.ts`:
|
|
39
|
+
- `Content-Security-Policy`
|
|
40
|
+
- `Strict-Transport-Security`
|
|
41
|
+
- `X-Frame-Options`
|