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.
Files changed (174) hide show
  1. package/dist/index.js +3 -63
  2. package/package.json +1 -1
  3. package/template/.claude/agents/backend.md +54 -0
  4. package/template/.claude/agents/business-analyst.md +195 -0
  5. package/template/.claude/agents/code-reviewer.md +76 -0
  6. package/template/.claude/agents/frontend.md +85 -0
  7. package/template/.claude/agents/security-researcher.md +54 -0
  8. package/template/.claude/agents/technical-lead.md +92 -0
  9. package/template/.claude/agents/test-qa.md +85 -0
  10. package/template/.claude/rules/architecture.mdc +48 -0
  11. package/template/.claude/rules/coding-standards.mdc +120 -0
  12. package/template/.claude/rules/components.mdc +49 -0
  13. package/template/.claude/rules/data-fetching.mdc +115 -0
  14. package/template/.claude/rules/forms.mdc +100 -0
  15. package/template/.claude/rules/general.mdc +54 -0
  16. package/template/.claude/rules/migrations.mdc +11 -0
  17. package/template/.claude/rules/nextjs.mdc +71 -0
  18. package/template/.claude/rules/security.mdc +108 -0
  19. package/template/.claude/rules/supabase.mdc +70 -0
  20. package/template/.claude/rules/testing.mdc +136 -0
  21. package/template/.claude/settings.json +16 -0
  22. package/template/.claude/skills/build-feature/SKILL.md +198 -0
  23. package/template/.claude/skills/build-feature/references/server-action-test-template.md +103 -0
  24. package/template/.claude/skills/create-api-route/SKILL.md +62 -0
  25. package/template/.claude/skills/discover-feature/SKILL.md +200 -0
  26. package/template/.claude/skills/memory/SKILL.md +208 -0
  27. package/template/.claude/skills/review-branch/SKILL.md +43 -0
  28. package/template/.claude/skills/review-branch/references/review-checklist.md +36 -0
  29. package/template/.claude/skills/security-audit/SKILL.md +40 -0
  30. package/template/.claude/skills/security-audit/references/audit-steps.md +41 -0
  31. package/template/.claude/skills/supabase/SKILL.md +105 -0
  32. package/template/.claude/skills/supabase/assets/feedback-issue-template.md +17 -0
  33. package/template/.claude/skills/supabase/references/skill-feedback.md +17 -0
  34. package/template/.claude/skills/supabase-postgres-best-practices/SKILL.md +65 -0
  35. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp__contributing.md +170 -0
  36. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp__sections.md +39 -0
  37. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp__template.md +34 -0
  38. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_advanced-full-text-search.md +55 -0
  39. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_advanced-jsonb-indexing.md +49 -0
  40. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_conn-idle-timeout.md +46 -0
  41. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_conn-limits.md +44 -0
  42. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_conn-pooling.md +41 -0
  43. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_conn-prepared-statements.md +46 -0
  44. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_data-batch-inserts.md +54 -0
  45. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_data-n-plus-one.md +53 -0
  46. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_data-pagination.md +50 -0
  47. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_data-upsert.md +50 -0
  48. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_lock-advisory.md +56 -0
  49. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_lock-deadlock-prevention.md +68 -0
  50. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_lock-short-transactions.md +50 -0
  51. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_lock-skip-locked.md +54 -0
  52. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_monitor-explain-analyze.md +45 -0
  53. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_monitor-pg-stat-statements.md +55 -0
  54. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_monitor-vacuum-analyze.md +55 -0
  55. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_query-composite-indexes.md +44 -0
  56. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_query-covering-indexes.md +40 -0
  57. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_query-index-types.md +48 -0
  58. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_query-missing-indexes.md +43 -0
  59. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_query-partial-indexes.md +45 -0
  60. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_schema-constraints.md +80 -0
  61. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_schema-data-types.md +46 -0
  62. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_schema-foreign-key-indexes.md +59 -0
  63. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_schema-lowercase-identifiers.md +55 -0
  64. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_schema-partitioning.md +55 -0
  65. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_schema-primary-keys.md +61 -0
  66. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_security-privileges.md +54 -0
  67. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_security-rls-basics.md +50 -0
  68. package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_security-rls-performance.md +57 -0
  69. package/template/.cursor/agents/business-analyst.md +197 -0
  70. package/template/.cursor/agents/technical-lead.md +3 -3
  71. package/template/.cursor/mcp.json +6 -2
  72. package/template/.cursor/skills/build-feature/SKILL.md +20 -21
  73. package/template/.cursor/skills/discover-feature/SKILL.md +118 -29
  74. package/template/.cursor/skills/supabase/SKILL.md +104 -0
  75. package/template/.cursor/skills/supabase/assets/feedback-issue-template.md +17 -0
  76. package/template/.cursor/skills/supabase/references/skill-feedback.md +17 -0
  77. package/template/.cursor/skills/supabase-postgres-best-practices/SKILL.md +64 -0
  78. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp__contributing.md +170 -0
  79. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp__sections.md +39 -0
  80. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp__template.md +34 -0
  81. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_advanced-full-text-search.md +55 -0
  82. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_advanced-jsonb-indexing.md +49 -0
  83. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_conn-idle-timeout.md +46 -0
  84. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_conn-limits.md +44 -0
  85. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_conn-pooling.md +41 -0
  86. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_conn-prepared-statements.md +46 -0
  87. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_data-batch-inserts.md +54 -0
  88. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_data-n-plus-one.md +53 -0
  89. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_data-pagination.md +50 -0
  90. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_data-upsert.md +50 -0
  91. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_lock-advisory.md +56 -0
  92. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_lock-deadlock-prevention.md +68 -0
  93. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_lock-short-transactions.md +50 -0
  94. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_lock-skip-locked.md +54 -0
  95. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_monitor-explain-analyze.md +45 -0
  96. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_monitor-pg-stat-statements.md +55 -0
  97. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_monitor-vacuum-analyze.md +55 -0
  98. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_query-composite-indexes.md +44 -0
  99. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_query-covering-indexes.md +40 -0
  100. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_query-index-types.md +48 -0
  101. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_query-missing-indexes.md +43 -0
  102. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_query-partial-indexes.md +45 -0
  103. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_schema-constraints.md +80 -0
  104. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_schema-data-types.md +46 -0
  105. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_schema-foreign-key-indexes.md +59 -0
  106. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_schema-lowercase-identifiers.md +55 -0
  107. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_schema-partitioning.md +55 -0
  108. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_schema-primary-keys.md +61 -0
  109. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_security-privileges.md +54 -0
  110. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_security-rls-basics.md +50 -0
  111. package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_security-rls-performance.md +57 -0
  112. package/template/.mcp.json +16 -0
  113. package/template/.opencode/agents/backend.md +72 -0
  114. package/template/.opencode/agents/business-analyst.md +153 -0
  115. package/template/.opencode/agents/code-reviewer.md +80 -0
  116. package/template/.opencode/agents/frontend.md +84 -0
  117. package/template/.opencode/agents/security-researcher.md +58 -0
  118. package/template/.opencode/agents/technical-lead.md +131 -0
  119. package/template/.opencode/agents/test-qa.md +103 -0
  120. package/template/.opencode/memory/architecture-snapshot.md +127 -0
  121. package/template/.opencode/skills/build-feature/SKILL.md +208 -0
  122. package/template/.opencode/skills/create-api-route/SKILL.md +63 -0
  123. package/template/.opencode/skills/discover-feature/SKILL.md +194 -0
  124. package/template/.opencode/skills/memory/SKILL.md +199 -0
  125. package/template/.opencode/skills/review-branch/SKILL.md +43 -0
  126. package/template/.opencode/skills/security-audit/SKILL.md +40 -0
  127. package/template/.opencode/skills/supabase/SKILL.md +105 -0
  128. package/template/.opencode/skills/supabase/assets/feedback-issue-template.md +17 -0
  129. package/template/.opencode/skills/supabase/references/skill-feedback.md +17 -0
  130. package/template/.opencode/skills/supabase-postgres-best-practices/SKILL.md +65 -0
  131. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp__contributing.md +170 -0
  132. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp__sections.md +39 -0
  133. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp__template.md +34 -0
  134. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_advanced-full-text-search.md +55 -0
  135. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_advanced-jsonb-indexing.md +49 -0
  136. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_conn-idle-timeout.md +46 -0
  137. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_conn-limits.md +44 -0
  138. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_conn-pooling.md +41 -0
  139. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_conn-prepared-statements.md +46 -0
  140. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_data-batch-inserts.md +54 -0
  141. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_data-n-plus-one.md +53 -0
  142. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_data-pagination.md +50 -0
  143. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_data-upsert.md +50 -0
  144. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_lock-advisory.md +56 -0
  145. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_lock-deadlock-prevention.md +68 -0
  146. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_lock-short-transactions.md +50 -0
  147. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_lock-skip-locked.md +54 -0
  148. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_monitor-explain-analyze.md +45 -0
  149. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_monitor-pg-stat-statements.md +55 -0
  150. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_monitor-vacuum-analyze.md +55 -0
  151. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_query-composite-indexes.md +44 -0
  152. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_query-covering-indexes.md +40 -0
  153. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_query-index-types.md +48 -0
  154. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_query-missing-indexes.md +43 -0
  155. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_query-partial-indexes.md +45 -0
  156. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_schema-constraints.md +80 -0
  157. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_schema-data-types.md +46 -0
  158. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_schema-foreign-key-indexes.md +59 -0
  159. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_schema-lowercase-identifiers.md +55 -0
  160. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_schema-partitioning.md +55 -0
  161. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_schema-primary-keys.md +61 -0
  162. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_security-privileges.md +54 -0
  163. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_security-rls-basics.md +50 -0
  164. package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_security-rls-performance.md +57 -0
  165. package/template/.requirements/README.md +1 -1
  166. package/template/AGENTS.md +1 -1
  167. package/template/CLAUDE.md +1 -1
  168. package/template/Dockerfile.memory +7 -0
  169. package/template/README.md +15 -2
  170. package/template/_gitignore +3 -0
  171. package/template/docker-compose.yml +28 -0
  172. package/template/ia-flow.md +341 -0
  173. package/template/opencode.json +23 -0
  174. package/template/.cursor/agents/business-intelligence.md +0 -83
@@ -0,0 +1,57 @@
1
+ ---
2
+ title: Optimize RLS Policies for Performance
3
+ impact: HIGH
4
+ impactDescription: 5-10x faster RLS queries with proper patterns
5
+ tags: rls, performance, security, optimization
6
+ ---
7
+
8
+ ## Optimize RLS Policies for Performance
9
+
10
+ Poorly written RLS policies can cause severe performance issues. Use subqueries and indexes strategically.
11
+
12
+ **Incorrect (function called for every row):**
13
+
14
+ ```sql
15
+ create policy orders_policy on orders
16
+ using (auth.uid() = user_id); -- auth.uid() called per row!
17
+
18
+ -- With 1M rows, auth.uid() is called 1M times
19
+ ```
20
+
21
+ **Correct (wrap functions in SELECT):**
22
+
23
+ ```sql
24
+ create policy orders_policy on orders
25
+ using ((select auth.uid()) = user_id); -- Called once, cached
26
+
27
+ -- 100x+ faster on large tables
28
+ ```
29
+
30
+ Use security definer functions for complex checks:
31
+
32
+ ```sql
33
+ -- Create helper function (runs as definer, bypasses RLS)
34
+ create or replace function is_team_member(team_id bigint)
35
+ returns boolean
36
+ language sql
37
+ security definer
38
+ set search_path = ''
39
+ as $$
40
+ select exists (
41
+ select 1 from public.team_members
42
+ where team_id = $1 and user_id = (select auth.uid())
43
+ );
44
+ $$;
45
+
46
+ -- Use in policy (indexed lookup, not per-row check)
47
+ create policy team_orders_policy on orders
48
+ using ((select is_team_member(team_id)));
49
+ ```
50
+
51
+ Always add indexes on columns used in RLS policies:
52
+
53
+ ```sql
54
+ create index orders_user_id_idx on orders (user_id);
55
+ ```
56
+
57
+ Reference: [RLS Performance](https://supabase.com/docs/guides/database/postgres/row-level-security#rls-performance-recommendations)
@@ -0,0 +1,197 @@
1
+ ---
2
+ name: business-analyst
3
+ description: Business Analyst — discovers requirements through user questions, then collaborates with Technical Lead to produce a combined plan with Functional Tasks + Technical Tasks. Triggers: new feature definition, writing requirements, user stories, acceptance criteria, requirements documentation, feature scope clarification.
4
+ model: inherit
5
+ readonly: true
6
+ ---
7
+
8
+ # Business Analyst Agent
9
+
10
+ ## Role & Collaboration Model
11
+
12
+ The BA owns **what** to build. The Technical Lead owns **how** to build it.
13
+
14
+ Workflow:
15
+ 1. BA asks discovery questions → drafts functional spec
16
+ 2. BA explicitly invites `@technical-lead` to assess technical complexity
17
+ 3. TL reviews codebase, reports complexity back to BA
18
+ 4. BA + TL jointly produce a combined plan with two task lists:
19
+ - **Functional Tasks** — user-visible behavior, acceptance criteria, test cases (BA-owned)
20
+ - **Technical Tasks** — implementation breakdown with parallel groups A/B/C (TL-owned)
21
+ 5. Plan written to `.requirements/{feature-name}-{timestamp}.md`
22
+
23
+ ---
24
+
25
+ ## Step 1 — Load Context via MCP Memory
26
+
27
+ 1. Read `package.json` → get `<project-name>`
28
+ 2. Call `search_memory` with `tags: ["project:<project-name>", "domain:features"]`
29
+ 3. **Fallback**: if memory unavailable, read `.cursor/memory/architecture-snapshot.md` → "Existing Features" section
30
+
31
+ ---
32
+
33
+ ## Step 2 — Discovery Questions
34
+
35
+ Never assume requirements. Ask ALL of the following before writing anything.
36
+
37
+ 1. **Problem & audience** — "What problem does this solve? Who experiences it?"
38
+ 2. **User flows** — "Walk me through the happy path. What happens on error?"
39
+ 3. **Edge cases & constraints** — "What are the limits? What should NOT happen?"
40
+ 4. **Field constraints** — "Length limits, allowed formats, required vs optional fields?"
41
+ 5. **Volume & scale** — "How many records? Do you need search or pagination?"
42
+ 6. **File/upload specifics** — (if applicable) "What file types and size limits are allowed?"
43
+ 7. **Privacy & access** — "Who can see this data? Per-user or shared?"
44
+ 8. **Relationship to existing features** — (informed by MCP results) "Does this link to existing data?"
45
+ 9. **Confirm understanding** — Restate what you heard and ask for explicit approval
46
+
47
+ **Minimum gate:** Cover at least items 1–3 + any relevant ones from 4–8.
48
+
49
+ If the user says "just do it" without answering, document all assumptions in an `## Assumptions` section.
50
+
51
+ ---
52
+
53
+ ## Step 3 — Write Draft Functional Spec
54
+
55
+ Only after the user confirms your understanding:
56
+
57
+ ```markdown
58
+ ## Feature: [Feature Name]
59
+
60
+ ### User Story
61
+ As a [user type], I want [goal] so that [reason].
62
+
63
+ ### Acceptance Criteria
64
+ - [ ] AC1: When [user does X], they see [Y]
65
+ - [ ] AC2: When [error condition], user sees [message/state]
66
+ - [ ] AC3: [Edge case]: [expected outcome]
67
+
68
+ ### Functional Test Cases
69
+ - [ ] TC1 (AC1): User does X → sees Y (happy path)
70
+ - [ ] TC2 (AC2): User triggers error → sees error message
71
+ - [ ] TC3 (AC3): Edge case behavior
72
+ ```
73
+
74
+ **Rules:**
75
+ - Acceptance criteria in plain functional language — no code, no implementation details
76
+ - Test cases describe what the **user sees**, not system internals
77
+ - Every AC maps to at least one test case
78
+ - No database tables, API calls, component names, or file paths
79
+
80
+ ---
81
+
82
+ ## Step 4 — Invite Technical Lead for Complexity Assessment
83
+
84
+ Once the draft spec is ready, explicitly call:
85
+
86
+ > `@technical-lead` — please review the draft spec above and the codebase, then report back:
87
+ > 1. What existing patterns/components/schemas apply to this feature?
88
+ > 2. What is the implementation complexity (S/M/L) and why?
89
+ > 3. Are there any technical constraints or risks the spec should mention?
90
+ > 4. Break down the technical tasks needed, grouped into parallel execution groups (A runs first, B runs in parallel after A, etc.)
91
+
92
+ **Wait for TL's response before proceeding.**
93
+
94
+ ---
95
+
96
+ ## Step 5 — Produce Combined Plan
97
+
98
+ After TL responds, merge both perspectives into the final plan file:
99
+
100
+ **Filename**: `.requirements/{feature-name}-{YYYY-MM-DD-HHmm}.md`
101
+
102
+ ```markdown
103
+ # Feature: [Feature Name]
104
+ > Created: {timestamp} | Status: ready-to-build
105
+
106
+ ## Context
107
+ [One paragraph: what problem this solves, who it's for, why now]
108
+
109
+ ## Assumptions
110
+ [List any assumptions made when user skipped discovery questions — empty if none]
111
+
112
+ ---
113
+
114
+ ## Functional Task List (BA-owned)
115
+
116
+ ### User Story
117
+ As a [user type], I want [goal] so that [reason].
118
+
119
+ ### Acceptance Criteria
120
+ - [ ] AC1: ...
121
+ - [ ] AC2: ...
122
+ - [ ] AC3: ...
123
+
124
+ ### Functional Test Cases
125
+ - [ ] TC1 (AC1): ...
126
+ - [ ] TC2 (AC2): ...
127
+ - [ ] TC3 (AC3): ...
128
+
129
+ ---
130
+
131
+ ## Technical Task List (TL-owned)
132
+
133
+ ### Complexity Assessment
134
+ [S/M/L with rationale from TL]
135
+
136
+ ### Parallel Execution Plan
137
+
138
+ #### Group A — Foundation (runs first, no dependencies)
139
+ - [ ] A1: [task — assigned agent: @backend/@frontend]
140
+ - [ ] A2: [task — assigned agent: @backend]
141
+
142
+ #### Group B — Feature Logic (runs after Group A, backend+frontend in parallel)
143
+ - [ ] B1: [task — assigned agent: @backend]
144
+ - [ ] B2: [task — assigned agent: @frontend]
145
+
146
+ #### Group C — Integration & Polish (runs after Group B)
147
+ - [ ] C1: [task — assigned agent: @test-qa]
148
+ - [ ] C2: [task — assigned agent: @frontend]
149
+
150
+ ### Review Gate (runs after all groups complete, in parallel)
151
+ - [ ] R1: @code-reviewer — full diff review
152
+ - [ ] R2: @security-researcher — auth, RLS, input validation
153
+
154
+ ### Architecture Sync
155
+ - [ ] Update `.cursor/memory/architecture-snapshot.md` (new tables, components, features)
156
+ - [ ] Run `/memory sync`
157
+ ```
158
+
159
+ ---
160
+
161
+ ## Step 6 — Store in MCP Memory
162
+
163
+ ```
164
+ store_memory({
165
+ content: "Requirement: <feature-name> — <one-line summary of what the feature does and key ACs>",
166
+ metadata: {
167
+ type: "architecture",
168
+ tags: ["project:<project-name>", "domain:features", "category:requirement", "feature:<feature-name>", "status:pending-snapshot"]
169
+ }
170
+ })
171
+ ```
172
+
173
+ ---
174
+
175
+ ## Step 7 — Hand Off
176
+
177
+ Tell the user:
178
+
179
+ > Plan written to `.requirements/<feature-name>-<timestamp>.md`.
180
+ >
181
+ > **Next step**: Start a **fresh conversation** and run:
182
+ > ```
183
+ > /build-feature @.requirements/<feature-name>-<timestamp>.md
184
+ > ```
185
+
186
+ ---
187
+
188
+ ## Language
189
+
190
+ Write requirements in the user's language. Keep `AC1`, `TC1`, Group labels, and technical terms in English. Specify that all code-level text (test descriptions, variable names) must be in English — only user-visible strings in the target language.
191
+
192
+ ## Guardrails
193
+ - Always ask questions before writing — never assume
194
+ - NEVER create technical implementation tasks alone — that is the TL's job
195
+ - NEVER start implementation in this conversation
196
+ - Document all assumptions when user skips discovery
197
+ - Flag ambiguous requirements — ask rather than guess
@@ -35,7 +35,7 @@ Delegate to the appropriate specialist based on domain:
35
35
  |---|---|
36
36
  | @frontend | UI components, pages, layouts, Tailwind, shadcn/ui, accessibility |
37
37
  | @backend | Server Actions, API routes, Supabase RLS, Drizzle schema, migrations |
38
- | @business-intelligence | Requirements definition, user stories, acceptance criteria |
38
+ | @business-analyst | Requirements definition, user stories, acceptance criteria |
39
39
  | @test-qa | Writing tests, TDD workflow, coverage enforcement |
40
40
  | @code-reviewer | Branch/PR review (readonly) |
41
41
  | @security-researcher | Security audits, vulnerability scanning (readonly) |
@@ -43,7 +43,7 @@ Delegate to the appropriate specialist based on domain:
43
43
  ## Delegation Rules
44
44
 
45
45
  - **Single-domain** → delegate to the matching agent
46
- - **Cross-domain** → launch multiple agents in parallel (e.g., a new feature needs @business-intelligence for requirements + @backend for API + @frontend for UI)
46
+ - **Cross-domain** → launch multiple agents in parallel (e.g., a new feature needs @business-analyst for requirements + @backend for API + @frontend for UI)
47
47
  - Always delegate code review to @code-reviewer — do not duplicate its checklist here
48
48
  - Always delegate security audits to @security-researcher
49
49
  - The @technical-lead retains final say on all architectural decisions
@@ -61,7 +61,7 @@ Delegate to the appropriate specialist based on domain:
61
61
 
62
62
  ## Task Breakdown (New Feature)
63
63
 
64
- When you receive a functional issue from @business-intelligence, do this before delegating:
64
+ When you receive a functional issue from @business-analyst, do this before delegating:
65
65
 
66
66
  1. **Read the functional issue** — understand acceptance criteria and user flows
67
67
  2. **Split into technical tasks** — one task per agent, scoped to a single concern
@@ -1,12 +1,16 @@
1
1
  {
2
2
  "mcpServers": {
3
3
  "memory": {
4
- "command": "memory",
5
- "args": ["server"]
4
+ "type": "http",
5
+ "url": "http://localhost:8765/mcp"
6
6
  },
7
7
  "shadcn": {
8
8
  "command": "npx",
9
9
  "args": ["shadcn@latest", "mcp"]
10
+ },
11
+ "supabase": {
12
+ "type": "http",
13
+ "url": "https://mcp.supabase.com/mcp?features=docs"
10
14
  }
11
15
  }
12
16
  }
@@ -20,7 +20,10 @@ If context usage exceeds 60% at any point, stop and tell the user to continue in
20
20
 
21
21
  ### 1. Read the Requirements
22
22
 
23
- Read `.requirements/<feature-name>.md`. Confirm the spec exists and has acceptance criteria before proceeding. If no spec exists, tell the user to run `/discover-feature <description>` first.
23
+ Read `.requirements/<feature-name>-<timestamp>.md`. Confirm the file exists and contains both a **Functional Task List** (with acceptance criteria) and a **Technical Task List** (with Parallel Execution Plan groups A/B/C) before proceeding.
24
+
25
+ - If no spec exists → tell the user to run `/discover-feature <description>` first
26
+ - If the file only has functional tasks (old format) → invoke `@technical-lead` to produce the Technical Task List before continuing
24
27
 
25
28
  ### 2. Load Architecture Context via MCP Memory
26
29
 
@@ -45,29 +48,21 @@ pnpm typecheck # Confirm baseline passes — fix pre-existing errors firs
45
48
 
46
49
  ### 3. Planning (Tech Lead)
47
50
 
48
- Before any code is written, produce a technical plan and get user approval.
49
-
50
- Using the requirements + MCP memory context:
51
-
52
- 1. **Map acceptance criteria to technical tasks** — one task per agent, scoped to a single concern:
53
- - Backend tasks: schema changes, Server Actions, queries, RLS policies
54
- - Frontend tasks: components, pages, hooks, shadcn installs
55
- - Shared: Zod schemas, type definitions
56
-
57
- 2. **Plan the test structure**:
58
- - List which test files will be created
59
- - One `describe` block per acceptance criterion
60
- - Which mocks are needed (`makeSupabaseMock`, HTTP mocks, etc.)
61
- - Which edge cases map to which criteria
51
+ The requirements file already contains a Technical Task List with parallel execution groups produced during `/discover-feature`. The TL should:
62
52
 
63
- 3. **Identify reuse**:
64
- - Which canonical patterns to copy (from MCP memory results)
53
+ 1. **Read the Parallel Execution Plan** from the requirements file (Groups A/B/C + Review Gate)
54
+ 2. **Verify it against current codebase state** — confirm that referenced patterns, schemas, and components still exist
55
+ 3. **Identify reuse** from MCP memory:
56
+ - Which canonical patterns to copy
65
57
  - Which shadcn components are already installed vs need installing
66
58
  - Which shared utilities apply (`formFieldText`, `firstZodIssueMessage`, etc.)
59
+ 4. **Plan the test structure**:
60
+ - One `describe` block per acceptance criterion
61
+ - Which mocks are needed (`makeSupabaseMock`, HTTP mocks, etc.)
62
+ - Which edge cases map to which test cases from the Functional Task List
63
+ 5. **Present a brief implementation summary to the user** and wait for approval before proceeding to Step 4.
67
64
 
68
- 4. **Present the plan to the user** and wait for approval before proceeding to Step 4.
69
-
70
- > Present as a brief summary: what backend will do, what frontend will do, which tests will be written, any risks or decisions that need user input.
65
+ > Summary should cover: execution order (which groups run in parallel), which files will be created/modified, any risks or deviations from the plan.
71
66
 
72
67
  ### 4. Create Feature Structure
73
68
 
@@ -116,7 +111,11 @@ Run `pnpm test:unit` and paste the output. All new tests must **FAIL** (red). If
116
111
 
117
112
  ### 7. TDD: GREEN Phase
118
113
 
119
- Launch **@backend and @frontend in parallel** they work on independent files:
114
+ Follow the **Parallel Execution Plan** from the requirements file. Launch agents per group:
115
+
116
+ - **Group A**: run first (foundation — schema, shared types)
117
+ - **Group B**: launch **@backend and @frontend in parallel** after Group A completes
118
+ - **Group C**: run after Group B (integration, polish)
120
119
 
121
120
  | @backend handles | @frontend handles |
122
121
  |-----------------|-------------------|
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: discover-feature
3
- description: Run the requirements discovery process for a new feature. Produces a functional issue in .requirements/<feature-name>.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).
3
+ description: Run the BA+TL requirements discovery process for a new feature. BA asks questions, then collaborates with Technical Lead to produce a combined plan (Functional Tasks + Technical Tasks) in .requirements/<feature-name>-<timestamp>.md. Use this in Conversation 1, then start a new conversation and run /build-feature. Triggers: 'new feature', 'define requirements', 'discover feature', 'I want to build'. NOT for: already-defined features (use /build-feature directly).
4
4
  ---
5
5
 
6
6
  # Discover Feature Skill
@@ -16,33 +16,35 @@ This conversation is for requirements only. Do NOT start implementation here. Wh
16
16
 
17
17
  ## Process
18
18
 
19
- ### 1. Load Existing Features via MCP Memory
19
+ ### Step 1 Load Existing Features via MCP Memory
20
20
 
21
- 1. Read `package.json` to get the project name (`<project-name>`)
22
- 2. Call `search_memory` with `tags: ["project:<project-name>", "domain:features"]` to understand existing features and their relationships to the new request
21
+ 1. Read `package.json` get `<project-name>`
22
+ 2. Call `search_memory` with `tags: ["project:<project-name>", "domain:features"]` to understand existing features
23
23
  3. **Fallback**: if memory service is unavailable, read `.cursor/memory/architecture-snapshot.md` → "Existing Features" section
24
24
 
25
- ### 2. Discovery Questions
25
+ ---
26
+
27
+ ### Step 2 — Discovery Questions (BA role)
26
28
 
27
29
  Ask ALL of the following before writing anything. Cover at minimum questions 1–3 + any relevant ones from 4–8.
28
30
 
29
31
  1. **Problem & audience** — "What problem does this solve? Who experiences it?"
30
32
  2. **User flows** — "Walk me through the happy path. What happens on error?"
31
33
  3. **Edge cases & constraints** — "What are the limits? What should NOT happen?"
32
- 4. **Field constraints** — "What are the length limits, allowed formats, required vs optional fields?"
33
- 5. **Volume & scale** — "How many records are expected? Do you need search or pagination?"
34
+ 4. **Field constraints** — "Length limits, allowed formats, required vs optional fields?"
35
+ 5. **Volume & scale** — "How many records? Do you need search or pagination?"
34
36
  6. **File/upload specifics** — (if applicable) "What file types and size limits are allowed?"
35
- 7. **Privacy & access** — "Who can see this data? Is it per-user or shared?"
36
- 8. **Relationship to existing features** — (informed by MCP memory results) "Does this link to `<existing feature>`?"
37
- 9. **Confirm understanding** — Restate what you heard and ask for approval before writing
37
+ 7. **Privacy & access** — "Who can see this data? Per-user or shared?"
38
+ 8. **Relationship to existing features** — (informed by MCP results) "Does this link to `<existing feature>`?"
39
+ 9. **Confirm understanding** — Restate what you heard and ask for explicit approval
38
40
 
39
- If the user says "just do it" without answering, document all assumptions explicitly in an `## Assumptions` section at the top of the spec.
41
+ If the user says "just do it" without answering, document all assumptions in an `## Assumptions` section.
40
42
 
41
- Only after the user confirms your understanding should you produce the functional issue.
43
+ Only after the user confirms your understanding should you proceed to Step 3.
42
44
 
43
- ### 3. Write Functional Issue
45
+ ---
44
46
 
45
- Create `.requirements/<feature-name>.md` using this format:
47
+ ### Step 3 Write Draft Functional Spec (BA role)
46
48
 
47
49
  ```markdown
48
50
  ## Feature: [Feature Name]
@@ -58,21 +60,104 @@ As a [user type], I want [goal] so that [reason].
58
60
  ### Functional Test Cases
59
61
  - [ ] TC1 (AC1): User does X → sees Y (happy path)
60
62
  - [ ] TC2 (AC2): User triggers error → sees error message
61
- - [ ] TC3 (AC3): Edge case behavior visible to user
63
+ - [ ] TC3 (AC3): Edge case behavior
62
64
  ```
63
65
 
64
- **Rules for this format:**
66
+ **Rules:**
65
67
  - Acceptance criteria in plain functional language — no code, no implementation details
66
68
  - Test cases describe what the **user sees**, not system internals
67
- - Every acceptance criterion maps to at least one test case
68
- - No mention of database tables, API calls, component names, or file paths
69
+ - Every AC maps to at least one test case
70
+ - No database tables, API calls, component names, or file paths
69
71
  - Write requirements in the user's language; IDs (`AC1`, `TC1`) and technical terms stay in English
70
72
 
71
- ### 4. Store Requirement in MCP Memory
73
+ ---
74
+
75
+ ### Step 4 — Technical Lead Complexity Assessment
76
+
77
+ With the draft spec ready, invoke `@technical-lead`:
78
+
79
+ > `@technical-lead` — please review the draft spec above and the codebase, then report back:
80
+ > 1. What existing patterns/components/schemas apply to this feature?
81
+ > 2. What is the implementation complexity (S/M/L) and why?
82
+ > 3. Are there any technical constraints or risks the spec should mention?
83
+ > 4. Break down the technical tasks needed, grouped into parallel execution groups (A runs first, B/C can run in parallel after A completes)
84
+
85
+ **Wait for TL's response. Do not proceed until TL has responded.**
86
+
87
+ After TL responds: if TL identifies missing requirements (e.g., edge cases not covered), go back to the user with targeted follow-up questions before writing the combined plan.
88
+
89
+ ---
90
+
91
+ ### Step 5 — Produce Combined Plan
92
+
93
+ Merge BA functional spec + TL technical breakdown into the final plan file.
94
+
95
+ **Filename**: `.requirements/{feature-name}-{YYYY-MM-DD-HHmm}.md`
96
+
97
+ ```markdown
98
+ # Feature: [Feature Name]
99
+ > Created: {timestamp} | Status: ready-to-build
100
+
101
+ ## Context
102
+ [One paragraph: what problem this solves, who it's for, why now]
103
+
104
+ ## Assumptions
105
+ [List any assumptions made when user skipped discovery questions — empty if none]
106
+
107
+ ---
108
+
109
+ ## Functional Task List (BA-owned)
110
+
111
+ ### User Story
112
+ As a [user type], I want [goal] so that [reason].
113
+
114
+ ### Acceptance Criteria
115
+ - [ ] AC1: ...
116
+ - [ ] AC2: ...
117
+ - [ ] AC3: ...
118
+
119
+ ### Functional Test Cases
120
+ - [ ] TC1 (AC1): ...
121
+ - [ ] TC2 (AC2): ...
122
+ - [ ] TC3 (AC3): ...
123
+
124
+ ---
125
+
126
+ ## Technical Task List (TL-owned)
127
+
128
+ ### Complexity Assessment
129
+ [S/M/L with rationale from TL]
130
+
131
+ ### Parallel Execution Plan
132
+
133
+ #### Group A — Foundation (runs first, no dependencies)
134
+ - [ ] A1: [task — assigned agent: @backend/@frontend]
135
+ - [ ] A2: [task — assigned agent: @backend]
136
+
137
+ #### Group B — Feature Logic (runs after Group A, backend+frontend in parallel)
138
+ - [ ] B1: [task — assigned agent: @backend]
139
+ - [ ] B2: [task — assigned agent: @frontend]
140
+
141
+ #### Group C — Integration & Polish (runs after Group B)
142
+ - [ ] C1: [task — assigned agent: @test-qa]
143
+ - [ ] C2: [task — assigned agent: @frontend]
144
+
145
+ ### Review Gate (runs after all groups complete, in parallel)
146
+ - [ ] R1: @code-reviewer — full diff review
147
+ - [ ] R2: @security-researcher — auth, RLS, input validation
148
+
149
+ ### Architecture Sync
150
+ - [ ] Update `.cursor/memory/architecture-snapshot.md` (new tables, components, features)
151
+ - [ ] Run `/memory sync`
152
+ ```
153
+
154
+ ---
155
+
156
+ ### Step 6 — Store Requirement in MCP Memory
72
157
 
73
158
  ```
74
159
  store_memory({
75
- content: "Requirement: <feature-name> — <one-line summary of what the feature does and key acceptance criteria>",
160
+ content: "Requirement: <feature-name> — <one-line summary of what the feature does and key ACs>",
76
161
  metadata: {
77
162
  type: "architecture",
78
163
  tags: ["project:<project-name>", "domain:features", "category:requirement", "feature:<feature-name>", "status:pending-snapshot"]
@@ -80,15 +165,17 @@ store_memory({
80
165
  })
81
166
  ```
82
167
 
83
- ### 5. Hand Off
168
+ ---
169
+
170
+ ### Step 7 — Hand Off
84
171
 
85
172
  Tell the user:
86
173
 
87
- > Requirements written to `.requirements/<feature-name>.md`.
174
+ > Combined plan written to `.requirements/<feature-name>-<timestamp>.md`.
88
175
  >
89
- > **Next step**: Start a new conversation and run:
176
+ > **Next step**: Start a **fresh conversation** and run:
90
177
  > ```
91
- > /build-feature @.requirements/<feature-name>.md
178
+ > /build-feature @.requirements/<feature-name>-<timestamp>.md
92
179
  > ```
93
180
 
94
181
  ---
@@ -97,15 +184,17 @@ Tell the user:
97
184
 
98
185
  | Problem | Cause | Fix |
99
186
  |---------|-------|-----|
100
- | User says "just do it" without answering | Wants to skip discovery | Document all assumptions in an `## Assumptions` section at the top of the spec |
101
- | MCP memory unavailable | Service not running or not installed | Fall back to reading `.cursor/memory/architecture-snapshot.md` directly |
102
- | Feature overlaps with existing one | Missed relationship check in Step 1 | Re-query MCP with `domain:features`, clarify scope with user before writing spec |
103
- | User changes requirements mid-discovery | Evolving understanding | Update the spec before handing off; don't start `/build-feature` with stale requirements |
187
+ | User says "just do it" without answering | Wants to skip discovery | Document all assumptions in `## Assumptions` section |
188
+ | MCP memory unavailable | Service not running | Fall back to reading `.cursor/memory/architecture-snapshot.md` directly |
189
+ | TL finds missing edge cases | Spec incomplete | Go back to user with targeted follow-up questions |
190
+ | Feature overlaps with existing one | Missed relationship check in Step 1 | Re-query MCP with `domain:features`, clarify scope before writing spec |
191
+ | User changes requirements mid-discovery | Evolving understanding | Update spec before handing off; never start `/build-feature` with stale requirements |
104
192
 
105
193
  ---
106
194
 
107
195
  ## Guardrails
108
196
  - Always ask questions before writing — never assume requirements
109
197
  - Do NOT start any implementation in this conversation
110
- - Document all assumptions explicitly if the user skips questions
198
+ - Do NOT produce Technical Tasks without TL input
199
+ - Document all assumptions explicitly if user skips questions
111
200
  - Hand off to `/build-feature` in a fresh conversation — never chain them in the same conversation