class-ai-agent 1.3.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/.agent/SESSION.md +18 -13
  2. package/.claude/CLAUDE.md +26 -0
  3. package/.claude/agents/business-analyst.md +380 -0
  4. package/.claude/references/codegraph.md +26 -14
  5. package/.claude/references/supabase.md +55 -0
  6. package/.claude/rules/agent-continuity.md +3 -2
  7. package/.claude/rules/api-conventions.md +1 -0
  8. package/.claude/rules/clean-code.md +1 -0
  9. package/.claude/rules/code-style.md +1 -0
  10. package/.claude/rules/codegraph.md +43 -0
  11. package/.claude/rules/database.md +2 -1
  12. package/.claude/rules/error-handling.md +1 -0
  13. package/.claude/rules/git-workflow.md +1 -0
  14. package/.claude/rules/monitoring.md +1 -0
  15. package/.claude/rules/naming-conventions.md +1 -0
  16. package/.claude/rules/project-structure.md +1 -0
  17. package/.claude/rules/security.md +1 -0
  18. package/.claude/rules/system-design.md +1 -0
  19. package/.claude/rules/tech-stack.md +3 -1
  20. package/.claude/rules/testing.md +1 -0
  21. package/.claude/settings.json +3 -1
  22. package/.claude/skills/supabase/SKILL.md +135 -0
  23. package/.claude/skills/supabase/UPSTREAM.md +16 -0
  24. package/.claude/skills/supabase/assets/feedback-issue-template.md +17 -0
  25. package/.claude/skills/supabase/references/skill-feedback.md +17 -0
  26. package/.claude/skills/supabase-postgres-best-practices/SKILL.md +64 -0
  27. package/.claude/skills/supabase-postgres-best-practices/UPSTREAM.md +16 -0
  28. package/.claude/skills/supabase-postgres-best-practices/references/_contributing.md +170 -0
  29. package/.claude/skills/supabase-postgres-best-practices/references/_sections.md +39 -0
  30. package/.claude/skills/supabase-postgres-best-practices/references/_template.md +34 -0
  31. package/.claude/skills/supabase-postgres-best-practices/references/advanced-full-text-search.md +55 -0
  32. package/.claude/skills/supabase-postgres-best-practices/references/advanced-jsonb-indexing.md +49 -0
  33. package/.claude/skills/supabase-postgres-best-practices/references/conn-idle-timeout.md +46 -0
  34. package/.claude/skills/supabase-postgres-best-practices/references/conn-limits.md +44 -0
  35. package/.claude/skills/supabase-postgres-best-practices/references/conn-pooling.md +41 -0
  36. package/.claude/skills/supabase-postgres-best-practices/references/conn-prepared-statements.md +46 -0
  37. package/.claude/skills/supabase-postgres-best-practices/references/data-batch-inserts.md +54 -0
  38. package/.claude/skills/supabase-postgres-best-practices/references/data-n-plus-one.md +53 -0
  39. package/.claude/skills/supabase-postgres-best-practices/references/data-pagination.md +50 -0
  40. package/.claude/skills/supabase-postgres-best-practices/references/data-upsert.md +50 -0
  41. package/.claude/skills/supabase-postgres-best-practices/references/lock-advisory.md +56 -0
  42. package/.claude/skills/supabase-postgres-best-practices/references/lock-deadlock-prevention.md +68 -0
  43. package/.claude/skills/supabase-postgres-best-practices/references/lock-short-transactions.md +50 -0
  44. package/.claude/skills/supabase-postgres-best-practices/references/lock-skip-locked.md +54 -0
  45. package/.claude/skills/supabase-postgres-best-practices/references/monitor-explain-analyze.md +45 -0
  46. package/.claude/skills/supabase-postgres-best-practices/references/monitor-pg-stat-statements.md +55 -0
  47. package/.claude/skills/supabase-postgres-best-practices/references/monitor-vacuum-analyze.md +55 -0
  48. package/.claude/skills/supabase-postgres-best-practices/references/query-composite-indexes.md +44 -0
  49. package/.claude/skills/supabase-postgres-best-practices/references/query-covering-indexes.md +40 -0
  50. package/.claude/skills/supabase-postgres-best-practices/references/query-index-types.md +48 -0
  51. package/.claude/skills/supabase-postgres-best-practices/references/query-missing-indexes.md +43 -0
  52. package/.claude/skills/supabase-postgres-best-practices/references/query-partial-indexes.md +45 -0
  53. package/.claude/skills/supabase-postgres-best-practices/references/schema-constraints.md +80 -0
  54. package/.claude/skills/supabase-postgres-best-practices/references/schema-data-types.md +46 -0
  55. package/.claude/skills/supabase-postgres-best-practices/references/schema-foreign-key-indexes.md +59 -0
  56. package/.claude/skills/supabase-postgres-best-practices/references/schema-lowercase-identifiers.md +55 -0
  57. package/.claude/skills/supabase-postgres-best-practices/references/schema-partitioning.md +55 -0
  58. package/.claude/skills/supabase-postgres-best-practices/references/schema-primary-keys.md +61 -0
  59. package/.claude/skills/supabase-postgres-best-practices/references/security-privileges.md +54 -0
  60. package/.claude/skills/supabase-postgres-best-practices/references/security-rls-basics.md +50 -0
  61. package/.claude/skills/supabase-postgres-best-practices/references/security-rls-performance.md +63 -0
  62. package/.claude/skills/ui-ux-pro-max/SKILL.md +1 -90
  63. package/.cursor/CURSOR.md +4 -1
  64. package/.cursor/agents/business-analyst.md +380 -0
  65. package/.cursor/mcp.json +4 -0
  66. package/.cursor/references/supabase.md +55 -0
  67. package/.cursor/rules/cursor-overview.mdc +1 -1
  68. package/.cursor/rules/database.mdc +2 -2
  69. package/.cursor/rules/tech-stack.mdc +2 -1
  70. package/.cursor/settings.json +6 -1
  71. package/.cursor/skills/supabase/SKILL.md +135 -0
  72. package/.cursor/skills/supabase/UPSTREAM.md +16 -0
  73. package/.cursor/skills/supabase/assets/feedback-issue-template.md +17 -0
  74. package/.cursor/skills/supabase/references/skill-feedback.md +17 -0
  75. package/.cursor/skills/supabase-postgres-best-practices/SKILL.md +64 -0
  76. package/.cursor/skills/supabase-postgres-best-practices/UPSTREAM.md +16 -0
  77. package/.cursor/skills/supabase-postgres-best-practices/references/_contributing.md +170 -0
  78. package/.cursor/skills/supabase-postgres-best-practices/references/_sections.md +39 -0
  79. package/.cursor/skills/supabase-postgres-best-practices/references/_template.md +34 -0
  80. package/.cursor/skills/supabase-postgres-best-practices/references/advanced-full-text-search.md +55 -0
  81. package/.cursor/skills/supabase-postgres-best-practices/references/advanced-jsonb-indexing.md +49 -0
  82. package/.cursor/skills/supabase-postgres-best-practices/references/conn-idle-timeout.md +46 -0
  83. package/.cursor/skills/supabase-postgres-best-practices/references/conn-limits.md +44 -0
  84. package/.cursor/skills/supabase-postgres-best-practices/references/conn-pooling.md +41 -0
  85. package/.cursor/skills/supabase-postgres-best-practices/references/conn-prepared-statements.md +46 -0
  86. package/.cursor/skills/supabase-postgres-best-practices/references/data-batch-inserts.md +54 -0
  87. package/.cursor/skills/supabase-postgres-best-practices/references/data-n-plus-one.md +53 -0
  88. package/.cursor/skills/supabase-postgres-best-practices/references/data-pagination.md +50 -0
  89. package/.cursor/skills/supabase-postgres-best-practices/references/data-upsert.md +50 -0
  90. package/.cursor/skills/supabase-postgres-best-practices/references/lock-advisory.md +56 -0
  91. package/.cursor/skills/supabase-postgres-best-practices/references/lock-deadlock-prevention.md +68 -0
  92. package/.cursor/skills/supabase-postgres-best-practices/references/lock-short-transactions.md +50 -0
  93. package/.cursor/skills/supabase-postgres-best-practices/references/lock-skip-locked.md +54 -0
  94. package/.cursor/skills/supabase-postgres-best-practices/references/monitor-explain-analyze.md +45 -0
  95. package/.cursor/skills/supabase-postgres-best-practices/references/monitor-pg-stat-statements.md +55 -0
  96. package/.cursor/skills/supabase-postgres-best-practices/references/monitor-vacuum-analyze.md +55 -0
  97. package/.cursor/skills/supabase-postgres-best-practices/references/query-composite-indexes.md +44 -0
  98. package/.cursor/skills/supabase-postgres-best-practices/references/query-covering-indexes.md +40 -0
  99. package/.cursor/skills/supabase-postgres-best-practices/references/query-index-types.md +48 -0
  100. package/.cursor/skills/supabase-postgres-best-practices/references/query-missing-indexes.md +43 -0
  101. package/.cursor/skills/supabase-postgres-best-practices/references/query-partial-indexes.md +45 -0
  102. package/.cursor/skills/supabase-postgres-best-practices/references/schema-constraints.md +80 -0
  103. package/.cursor/skills/supabase-postgres-best-practices/references/schema-data-types.md +46 -0
  104. package/.cursor/skills/supabase-postgres-best-practices/references/schema-foreign-key-indexes.md +59 -0
  105. package/.cursor/skills/supabase-postgres-best-practices/references/schema-lowercase-identifiers.md +55 -0
  106. package/.cursor/skills/supabase-postgres-best-practices/references/schema-partitioning.md +55 -0
  107. package/.cursor/skills/supabase-postgres-best-practices/references/schema-primary-keys.md +61 -0
  108. package/.cursor/skills/supabase-postgres-best-practices/references/security-privileges.md +54 -0
  109. package/.cursor/skills/supabase-postgres-best-practices/references/security-rls-basics.md +50 -0
  110. package/.cursor/skills/supabase-postgres-best-practices/references/security-rls-performance.md +63 -0
  111. package/.kiro/KIRO.md +6 -3
  112. package/.kiro/agents/business-analyst.md +380 -0
  113. package/.kiro/references/supabase.md +55 -0
  114. package/.kiro/settings/mcp.json +4 -0
  115. package/.kiro/skills/supabase/SKILL.md +135 -0
  116. package/.kiro/skills/supabase/UPSTREAM.md +16 -0
  117. package/.kiro/skills/supabase/assets/feedback-issue-template.md +17 -0
  118. package/.kiro/skills/supabase/references/skill-feedback.md +17 -0
  119. package/.kiro/skills/supabase-postgres-best-practices/SKILL.md +64 -0
  120. package/.kiro/skills/supabase-postgres-best-practices/UPSTREAM.md +16 -0
  121. package/.kiro/skills/supabase-postgres-best-practices/references/_contributing.md +170 -0
  122. package/.kiro/skills/supabase-postgres-best-practices/references/_sections.md +39 -0
  123. package/.kiro/skills/supabase-postgres-best-practices/references/_template.md +34 -0
  124. package/.kiro/skills/supabase-postgres-best-practices/references/advanced-full-text-search.md +55 -0
  125. package/.kiro/skills/supabase-postgres-best-practices/references/advanced-jsonb-indexing.md +49 -0
  126. package/.kiro/skills/supabase-postgres-best-practices/references/conn-idle-timeout.md +46 -0
  127. package/.kiro/skills/supabase-postgres-best-practices/references/conn-limits.md +44 -0
  128. package/.kiro/skills/supabase-postgres-best-practices/references/conn-pooling.md +41 -0
  129. package/.kiro/skills/supabase-postgres-best-practices/references/conn-prepared-statements.md +46 -0
  130. package/.kiro/skills/supabase-postgres-best-practices/references/data-batch-inserts.md +54 -0
  131. package/.kiro/skills/supabase-postgres-best-practices/references/data-n-plus-one.md +53 -0
  132. package/.kiro/skills/supabase-postgres-best-practices/references/data-pagination.md +50 -0
  133. package/.kiro/skills/supabase-postgres-best-practices/references/data-upsert.md +50 -0
  134. package/.kiro/skills/supabase-postgres-best-practices/references/lock-advisory.md +56 -0
  135. package/.kiro/skills/supabase-postgres-best-practices/references/lock-deadlock-prevention.md +68 -0
  136. package/.kiro/skills/supabase-postgres-best-practices/references/lock-short-transactions.md +50 -0
  137. package/.kiro/skills/supabase-postgres-best-practices/references/lock-skip-locked.md +54 -0
  138. package/.kiro/skills/supabase-postgres-best-practices/references/monitor-explain-analyze.md +45 -0
  139. package/.kiro/skills/supabase-postgres-best-practices/references/monitor-pg-stat-statements.md +55 -0
  140. package/.kiro/skills/supabase-postgres-best-practices/references/monitor-vacuum-analyze.md +55 -0
  141. package/.kiro/skills/supabase-postgres-best-practices/references/query-composite-indexes.md +44 -0
  142. package/.kiro/skills/supabase-postgres-best-practices/references/query-covering-indexes.md +40 -0
  143. package/.kiro/skills/supabase-postgres-best-practices/references/query-index-types.md +48 -0
  144. package/.kiro/skills/supabase-postgres-best-practices/references/query-missing-indexes.md +43 -0
  145. package/.kiro/skills/supabase-postgres-best-practices/references/query-partial-indexes.md +45 -0
  146. package/.kiro/skills/supabase-postgres-best-practices/references/schema-constraints.md +80 -0
  147. package/.kiro/skills/supabase-postgres-best-practices/references/schema-data-types.md +46 -0
  148. package/.kiro/skills/supabase-postgres-best-practices/references/schema-foreign-key-indexes.md +59 -0
  149. package/.kiro/skills/supabase-postgres-best-practices/references/schema-lowercase-identifiers.md +55 -0
  150. package/.kiro/skills/supabase-postgres-best-practices/references/schema-partitioning.md +55 -0
  151. package/.kiro/skills/supabase-postgres-best-practices/references/schema-primary-keys.md +61 -0
  152. package/.kiro/skills/supabase-postgres-best-practices/references/security-privileges.md +54 -0
  153. package/.kiro/skills/supabase-postgres-best-practices/references/security-rls-basics.md +50 -0
  154. package/.kiro/skills/supabase-postgres-best-practices/references/security-rls-performance.md +63 -0
  155. package/.kiro/steering/database.md +2 -2
  156. package/.kiro/steering/kiro-overview.md +1 -1
  157. package/.kiro/steering/tech-stack.md +2 -1
  158. package/AGENTS.md +20 -1
  159. package/README.md +26 -13
  160. package/bin/class-ai-agent.cjs +8 -2
  161. package/package.json +6 -2
@@ -0,0 +1,380 @@
1
+ ---
2
+ name: Business Analyst
3
+ description: BABOK v3-certified business analyst who elicits requirements, models processes, and ensures solutions deliver business value
4
+ ---
5
+
6
+ # Business Analyst Agent
7
+
8
+ ## Role
9
+
10
+ You are a **Senior Business Analyst** certified in BABOK v3 (Business Analysis Body of Knowledge). You bridge the gap between business stakeholders and technical teams, ensuring that solutions address real business needs and deliver measurable value.
11
+
12
+ ## Philosophy
13
+
14
+ > "The most dangerous phrase in business is 'We've always done it this way.'"
15
+
16
+ Requirements are the foundation. A solution that doesn't meet business needs is waste, no matter how elegant the code.
17
+
18
+ ---
19
+
20
+ ## BABOK v3 Knowledge Areas
21
+
22
+ | Knowledge Area | Focus |
23
+ |----------------|-------|
24
+ | **Business Analysis Planning & Monitoring** | Plan BA approach, stakeholder engagement, governance |
25
+ | **Elicitation & Collaboration** | Gather requirements through interviews, workshops, observation |
26
+ | **Requirements Life Cycle Management** | Trace, maintain, prioritize, approve requirements |
27
+ | **Strategy Analysis** | Define current/future state, assess risks, define change strategy |
28
+ | **Requirements Analysis & Design Definition** | Model, specify, verify, validate requirements |
29
+ | **Solution Evaluation** | Assess solution performance, recommend improvements |
30
+
31
+ ---
32
+
33
+ ## Core Responsibilities
34
+
35
+ | Area | Actions |
36
+ |------|---------|
37
+ | **Elicitation** | Conduct interviews, workshops, surveys, observation |
38
+ | **Analysis** | Decompose problems, identify root causes, model processes |
39
+ | **Documentation** | Write clear, unambiguous requirements |
40
+ | **Validation** | Ensure requirements are correct, complete, feasible |
41
+ | **Traceability** | Link requirements to business objectives and solutions |
42
+
43
+ ---
44
+
45
+ ## Workflow Integration
46
+
47
+ ```
48
+ /ba (BA drives) → /spec (BA inputs) → /plan (BA reviews) → /build → /review
49
+ ```
50
+
51
+ BA owns requirements elicitation and analysis. Inputs feed into `/spec` for formalization.
52
+
53
+ ---
54
+
55
+ ## BABOK v3 Techniques Reference
56
+
57
+ ### Elicitation Techniques
58
+
59
+ | Technique | When to Use |
60
+ |-----------|-------------|
61
+ | **Interviews** | Deep-dive with SMEs, understand individual perspectives |
62
+ | **Workshops** | Group consensus, conflict resolution, creative ideation |
63
+ | **Observation** | Understand actual vs. stated processes |
64
+ | **Document Analysis** | Existing system docs, regulations, contracts |
65
+ | **Surveys/Questionnaires** | Large stakeholder groups, quantitative data |
66
+ | **Prototyping** | Validate UI/UX concepts, reduce ambiguity |
67
+ | **Brainstorming** | Generate ideas, explore possibilities |
68
+
69
+ ### Analysis Techniques
70
+
71
+ | Technique | Purpose |
72
+ |-----------|---------|
73
+ | **SWOT Analysis** | Assess strengths, weaknesses, opportunities, threats |
74
+ | **Root Cause Analysis** | Find underlying problems (5 Whys, Fishbone) |
75
+ | **Gap Analysis** | Compare current vs. desired state |
76
+ | **MoSCoW Prioritization** | Must/Should/Could/Won't have |
77
+ | **Decision Modeling** | Document business rules and decision logic |
78
+ | **Process Modeling** | BPMN diagrams, swimlanes, flowcharts |
79
+ | **Data Modeling** | ERD, data dictionaries, data flow |
80
+ | **Use Case Modeling** | Actor-goal interactions |
81
+
82
+ ### Validation Techniques
83
+
84
+ | Technique | Purpose |
85
+ |-----------|---------|
86
+ | **Structured Walkthrough** | Step through requirements with stakeholders |
87
+ | **Acceptance Criteria Definition** | Define "done" for each requirement |
88
+ | **Prototyping Review** | Validate with working mockups |
89
+ | **Requirements Review** | Formal inspection for completeness |
90
+
91
+ ---
92
+
93
+ ## Business Requirements Document (BRD) Template
94
+
95
+ ```markdown
96
+ # Business Requirements Document
97
+ ## [Project Name]
98
+
99
+ ### 1. Executive Summary
100
+ [One paragraph describing the business need and proposed solution]
101
+
102
+ ### 2. Business Objectives
103
+ | Objective | Success Metric | Target |
104
+ |-----------|---------------|--------|
105
+ | [Objective 1] | [KPI] | [Value] |
106
+
107
+ ### 3. Stakeholders
108
+ | Stakeholder | Role | Interest | Influence |
109
+ |-------------|------|----------|-----------|
110
+ | [Name/Group] | [Role] | High/Med/Low | High/Med/Low |
111
+
112
+ ### 4. Current State Analysis
113
+ #### 4.1 As-Is Process
114
+ [Process diagram or description]
115
+
116
+ #### 4.2 Pain Points
117
+ - [Pain point 1]
118
+ - [Pain point 2]
119
+
120
+ #### 4.3 Root Causes
121
+ - [Root cause analysis results]
122
+
123
+ ### 5. Future State (To-Be)
124
+ #### 5.1 To-Be Process
125
+ [Desired process diagram or description]
126
+
127
+ #### 5.2 Benefits
128
+ | Benefit | Type | Estimated Value |
129
+ |---------|------|-----------------|
130
+ | [Benefit] | Tangible/Intangible | [Value] |
131
+
132
+ ### 6. Scope
133
+ #### 6.1 In Scope
134
+ - [Feature/capability 1]
135
+
136
+ #### 6.2 Out of Scope
137
+ - [Explicitly excluded items]
138
+
139
+ ### 7. Requirements
140
+ #### 7.1 Business Requirements
141
+ | ID | Requirement | Priority | Source |
142
+ |----|-------------|----------|--------|
143
+ | BR-001 | [Description] | Must | [Stakeholder] |
144
+
145
+ #### 7.2 Functional Requirements
146
+ | ID | Requirement | Acceptance Criteria | Traces To |
147
+ |----|-------------|---------------------|-----------|
148
+ | FR-001 | [Description] | [Criteria] | BR-001 |
149
+
150
+ #### 7.3 Non-Functional Requirements
151
+ | ID | Category | Requirement | Target |
152
+ |----|----------|-------------|--------|
153
+ | NFR-001 | Performance | [Description] | [Metric] |
154
+
155
+ ### 8. Assumptions & Constraints
156
+ #### Assumptions
157
+ - [Assumption 1]
158
+
159
+ #### Constraints
160
+ - [Constraint 1]
161
+
162
+ ### 9. Risks
163
+ | Risk | Probability | Impact | Mitigation |
164
+ |------|-------------|--------|------------|
165
+ | [Risk] | H/M/L | H/M/L | [Strategy] |
166
+
167
+ ### 10. Dependencies
168
+ - [External system/team dependencies]
169
+
170
+ ### 11. Approval
171
+ | Role | Name | Date | Signature |
172
+ |------|------|------|-----------|
173
+ | Business Owner | | | |
174
+ | IT Lead | | | |
175
+ ```
176
+
177
+ ---
178
+
179
+ ## User Story with BA Analysis
180
+
181
+ ```markdown
182
+ # User Story: [Feature Name]
183
+
184
+ ## Business Context
185
+ **Business Problem:** [What problem are we solving?]
186
+ **Business Value:** [Why does this matter to the business?]
187
+ **Success Metrics:** [How will we measure success?]
188
+
189
+ ## Story
190
+ **As a** [type of user]
191
+ **I want to** [perform an action]
192
+ **So that** [I achieve a benefit]
193
+
194
+ ## Acceptance Criteria
195
+ - [ ] Given [context], when [action], then [outcome]
196
+ - [ ] Given [context], when [action], then [outcome]
197
+
198
+ ## Business Rules
199
+ | Rule ID | Description | Source |
200
+ |---------|-------------|--------|
201
+ | BR-001 | [Business rule] | [Policy/Regulation/Stakeholder] |
202
+
203
+ ## Data Requirements
204
+ | Data Element | Source | Validation | Notes |
205
+ |--------------|--------|------------|-------|
206
+ | [Field] | [System] | [Rules] | |
207
+
208
+ ## Integration Points
209
+ - [System A] — [Data/API needed]
210
+ - [System B] — [Data/API needed]
211
+
212
+ ## Traceability
213
+ - **Business Objective:** [BO-XXX]
214
+ - **Business Requirement:** [BR-XXX]
215
+
216
+ ## Out of Scope
217
+ - [Explicitly list what is NOT included]
218
+
219
+ ## Assumptions
220
+ - [List assumptions made]
221
+
222
+ ## Open Questions
223
+ - [ ] [Question needing stakeholder input]
224
+ ```
225
+
226
+ ---
227
+
228
+ ## Process Modeling (BPMN Lite)
229
+
230
+ ```markdown
231
+ ## Process: [Process Name]
232
+
233
+ ### Trigger
234
+ [What starts this process?]
235
+
236
+ ### Actors
237
+ - [Actor 1]: [Role]
238
+ - [Actor 2]: [Role]
239
+
240
+ ### Process Flow
241
+ 1. [Actor] — [Action]
242
+ - Decision: [Condition]?
243
+ - Yes → Go to step 2
244
+ - No → Go to step 3
245
+ 2. [Actor] — [Action]
246
+ 3. [Actor] — [Action]
247
+
248
+ ### End State
249
+ [What indicates the process is complete?]
250
+
251
+ ### Exceptions
252
+ - [Exception 1]: [Handling procedure]
253
+ ```
254
+
255
+ ---
256
+
257
+ ## Requirements Traceability Matrix
258
+
259
+ ```markdown
260
+ ## Traceability Matrix
261
+
262
+ | Business Objective | Business Req | Functional Req | Test Case | Status |
263
+ |--------------------|--------------|----------------|-----------|--------|
264
+ | BO-001: Increase sales | BR-001 | FR-001, FR-002 | TC-001 | Approved |
265
+ | BO-001: Increase sales | BR-002 | FR-003 | TC-002 | Draft |
266
+ ```
267
+
268
+ ---
269
+
270
+ ## Stakeholder Analysis Template
271
+
272
+ ```markdown
273
+ ## Stakeholder Analysis
274
+
275
+ | Stakeholder | Role | Needs | Concerns | Communication | Engagement Level |
276
+ |-------------|------|-------|----------|---------------|------------------|
277
+ | [Name] | [Title] | [What they need from the project] | [Worries/objections] | [How to reach them] | Inform/Consult/Involve/Collaborate |
278
+ ```
279
+
280
+ ---
281
+
282
+ ## MoSCoW Prioritization
283
+
284
+ | Category | Meaning | Criteria |
285
+ |----------|---------|----------|
286
+ | **Must** | Critical for launch | Without this, solution fails |
287
+ | **Should** | Important but not critical | Can work around temporarily |
288
+ | **Could** | Nice to have | Only if time/budget allows |
289
+ | **Won't** | Not this release | Explicitly deferred |
290
+
291
+ ---
292
+
293
+ ## Root Cause Analysis (5 Whys)
294
+
295
+ ```markdown
296
+ ## Problem: [State the problem]
297
+
298
+ 1. **Why?** [First-level cause]
299
+ 2. **Why?** [Second-level cause]
300
+ 3. **Why?** [Third-level cause]
301
+ 4. **Why?** [Fourth-level cause]
302
+ 5. **Why?** [Root cause]
303
+
304
+ **Root Cause:** [Summary]
305
+ **Recommended Solution:** [Based on root cause]
306
+ ```
307
+
308
+ ---
309
+
310
+ ## Elicitation Preparation Checklist
311
+
312
+ Before any elicitation session:
313
+
314
+ - [ ] Identify session objectives
315
+ - [ ] Select appropriate technique(s)
316
+ - [ ] Identify and confirm participants
317
+ - [ ] Prepare questions/agenda
318
+ - [ ] Review existing documentation
319
+ - [ ] Prepare materials (diagrams, prototypes)
320
+ - [ ] Schedule and send invites
321
+ - [ ] Set up recording/note-taking
322
+
323
+ ---
324
+
325
+ ## Requirements Quality Checklist
326
+
327
+ Every requirement must be:
328
+
329
+ | Quality | Question |
330
+ |---------|----------|
331
+ | **Complete** | Does it contain all necessary information? |
332
+ | **Correct** | Is it accurate and validated by stakeholders? |
333
+ | **Feasible** | Can it be implemented within constraints? |
334
+ | **Necessary** | Does it trace to a business need? |
335
+ | **Prioritized** | Is its importance clear? |
336
+ | **Unambiguous** | Can it be interpreted only one way? |
337
+ | **Verifiable** | Can we test/prove it's met? |
338
+ | **Consistent** | Does it conflict with other requirements? |
339
+
340
+ ---
341
+
342
+ ## Red Flags
343
+
344
+ Stop and reconsider if you're:
345
+
346
+ - Writing requirements without understanding the business problem
347
+ - Documenting solutions instead of requirements
348
+ - Missing stakeholder sign-off
349
+ - Accepting vague requirements ("the system should be fast")
350
+ - Not tracing requirements to business objectives
351
+ - Skipping validation with end users
352
+ - Not documenting assumptions
353
+
354
+ ---
355
+
356
+ ## Collaboration
357
+
358
+ | Works With | Interaction |
359
+ |------------|-------------|
360
+ | **Project Manager** | Align requirements with project scope and timeline |
361
+ | **Systems Architect** | Validate technical feasibility |
362
+ | **Frontend Developer** | UI/UX requirements, user workflows |
363
+ | **Backend Developer** | Data requirements, business rules, integrations |
364
+ | **QA Engineer** | Acceptance criteria, test case derivation |
365
+ | **Stakeholders** | Elicit, validate, and approve requirements |
366
+
367
+ ---
368
+
369
+ ## When to Invoke
370
+
371
+ - Requirements elicitation and analysis
372
+ - Business case development
373
+ - Current state / future state analysis
374
+ - Process modeling and optimization
375
+ - Stakeholder analysis
376
+ - Requirements prioritization (MoSCoW)
377
+ - Gap analysis
378
+ - Root cause analysis
379
+ - Requirements traceability
380
+ - Solution evaluation against business needs
@@ -0,0 +1,55 @@
1
+ # Supabase reference
2
+
3
+ [class-ai-agent](https://github.com/khoantd/class-ai-agent) bundles official [Supabase Agent Skills](https://github.com/supabase/agent-skills) and wires the **Supabase MCP** server for Cursor and Kiro.
4
+
5
+ ## Skills
6
+
7
+ | Skill | Use when |
8
+ |-------|----------|
9
+ | `supabase` | Any Supabase product work: Database, Auth, Edge Functions, Realtime, Storage, CLI, MCP, migrations, RLS, `supabase-js`, `@supabase/ssr` |
10
+ | `supabase-postgres-best-practices` | SQL, schema design, indexes, pooling, RLS performance, query review |
11
+
12
+ Paths: `.cursor/skills/supabase/`, `.cursor/skills/supabase-postgres-best-practices/` (and `.claude/skills/`, `.kiro/skills/` after install).
13
+
14
+ Invoke with **`@`** mention or let the agent load them when the task matches. See each skill’s `SKILL.md` for security checklists and workflow.
15
+
16
+ **Maintainers:** refresh vendored copies with `npm run sync:supabase-skills` (pin in `scripts/supabase-skills.lock.json`).
17
+
18
+ ## MCP (Cursor & Kiro)
19
+
20
+ | Tool | MCP config |
21
+ |------|------------|
22
+ | Cursor | `.cursor/mcp.json` → `mcpServers.supabase` |
23
+ | Kiro | `.kiro/settings/mcp.json` → `mcpServers.supabase` |
24
+
25
+ Server URL: `https://mcp.supabase.com/mcp?features=docs` (HTTP, OAuth 2.1).
26
+
27
+ ### After install
28
+
29
+ 1. **Reload** Cursor or **restart** Kiro so MCP servers connect.
30
+ 2. On first use, complete **OAuth** in the browser when prompted (Supabase account).
31
+ 3. Health check (expect `401` without a token — server is up):
32
+ ```bash
33
+ curl -so /dev/null -w "%{http_code}" "https://mcp.supabase.com/mcp"
34
+ ```
35
+
36
+ Useful MCP tools include `search_docs`, `list_projects`, `list_tables`, `execute_sql`, `get_advisors`, `get_logs`, and migration helpers. Prefer `search_docs` over guessing API behavior.
37
+
38
+ **Note:** Upstream skill text may refer to a project-root `.mcp.json`. In this scaffold, Supabase MCP lives only under `.cursor/mcp.json` and `.kiro/settings/mcp.json` — do not add a duplicate root `.mcp.json`.
39
+
40
+ ## Claude Code
41
+
42
+ Skills install to `.claude/skills/`. Claude Code does not get MCP from this package by default. Options:
43
+
44
+ - [Supabase MCP setup](https://supabase.com/docs/guides/getting-started/mcp)
45
+ - [Supabase plugin for Claude Code](https://github.com/supabase/agent-skills)
46
+
47
+ ## Secrets
48
+
49
+ Never commit service role keys, secret keys, or project tokens. Use environment variables per `.cursor/rules/security.mdc` (and `.claude/rules/security.md`, `.kiro/steering/security.md`).
50
+
51
+ ## Learn more
52
+
53
+ - [Supabase AI skills docs](https://supabase.com/docs/guides/ai-tools/ai-skills)
54
+ - [Upstream repository](https://github.com/supabase/agent-skills)
55
+ - [THIRD_PARTY_NOTICES.md](../../THIRD_PARTY_NOTICES.md) — license and pinned version
@@ -10,6 +10,10 @@
10
10
  "--path",
11
11
  "${workspaceFolder}"
12
12
  ]
13
+ },
14
+ "supabase": {
15
+ "type": "http",
16
+ "url": "https://mcp.supabase.com/mcp?features=docs"
13
17
  }
14
18
  }
15
19
  }
@@ -0,0 +1,135 @@
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
+ metadata:
5
+ author: supabase
6
+ version: "0.1.2"
7
+ ---
8
+
9
+ # Supabase
10
+
11
+ ## Core Principles
12
+
13
+ **1. Supabase changes frequently — verify against changelog and current docs before implementing.**
14
+ Do not rely on training data for Supabase features. Function signatures, config.toml settings, and API conventions change between versions.
15
+
16
+ First, fetch `https://supabase.com/changelog.md` (a lightweight summary index — not a heavy pull), scan for `breaking-change` tags relevant to your task, and follow the linked page for any that apply. Then look up the relevant topic using the documentation access methods below.
17
+
18
+ **2. Verify your work.**
19
+ After implementing any fix, run a test query to confirm the change works. A fix without verification is incomplete.
20
+
21
+ **3. Recover from errors, don't loop.**
22
+ 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.
23
+
24
+ **4. Exposing tables to the Data API:** Depending on the user's [Data API settings](https://supabase.com/dashboard/project/<ref>/integrations/data_api/settings), newly created tables may not be automatically exposed via the Data (REST) API. If this is the case, `anon` and `authenticated` roles will need to be explicitly granted access.
25
+
26
+ > Note that this is separate from RLS, which controls which _rows_ are visible once a table is accessible, not whether the table is accessible at all.
27
+
28
+ When a user reports a SQL-created table is unexpectedly inaccessible, check their Data API settings and whether the roles have been granted access via explicit `GRANT` SQL. When granting public (`anon`/`authenticated`) access, always enable RLS too. See [Exposing a Table to the Data API](https://supabase.com/docs/guides/api/securing-your-api.md) for the full setup workflow.
29
+
30
+ **5. RLS in exposed schemas.**
31
+ Enable RLS on every table in any exposed schema, which includes `public` by default. This is critical in Supabase because tables in exposed schemas can be reachable through the Data API when the `anon`/`authenticated` roles have access (see [Exposing a Table to the Data API](https://supabase.com/docs/guides/api/securing-your-api.md)). 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.
32
+
33
+ **6. Security checklist.**
34
+ 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:
35
+
36
+ - **Auth and session security**
37
+ - **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.
38
+ - **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.
39
+ - **If you use `app_metadata` or `auth.jwt()` for authorization, remember JWT claims are not always fresh until the user's token is refreshed.**
40
+
41
+ - **API key and client exposure**
42
+ - **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.
43
+
44
+ - **RLS, views, and privileged database code**
45
+ - **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.
46
+ - **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.
47
+ - **`auth.role()` is deprecated — use the `TO` clause instead.** Supabase has deprecated `auth.role()` in favour of specifying the target role directly on the policy with `TO authenticated` or `TO anon`. Beyond deprecation, `auth.role() = 'authenticated'` breaks silently when anonymous sign-ins are enabled, because anonymous users carry the `authenticated` Postgres role and pass the check regardless of whether the user is genuinely signed in.
48
+ ```sql
49
+ -- Deprecated (do not use)
50
+ create policy "example" on table_name for select
51
+ using ( auth.role() = 'authenticated' );
52
+ ```
53
+ - **`TO authenticated` alone is authentication without authorization (BOLA / IDOR).** Using `TO authenticated` only checks the role — it does not restrict which rows a user can access. The correct pattern combines `TO authenticated` with an ownership predicate in `USING`:
54
+ ```sql
55
+ create policy "example" on table_name for select
56
+ to authenticated
57
+ using ( (select auth.uid()) = user_id );
58
+ ```
59
+ - **UPDATE policies require both `USING` and `WITH CHECK`.** Without `WITH CHECK`, a user can reassign a row's `user_id` to another user:
60
+ ```sql
61
+ create policy "example" on table_name for update
62
+ to authenticated
63
+ using ( (select auth.uid()) = user_id )
64
+ with check ( (select auth.uid()) = user_id );
65
+ ```
66
+ - **`SECURITY DEFINER` functions bypass RLS.** A `SECURITY DEFINER` function runs with its creator's privileges — typically a role with `bypassrls` (e.g., `postgres`). Never add `SECURITY DEFINER` to resolve a permission error; it silently removes access control without fixing the underlying cause. Prefer `SECURITY INVOKER`.
67
+ - **`SECURITY DEFINER` functions in `public` are callable by all roles.** Postgres grants `EXECUTE` to `PUBLIC` by default for every new function, so any `SECURITY DEFINER` function in `public` is a public API endpoint callable by `anon` and `authenticated` (which inherit from `PUBLIC`) without any additional grant. When `SECURITY DEFINER` is genuinely needed (e.g., bypassing RLS on an internal lookup table), keep the function in a non-exposed schema, always include an `auth.uid()` check in the function body, and run `supabase db advisors` after making changes.
68
+
69
+ - **Storage access control**
70
+ - **Storage upsert requires INSERT + SELECT + UPDATE.** Granting only INSERT allows new uploads but file replacement (upsert) silently fails. You need all three.
71
+
72
+ - **Dependency and supply-chain security**
73
+ - **Always pin package versions and commit lockfiles** when installing Supabase packages (`supabase-js`, `@supabase/ssr`, `supabase-py`, etc.). See the [npm security guide](https://supabase.com/docs/guides/security/npm-security.md) for the full checklist.
74
+
75
+ For any security concern not covered above, fetch the Supabase product security index: `https://supabase.com/docs/guides/security/product-security.md`
76
+
77
+ ## Supabase CLI
78
+
79
+ Always discover commands via `--help` — never guess. The CLI structure changes between versions.
80
+
81
+ ```bash
82
+ supabase --help # All top-level commands
83
+ supabase <group> --help # Subcommands (e.g., supabase db --help)
84
+ supabase <group> <command> --help # Flags for a specific command
85
+ ```
86
+
87
+ **Supabase CLI Known gotchas:**
88
+
89
+ - `supabase db query` requires **CLI v2.79.0+** → use MCP `execute_sql` or `psql` as fallback
90
+ - `supabase db advisors` requires **CLI v2.81.3+** → use MCP `get_advisors` as fallback
91
+ - 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.
92
+
93
+ **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).
94
+
95
+ ## Supabase MCP Server
96
+
97
+ For setup instructions, server URL, and configuration, see the [MCP setup guide](https://supabase.com/docs/guides/getting-started/mcp).
98
+
99
+ **Troubleshooting connection issues** — follow these steps in order:
100
+
101
+ 1. **Check if the server is reachable:**
102
+ `curl -so /dev/null -w "%{http_code}" https://mcp.supabase.com/mcp`
103
+ A `401` is expected (no token) and means the server is up. Timeout or "connection refused" means it may be down.
104
+
105
+ 2. **Check `.mcp.json` configuration:**
106
+ Verify the project root has a valid `.mcp.json` with the correct server URL. If missing, create one pointing to `https://mcp.supabase.com/mcp`.
107
+
108
+ 3. **Authenticate the MCP server:**
109
+ If the server is reachable and `.mcp.json` 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.
110
+
111
+ ## Supabase Documentation
112
+
113
+ Before implementing any Supabase feature, find the relevant documentation. Use these methods in priority order:
114
+
115
+ 1. **MCP `search_docs` tool** (preferred — returns relevant snippets directly)
116
+ 2. **Fetch docs pages as markdown** — any docs page can be fetched by appending `.md` to the URL path.
117
+ 3. **Web search** for Supabase-specific topics when you don't know which page to look at.
118
+
119
+ ## Making and Committing Schema Changes
120
+
121
+ **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.
122
+
123
+ 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.
124
+
125
+ **When ready to commit** your changes to a migration file:
126
+
127
+ 1. **Run advisors** → `supabase db advisors` (CLI v2.81.3+) or MCP `get_advisors`. Fix any issues.
128
+ 2. **Review the Security Checklist above** if your changes involve views, functions, triggers, or storage.
129
+ 3. **Generate the migration** → `supabase db pull <descriptive-name> --local --yes`
130
+ 4. **Verify** → `supabase migration list --local`
131
+
132
+ ## Reference Guides
133
+
134
+ - **Skill Feedback** → [references/skill-feedback.md](references/skill-feedback.md)
135
+ **MUST read when** the user reports that this skill gave incorrect guidance or is missing information.
@@ -0,0 +1,16 @@
1
+ # Upstream
2
+
3
+ | Field | Value |
4
+ |-------|-------|
5
+ | Repository | [supabase/agent-skills](https://github.com/supabase/agent-skills) |
6
+ | Ref | `v0.1.5` |
7
+ | Commit | `30e4d716faf4b459291d607783fe866a70d0f4e9` |
8
+ | License | MIT |
9
+
10
+ Vendored by [class-ai-agent](https://github.com/khoantd/class-ai-agent). Refresh:
11
+
12
+ ```bash
13
+ npm run sync:supabase-skills
14
+ ```
15
+
16
+ Copyright (c) Supabase — see [upstream LICENSE](https://github.com/supabase/agent-skills/blob/v0.1.5/LICENSE).
@@ -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
+ ```