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,194 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: discover-feature
|
|
3
|
+
description: Run the two-role requirements discovery process for a new feature. The Business Analyst asks structured questions, then collaborates with the Technical Lead to assess complexity and produce a complete plan with functional and technical task lists. Writes the plan to .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
|
+
compatibility: opencode
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Discover Feature Skill
|
|
8
|
+
|
|
9
|
+
> **Invoke as:** `/discover-feature <feature-description>`
|
|
10
|
+
> After this skill completes, **start a new conversation** before running `/build-feature`.
|
|
11
|
+
|
|
12
|
+
## IMPORTANT: Token Budget
|
|
13
|
+
|
|
14
|
+
This conversation is for requirements and planning 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 — BA: Load Existing Features via MCP Memory
|
|
21
|
+
|
|
22
|
+
1. Read `package.json` to get the project name (`<project-name>`)
|
|
23
|
+
2. Call `search_memory` with `tags: ["project:<project-name>", "domain:features"]` — understand existing features and relationships
|
|
24
|
+
3. **Fallback**: if memory service is unavailable, read `.opencode/memory/architecture-snapshot.md` → "Existing Features" section
|
|
25
|
+
|
|
26
|
+
### Step 2 — BA: Discovery Questions
|
|
27
|
+
|
|
28
|
+
Ask ALL of the following before writing anything. Cover at minimum questions 1–3 + any relevant ones from 4–8.
|
|
29
|
+
|
|
30
|
+
1. **Problem & audience** — "What problem does this solve? Who experiences it?"
|
|
31
|
+
2. **User flows** — "Walk me through the happy path. What happens on error?"
|
|
32
|
+
3. **Edge cases & constraints** — "What are the limits? What should NOT happen?"
|
|
33
|
+
4. **Field constraints** — "What are the length limits, allowed formats, required vs optional fields?"
|
|
34
|
+
5. **Volume & scale** — "How many records are expected? Do you need search or pagination?"
|
|
35
|
+
6. **File/upload specifics** — (if applicable) "What file types and size limits are allowed?"
|
|
36
|
+
7. **Privacy & access** — "Who can see this data? Is it per-user or shared?"
|
|
37
|
+
8. **Relationship to existing features** — (informed by MCP memory) "Does this link to `<existing feature>`?"
|
|
38
|
+
9. **Confirm understanding** — Restate what you heard and ask for approval before writing
|
|
39
|
+
|
|
40
|
+
If the user says "just do it" without answering, document all assumptions explicitly in an `## Assumptions` section.
|
|
41
|
+
|
|
42
|
+
Only after the user confirms your understanding should you proceed to Step 3.
|
|
43
|
+
|
|
44
|
+
### Step 3 — BA: Draft Functional Spec
|
|
45
|
+
|
|
46
|
+
Write a draft functional spec (not yet the final plan):
|
|
47
|
+
|
|
48
|
+
```markdown
|
|
49
|
+
### User Story
|
|
50
|
+
As a [user type], I want [goal] so that [reason].
|
|
51
|
+
|
|
52
|
+
### Acceptance Criteria
|
|
53
|
+
- [ ] AC1: When [user does X], they see [Y]
|
|
54
|
+
- [ ] AC2: When [error condition], user sees [message/state]
|
|
55
|
+
- [ ] AC3: [Edge case]: [expected outcome]
|
|
56
|
+
|
|
57
|
+
### Functional Test Cases
|
|
58
|
+
- [ ] TC1 (AC1): User does X → sees Y (happy path)
|
|
59
|
+
- [ ] TC2 (AC2): User triggers error → sees error message
|
|
60
|
+
- [ ] TC3 (AC3): Edge case behavior visible to user
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Step 4 — Tech Lead: Codebase Complexity Assessment
|
|
64
|
+
|
|
65
|
+
Hand the draft spec to `@technical-lead` with this request:
|
|
66
|
+
> "Here is the draft functional spec for [feature]. Please: (1) read the relevant codebase areas, (2) save your findings to MCP memory, (3) report: complexity assessment, affected files, risks not in the spec, recommended technical task breakdown grouped for parallel execution."
|
|
67
|
+
|
|
68
|
+
The Tech Lead will:
|
|
69
|
+
1. Read relevant source files (actions, queries, schema, components)
|
|
70
|
+
2. Store findings in MCP memory with appropriate tags
|
|
71
|
+
3. Return a complexity report with a technical task breakdown
|
|
72
|
+
|
|
73
|
+
### Step 5 — BA + Tech Lead: Produce Combined Plan
|
|
74
|
+
|
|
75
|
+
Merge the functional spec (BA) and technical breakdown (Tech Lead) into the final plan:
|
|
76
|
+
|
|
77
|
+
```markdown
|
|
78
|
+
## Feature: [Feature Name]
|
|
79
|
+
**Timestamp**: [ISO timestamp — e.g. 2026-04-11T14:30:00Z]
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
### Context
|
|
84
|
+
[One paragraph: what problem this solves, who benefits, key constraints]
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
### User Story
|
|
89
|
+
As a [user type], I want [goal] so that [reason].
|
|
90
|
+
|
|
91
|
+
### Acceptance Criteria
|
|
92
|
+
- [ ] AC1: When [user does X], they see [Y]
|
|
93
|
+
- [ ] AC2: When [error condition], user sees [message/state]
|
|
94
|
+
- [ ] AC3: [Edge case]: [expected outcome]
|
|
95
|
+
|
|
96
|
+
### Functional Test Cases
|
|
97
|
+
- [ ] TC1 (AC1): User does X → sees Y (happy path)
|
|
98
|
+
- [ ] TC2 (AC2): User triggers error → sees error message
|
|
99
|
+
- [ ] TC3 (AC3): Edge case behavior visible to user
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
### Functional Task List (BA-owned)
|
|
104
|
+
Ordered by user value. Each task is independently testable.
|
|
105
|
+
|
|
106
|
+
- [ ] FT1: [Functional capability — user-visible description]
|
|
107
|
+
- [ ] FT2: [Functional capability]
|
|
108
|
+
- [ ] FT3: [Edge case or constraint handling]
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
### Technical Task List (Tech Lead-owned)
|
|
113
|
+
Derived from functional tasks. Scoped per agent. Parallel groups marked.
|
|
114
|
+
|
|
115
|
+
**Group A — Backend (runs in parallel with Group B)**
|
|
116
|
+
- [ ] TT1: [Schema/migration/RLS task]
|
|
117
|
+
- [ ] TT2: [Server Action/query task]
|
|
118
|
+
|
|
119
|
+
**Group B — Frontend (runs in parallel with Group A)**
|
|
120
|
+
- [ ] TT3: [Component/page task]
|
|
121
|
+
- [ ] TT4: [Form/hook task]
|
|
122
|
+
|
|
123
|
+
**Group C — Sequential gates (after A + B complete)**
|
|
124
|
+
- [ ] TT5: Test RED phase — @test-qa writes failing tests
|
|
125
|
+
- [ ] TT6: Test GREEN phase — @backend + @frontend in parallel
|
|
126
|
+
- [ ] TT7: Review gate — @code-reviewer + @security-researcher in parallel
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
### Technical Notes (from Tech Lead)
|
|
131
|
+
[Complexity, affected files with paths, patterns to reuse, risks]
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
### Assumptions
|
|
136
|
+
[If user skipped any discovery questions, list assumptions here]
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**Rules:**
|
|
140
|
+
- Acceptance criteria use plain functional language — no code, no implementation details
|
|
141
|
+
- Test cases describe what the **user sees**, not system internals
|
|
142
|
+
- Every acceptance criterion maps to at least one test case
|
|
143
|
+
- No mention of database tables, API calls, or file paths in the functional section
|
|
144
|
+
- Technical tasks are grouped for parallel execution where possible
|
|
145
|
+
- Write requirements in the user's language; IDs (`AC1`, `FT1`, `TT1`) and technical terms stay in English
|
|
146
|
+
|
|
147
|
+
### Step 6 — Write Plan to File
|
|
148
|
+
|
|
149
|
+
Save the combined plan to `.requirements/<feature-name>-<timestamp>.md`.
|
|
150
|
+
|
|
151
|
+
Use the feature name in kebab-case and ISO timestamp (e.g., `user-notifications-2026-04-11T1430.md`).
|
|
152
|
+
|
|
153
|
+
### Step 7 — Store in MCP Memory
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
store_memory({
|
|
157
|
+
content: "Requirement: <feature-name> — <one-line summary of what the feature does and key acceptance criteria>",
|
|
158
|
+
metadata: {
|
|
159
|
+
type: "architecture",
|
|
160
|
+
tags: ["project:<project-name>", "domain:features", "category:requirement", "feature:<feature-name>", "status:pending-snapshot"]
|
|
161
|
+
}
|
|
162
|
+
})
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Step 8 — Hand Off
|
|
166
|
+
|
|
167
|
+
Tell the user:
|
|
168
|
+
|
|
169
|
+
> Requirements and technical plan written to `.requirements/<feature-name>-<timestamp>.md`.
|
|
170
|
+
>
|
|
171
|
+
> **Next step**: Start a new conversation and run:
|
|
172
|
+
> ```
|
|
173
|
+
> /build-feature @.requirements/<feature-name>-<timestamp>.md
|
|
174
|
+
> ```
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## Common Issues
|
|
179
|
+
|
|
180
|
+
| Problem | Cause | Fix |
|
|
181
|
+
|---------|-------|-----|
|
|
182
|
+
| User says "just do it" without answering | Wants to skip discovery | Document all assumptions in `## Assumptions` |
|
|
183
|
+
| MCP memory unavailable | Service not running | Fall back to reading `.opencode/memory/architecture-snapshot.md` |
|
|
184
|
+
| Feature overlaps with existing one | Missed relationship check in Step 1 | Re-query MCP with `domain:features`, clarify scope with user |
|
|
185
|
+
| Tech Lead finds major technical blocker | Spec doesn't account for constraint | Update acceptance criteria before finalizing plan |
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## Guardrails
|
|
190
|
+
- BA always asks questions before writing — never assume requirements
|
|
191
|
+
- Tech Lead always saves codebase findings to MCP memory
|
|
192
|
+
- Do NOT start any implementation in this conversation
|
|
193
|
+
- Document all assumptions explicitly if the user skips questions
|
|
194
|
+
- Hand off to `/build-feature` in a fresh conversation — never chain them in the same conversation
|
|
@@ -0,0 +1,199 @@
|
|
|
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
|
+
compatibility: opencode
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Memory Skill
|
|
8
|
+
|
|
9
|
+
> **Invoke as:** `/memory sync`, `/memory recall "query"`, `/memory update`
|
|
10
|
+
|
|
11
|
+
## Preflight Check
|
|
12
|
+
|
|
13
|
+
Before running any subcommand, verify the memory service is running:
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
retrieve_memory({ query: "test", n_results: 1 })
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
If this fails, tell the user: "Memory service is unavailable. Run `pipx install mcp-memory-service` and ensure the `memory` binary is in PATH (check `opencode.json`)."
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## `/memory sync` — Snapshot → MCP
|
|
24
|
+
|
|
25
|
+
Parses `architecture-snapshot.md` into individual entries and stores each in MCP memory. Run this after scaffolding a new project or after `/memory update`.
|
|
26
|
+
|
|
27
|
+
### Steps
|
|
28
|
+
|
|
29
|
+
1. Read `package.json` — get `name` field as `<project-name>`
|
|
30
|
+
2. Read `.opencode/memory/architecture-snapshot.md`
|
|
31
|
+
3. For each section, parse into individual entries and call `store_memory`:
|
|
32
|
+
|
|
33
|
+
**Installed shadcn/ui Components** (one memory for the full list):
|
|
34
|
+
```
|
|
35
|
+
store_memory({
|
|
36
|
+
content: "Installed shadcn/ui components: button, card, input, label, spinner",
|
|
37
|
+
metadata: {
|
|
38
|
+
type: "architecture",
|
|
39
|
+
tags: ["project:<project-name>", "domain:ui", "category:components"]
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**DB Schema** (one memory per table row):
|
|
45
|
+
```
|
|
46
|
+
store_memory({
|
|
47
|
+
content: "DB table: profiles — columns: id (uuid PK), email (text unique), createdAt, updatedAt",
|
|
48
|
+
metadata: {
|
|
49
|
+
type: "architecture",
|
|
50
|
+
tags: ["project:<project-name>", "domain:database", "category:schema", "table:profiles"]
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Existing Features** (one memory per feature row):
|
|
56
|
+
```
|
|
57
|
+
store_memory({
|
|
58
|
+
content: "Feature: auth — path: src/features/auth/ — Login/logout, cookie-based sessions via Supabase",
|
|
59
|
+
metadata: {
|
|
60
|
+
type: "architecture",
|
|
61
|
+
tags: ["project:<project-name>", "domain:features", "category:feature", "feature:auth"]
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Canonical Pattern References** (one memory per pattern row):
|
|
67
|
+
```
|
|
68
|
+
store_memory({
|
|
69
|
+
content: "Canonical pattern: Server Action — file: src/features/todos/actions/todos.action.ts",
|
|
70
|
+
metadata: {
|
|
71
|
+
type: "architecture",
|
|
72
|
+
tags: ["project:<project-name>", "domain:patterns", "category:pattern", "pattern:server-action"]
|
|
73
|
+
}
|
|
74
|
+
})
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Key Rules** (one memory per bullet):
|
|
78
|
+
```
|
|
79
|
+
store_memory({
|
|
80
|
+
content: "Rule: Runtime queries use Supabase client only — Drizzle is schema/migrations only",
|
|
81
|
+
metadata: {
|
|
82
|
+
type: "architecture",
|
|
83
|
+
tags: ["project:<project-name>", "domain:rules", "category:rule"]
|
|
84
|
+
}
|
|
85
|
+
})
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Shared Utilities** (one memory per utility row):
|
|
89
|
+
```
|
|
90
|
+
store_memory({
|
|
91
|
+
content: "Utility: formFieldText(formData, key) — location: src/shared/lib/form-utils.ts — Safe FormData text extraction, avoids no-base-to-string lint error",
|
|
92
|
+
metadata: {
|
|
93
|
+
type: "architecture",
|
|
94
|
+
tags: ["project:<project-name>", "domain:shared", "category:utility"]
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Strict Rules Reference** (one memory per sub-heading group):
|
|
100
|
+
```
|
|
101
|
+
store_memory({
|
|
102
|
+
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)",
|
|
103
|
+
metadata: {
|
|
104
|
+
type: "architecture",
|
|
105
|
+
tags: ["project:<project-name>", "domain:rules", "category:lint-rule", "subcategory:typescript"]
|
|
106
|
+
}
|
|
107
|
+
})
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
4. After all entries are stored, call:
|
|
111
|
+
```
|
|
112
|
+
trigger_consolidation({ time_horizon: "daily", immediate: true })
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
5. Report: "Stored N memories for project `<project-name>`. Consolidation triggered."
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## `/memory recall "query"` — Semantic Search
|
|
120
|
+
|
|
121
|
+
Use to find project context without reading the full snapshot.
|
|
122
|
+
|
|
123
|
+
### Steps
|
|
124
|
+
|
|
125
|
+
1. Read `package.json` — get `<project-name>`
|
|
126
|
+
2. Call broad semantic search:
|
|
127
|
+
```
|
|
128
|
+
retrieve_memory({ query: "<user-query>", n_results: 10 })
|
|
129
|
+
```
|
|
130
|
+
3. If results are too broad, narrow with tags:
|
|
131
|
+
```
|
|
132
|
+
search_memory({
|
|
133
|
+
query: "<user-query>",
|
|
134
|
+
tags: ["project:<project-name>"],
|
|
135
|
+
limit: 5,
|
|
136
|
+
min_score: 0.6
|
|
137
|
+
})
|
|
138
|
+
```
|
|
139
|
+
4. Present results as a summary. If no results found, tell the user to run `/memory sync` first.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## `/memory update` — MCP → Snapshot
|
|
144
|
+
|
|
145
|
+
Merges new entries (tagged `status:pending-snapshot`) back into `architecture-snapshot.md`. Run after agents store new knowledge via `store_memory`.
|
|
146
|
+
|
|
147
|
+
### Steps
|
|
148
|
+
|
|
149
|
+
1. Read `package.json` — get `<project-name>`
|
|
150
|
+
2. Search for pending entries:
|
|
151
|
+
```
|
|
152
|
+
search_memory({
|
|
153
|
+
query: "new pending architecture update",
|
|
154
|
+
tags: ["project:<project-name>", "status:pending-snapshot"],
|
|
155
|
+
limit: 50
|
|
156
|
+
})
|
|
157
|
+
```
|
|
158
|
+
3. For each result, determine the target section from the `domain` and `category` tags:
|
|
159
|
+
- `domain:ui` → "Installed shadcn/ui Components"
|
|
160
|
+
- `domain:database` → "DB Schema"
|
|
161
|
+
- `domain:features` → "Existing Features"
|
|
162
|
+
- `domain:patterns` → "Canonical Pattern References"
|
|
163
|
+
- `domain:rules` + `category:rule` → "Key Rules"
|
|
164
|
+
- `domain:shared` → "Shared Utilities"
|
|
165
|
+
4. Read `.opencode/memory/architecture-snapshot.md` and merge new entries into the correct sections
|
|
166
|
+
5. Write the updated snapshot
|
|
167
|
+
6. Re-store each processed memory WITHOUT the `status:pending-snapshot` tag
|
|
168
|
+
7. Call `trigger_consolidation({ time_horizon: "daily", immediate: true })`
|
|
169
|
+
8. Report: "Merged N entries into architecture-snapshot.md."
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## Tag Schema Reference
|
|
174
|
+
|
|
175
|
+
All memories must include `type: "architecture"` and `project:<project-name>`. Use lowercase with hyphens for multi-word values.
|
|
176
|
+
|
|
177
|
+
| Snapshot Section | Required Tags | Optional Tags |
|
|
178
|
+
|---|---|---|
|
|
179
|
+
| shadcn Components | `domain:ui`, `category:components` | — |
|
|
180
|
+
| DB Schema | `domain:database`, `category:schema` | `table:<name>` |
|
|
181
|
+
| Existing Features | `domain:features`, `category:feature` | `feature:<name>` |
|
|
182
|
+
| Canonical Patterns | `domain:patterns`, `category:pattern` | `pattern:<type>` |
|
|
183
|
+
| Key Rules | `domain:rules`, `category:rule` | — |
|
|
184
|
+
| Shared Utilities | `domain:shared`, `category:utility` | — |
|
|
185
|
+
| Strict Rules (TS) | `domain:rules`, `category:lint-rule` | `subcategory:typescript` |
|
|
186
|
+
| Strict Rules (ESLint) | `domain:rules`, `category:lint-rule` | `subcategory:eslint` |
|
|
187
|
+
|
|
188
|
+
When storing **new** architecture knowledge (e.g., after `/build-feature`), add `status:pending-snapshot` so `/memory update` can sync it back.
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## Guardrails
|
|
193
|
+
|
|
194
|
+
- NEVER store secrets, API keys, `.env` values, or credentials in memory
|
|
195
|
+
- ALWAYS scope memories with `project:<project-name>` to prevent cross-project pollution
|
|
196
|
+
- ALWAYS use `type: "architecture"` for snapshot-derived memories
|
|
197
|
+
- Keep individual memory content under 300 words for effective semantic retrieval
|
|
198
|
+
- The snapshot file (`.opencode/memory/architecture-snapshot.md`) is the source of truth — MCP memory is a search index
|
|
199
|
+
- 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
|
+
compatibility: opencode
|
|
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,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
|
+
compatibility: opencode
|
|
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,105 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: supabase
|
|
3
|
+
description: "Use when doing ANY task involving Supabase. Triggers: Supabase products (Database, Auth, Edge Functions, Realtime, Storage, Vectors, Cron, Queues); client libraries and SSR integrations (supabase-js, @supabase/ssr) in Next.js, React, SvelteKit, Astro, Remix; auth issues (login, logout, sessions, JWT, cookies, getSession, getUser, getClaims, RLS); Supabase CLI or MCP server; schema changes, migrations, security audits, Postgres extensions (pg_graphql, pg_cron, pg_vector)."
|
|
4
|
+
compatibility: opencode
|
|
5
|
+
metadata:
|
|
6
|
+
author: supabase
|
|
7
|
+
version: "0.1.0"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Supabase
|
|
11
|
+
|
|
12
|
+
## Core Principles
|
|
13
|
+
|
|
14
|
+
**1. Supabase changes frequently — verify against current docs before implementing.**
|
|
15
|
+
Do not rely on training data for Supabase features. Function signatures, config.toml settings, and API conventions change between versions. Before implementing, look up the relevant topic using the documentation access methods below.
|
|
16
|
+
|
|
17
|
+
**2. Verify your work.**
|
|
18
|
+
After implementing any fix, run a test query to confirm the change works. A fix without verification is incomplete.
|
|
19
|
+
|
|
20
|
+
**3. Recover from errors, don't loop.**
|
|
21
|
+
If an approach fails after 2-3 attempts, stop and reconsider. Try a different method, check documentation, inspect the error more carefully, and review relevant logs when available. Supabase issues are not always solved by retrying the same command, and the answer is not always in the logs, but logs are often worth checking before proceeding.
|
|
22
|
+
|
|
23
|
+
**4. RLS by default in exposed schemas.**
|
|
24
|
+
Enable RLS on every table in any exposed schema, especially `public`. This is critical in Supabase because tables in exposed schemas can be reachable through the Data API. For private schemas, prefer RLS as defense in depth. After enabling RLS, create policies that match the actual access model rather than defaulting every table to the same `auth.uid()` pattern.
|
|
25
|
+
|
|
26
|
+
**5. Security checklist.**
|
|
27
|
+
When working on any Supabase task that touches auth, RLS, views, storage, or user data, run through this checklist. These are Supabase-specific security traps that silently create vulnerabilities:
|
|
28
|
+
|
|
29
|
+
- **Auth and session security**
|
|
30
|
+
- **Never use `user_metadata` claims in JWT-based authorization decisions.** In Supabase, `raw_user_meta_data` is user-editable and can appear in `auth.jwt()`, so it is unsafe for RLS policies or any other authorization logic. Store authorization data in `raw_app_meta_data` / `app_metadata` instead.
|
|
31
|
+
- **Deleting a user does not invalidate existing access tokens.** Sign out or revoke sessions first, keep JWT expiry short for sensitive apps, and for strict guarantees validate `session_id` against `auth.sessions` on sensitive operations.
|
|
32
|
+
- **If you use `app_metadata` or `auth.jwt()` for authorization, remember JWT claims are not always fresh until the user's token is refreshed.**
|
|
33
|
+
|
|
34
|
+
- **API key and client exposure**
|
|
35
|
+
- **Never expose the `service_role` or secret key in public clients.** Prefer publishable keys for frontend code. Legacy `anon` keys are only for compatibility. In Next.js, any `NEXT_PUBLIC_` env var is sent to the browser.
|
|
36
|
+
|
|
37
|
+
- **RLS, views, and privileged database code**
|
|
38
|
+
- **Views bypass RLS by default.** In Postgres 15 and above, use `CREATE VIEW ... WITH (security_invoker = true)`. In older versions of Postgres, protect your views by revoking access from the `anon` and `authenticated` roles, or by putting them in an unexposed schema.
|
|
39
|
+
- **UPDATE requires a SELECT policy.** In Postgres RLS, an UPDATE needs to first SELECT the row. Without a SELECT policy, updates silently return 0 rows — no error, just no change.
|
|
40
|
+
- **Do not put `security definer` functions in an exposed schema.** Keep them in a private or otherwise unexposed schema.
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
- **Storage access control**
|
|
44
|
+
- **Storage upsert requires INSERT + SELECT + UPDATE.** Granting only INSERT allows new uploads but file replacement (upsert) silently fails. You need all three.
|
|
45
|
+
|
|
46
|
+
For any security concern not covered above, fetch the Supabase product security index: `https://supabase.com/docs/guides/security/product-security.md`
|
|
47
|
+
|
|
48
|
+
## Supabase CLI
|
|
49
|
+
|
|
50
|
+
Always discover commands via `--help` — never guess. The CLI structure changes between versions.
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
supabase --help # All top-level commands
|
|
54
|
+
supabase <group> --help # Subcommands (e.g., supabase db --help)
|
|
55
|
+
supabase <group> <command> --help # Flags for a specific command
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Supabase CLI Known gotchas:**
|
|
59
|
+
- `supabase db query` requires **CLI v2.79.0+** → use MCP `execute_sql` or `psql` as fallback
|
|
60
|
+
- `supabase db advisors` requires **CLI v2.81.3+** → use MCP `get_advisors` as fallback
|
|
61
|
+
- When you need a new migration SQL file, **always** create it with `supabase migration new <name>` first. Never invent a migration filename or rely on memory for the expected format.
|
|
62
|
+
|
|
63
|
+
**Version check and upgrade:** Run `supabase --version` to check. For CLI changelogs and version-specific features, consult the [CLI documentation](https://supabase.com/docs/reference/cli/introduction) or [GitHub releases](https://github.com/supabase/cli/releases).
|
|
64
|
+
|
|
65
|
+
## Supabase MCP Server
|
|
66
|
+
|
|
67
|
+
For setup instructions, server URL, and configuration, see the [MCP setup guide](https://supabase.com/docs/guides/getting-started/mcp).
|
|
68
|
+
|
|
69
|
+
**Troubleshooting connection issues** — follow these steps in order:
|
|
70
|
+
|
|
71
|
+
1. **Check if the server is reachable:**
|
|
72
|
+
`curl -so /dev/null -w "%{http_code}" https://mcp.supabase.com/mcp`
|
|
73
|
+
A `401` is expected (no token) and means the server is up. Timeout or "connection refused" means it may be down.
|
|
74
|
+
|
|
75
|
+
2. **Check `opencode.json` configuration:**
|
|
76
|
+
Verify the project root has a valid `opencode.json` with the correct server URL. If missing, create one pointing to `https://mcp.supabase.com/mcp`.
|
|
77
|
+
|
|
78
|
+
3. **Authenticate the MCP server:**
|
|
79
|
+
If the server is reachable and the config is correct but tools aren't visible, the user needs to authenticate. The Supabase MCP server uses OAuth 2.1 — tell the user to trigger the auth flow in their agent, complete it in the browser, and reload the session.
|
|
80
|
+
|
|
81
|
+
## Supabase Documentation
|
|
82
|
+
|
|
83
|
+
Before implementing any Supabase feature, find the relevant documentation. Use these methods in priority order:
|
|
84
|
+
|
|
85
|
+
1. **MCP `search_docs` tool** (preferred — returns relevant snippets directly)
|
|
86
|
+
2. **Fetch docs pages as markdown** — any docs page can be fetched by appending `.md` to the URL path.
|
|
87
|
+
3. **Web search** for Supabase-specific topics when you don't know which page to look at.
|
|
88
|
+
|
|
89
|
+
## Making and Committing Schema Changes
|
|
90
|
+
|
|
91
|
+
**To make schema changes, use `execute_sql` (MCP) or `supabase db query` (CLI).** These run SQL directly on the database without creating migration history entries, so you can iterate freely and generate a clean migration when ready.
|
|
92
|
+
|
|
93
|
+
Do NOT use `apply_migration` to change a local database schema — it writes a migration history entry on every call, which means you can't iterate, and `supabase db diff` / `supabase db pull` will produce empty or conflicting diffs. If you use it, you'll be stuck with whatever SQL you passed on the first try.
|
|
94
|
+
|
|
95
|
+
**When ready to commit** your changes to a migration file:
|
|
96
|
+
|
|
97
|
+
1. **Run advisors** → `supabase db advisors` (CLI v2.81.3+) or MCP `get_advisors`. Fix any issues.
|
|
98
|
+
2. **Review the Security Checklist above** if your changes involve views, functions, triggers, or storage.
|
|
99
|
+
3. **Generate the migration** → `supabase db pull <descriptive-name> --local --yes`
|
|
100
|
+
4. **Verify** → `supabase migration list --local`
|
|
101
|
+
|
|
102
|
+
## Reference Guides
|
|
103
|
+
|
|
104
|
+
- **Skill Feedback** → [references/skill-feedback.md](references/skill-feedback.md)
|
|
105
|
+
**MUST read when** the user reports that this skill gave incorrect guidance or is missing information.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
## What happened
|
|
2
|
+
|
|
3
|
+
**Task:** <!-- e.g., "Set up MFA on patient records" -->
|
|
4
|
+
|
|
5
|
+
**Skill said:** <!-- e.g., "Use auth.jwt()->>'app_metadata' in the RLS policy" -->
|
|
6
|
+
|
|
7
|
+
**Expected:** <!-- e.g., "The function also needs SECURITY DEFINER + grant to supabase_auth_admin" -->
|
|
8
|
+
|
|
9
|
+
## Source
|
|
10
|
+
|
|
11
|
+
**File:** <!-- e.g., references/security-model.md -->
|
|
12
|
+
|
|
13
|
+
**Section:** <!-- e.g., "Trust Boundaries > user_metadata vs app_metadata" -->
|
|
14
|
+
|
|
15
|
+
## Fix suggestion
|
|
16
|
+
|
|
17
|
+
<!-- Leave blank if unsure -->
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Skill Feedback
|
|
2
|
+
|
|
3
|
+
Use this when the user reports that the skill gave incorrect guidance, is missing information, or could be improved. This is about the skill (agent instructions), not about Supabase the product.
|
|
4
|
+
|
|
5
|
+
## Steps
|
|
6
|
+
|
|
7
|
+
1. **Ask permission** — Ask the user if they'd like to submit feedback to the skill maintainers. If they decline, move on.
|
|
8
|
+
|
|
9
|
+
2. **Draft the issue** — Use the template at [assets/feedback-issue-template.md](../assets/feedback-issue-template.md) to structure the feedback. Fill in the fields based on the conversation. Always identify which specific reference file and section caused the problem.
|
|
10
|
+
|
|
11
|
+
3. **Submit** — Create a GitHub Issue on the `supabase/agent-skills` repository using the draft as the issue body. The title must follow this format: `user-feedback: <summary of the problem>`.
|
|
12
|
+
|
|
13
|
+
4. **Share the result** — Share the issue URL with the user after submission. If submission fails, give the user this link to create the issue manually:
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
https://github.com/supabase/agent-skills/issues/new
|
|
17
|
+
```
|