@appsforgood/next-supabase-kit 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/BEST_PRACTICE_EVIDENCE.md +45 -0
  2. package/CHANGELOG.md +44 -0
  3. package/CODE_OF_CONDUCT.md +26 -0
  4. package/CONTRIBUTING.md +48 -0
  5. package/DOGFOOD.md +121 -0
  6. package/GOVERNANCE.md +45 -0
  7. package/LICENSE +21 -0
  8. package/README.md +251 -0
  9. package/REPOSITORY_SETTINGS.md +70 -0
  10. package/RESEARCH_CITATION_POLICY.md +26 -0
  11. package/SECURITY.md +29 -0
  12. package/SUPPLY_CHAIN.md +55 -0
  13. package/SUPPORT.md +28 -0
  14. package/UPGRADE.md +77 -0
  15. package/agents/deployment-observability-engineer.md +13 -0
  16. package/agents/docs-maintainer.md +17 -0
  17. package/agents/frontend-design-lead.md +22 -0
  18. package/agents/lead-architect.md +25 -0
  19. package/agents/marketing-copy-lead.md +20 -0
  20. package/agents/nextjs-engineer.md +20 -0
  21. package/agents/planner.md +20 -0
  22. package/agents/qa-engineer.md +19 -0
  23. package/agents/research-analyst.md +13 -0
  24. package/agents/security-reviewer.md +16 -0
  25. package/agents/supabase-postgres-engineer.md +19 -0
  26. package/assistant-adapters/README.md +28 -0
  27. package/assistant-adapters/claude-code-subagents.md +37 -0
  28. package/assistant-adapters/codex-agents.md +35 -0
  29. package/assistant-adapters/cursor-agent-kit.mdc +30 -0
  30. package/assistant-adapters/github-copilot-instructions.md +35 -0
  31. package/assistant-adapters/github-next-supabase.instructions.md +28 -0
  32. package/assistant-adapters/model-selection/claude-code-subagents-with-models.md +32 -0
  33. package/assistant-adapters/model-selection/codex-config.example.toml +29 -0
  34. package/assistant-adapters/model-selection/cursor-model-selection.mdc +24 -0
  35. package/assistant-adapters/model-selection/github-copilot-model-selection.md +20 -0
  36. package/checklists/accessibility.md +12 -0
  37. package/checklists/agent-council.md +13 -0
  38. package/checklists/brand-content.md +15 -0
  39. package/checklists/deployment.md +10 -0
  40. package/checklists/design-critique.md +13 -0
  41. package/checklists/frontend-distinctiveness.md +12 -0
  42. package/checklists/frontend-product-quality.md +13 -0
  43. package/checklists/frontend-quality.md +20 -0
  44. package/checklists/marketing-copy.md +11 -0
  45. package/checklists/owasp.md +12 -0
  46. package/checklists/rls.md +10 -0
  47. package/checklists/testing.md +12 -0
  48. package/checklists/upgrade.md +13 -0
  49. package/checklists/visual-regression.md +11 -0
  50. package/design-adapters/claude-design.prompt.md +27 -0
  51. package/design-adapters/figma.prompt.md +18 -0
  52. package/design-adapters/google-stitch.prompt.md +36 -0
  53. package/design-adapters/human-designer-brief.prompt.md +36 -0
  54. package/design-briefs/admin-dashboard.md +21 -0
  55. package/design-briefs/ai-workflow-product.md +25 -0
  56. package/design-briefs/community-social.md +26 -0
  57. package/design-briefs/content-app.md +21 -0
  58. package/design-briefs/ecommerce.md +25 -0
  59. package/design-briefs/education-course.md +25 -0
  60. package/design-briefs/marketplace.md +21 -0
  61. package/design-briefs/portfolio-venue.md +25 -0
  62. package/design-briefs/saas.md +21 -0
  63. package/design-briefs/tool.md +21 -0
  64. package/dist/index.d.ts +2 -0
  65. package/dist/index.js +3521 -0
  66. package/dist/index.js.map +1 -0
  67. package/examples/next-supabase-installed/.agent-kit/agent-roster.json +228 -0
  68. package/examples/next-supabase-installed/.agent-kit/manifest.json +58 -0
  69. package/examples/next-supabase-installed/.agent-kit/model-routing.json +164 -0
  70. package/examples/next-supabase-installed/.agent-kit/overrides.json +9 -0
  71. package/examples/next-supabase-installed/README.md +15 -0
  72. package/examples/next-supabase-installed/audit-output.json +336 -0
  73. package/examples/next-supabase-installed/tree.txt +38 -0
  74. package/model-routing/default-model-routing.json +164 -0
  75. package/package.json +98 -0
  76. package/profiles/admin-app.md +17 -0
  77. package/profiles/content-app.md +17 -0
  78. package/profiles/marketplace.md +17 -0
  79. package/profiles/saas.md +17 -0
  80. package/profiles/stack-next-firebase.md +25 -0
  81. package/profiles/stack-next-postgres.md +24 -0
  82. package/profiles/stack-remix-supabase.md +24 -0
  83. package/prompts/audit-project-setup.md +28 -0
  84. package/prompts/brand-content-intake.md +17 -0
  85. package/prompts/copy-review.md +15 -0
  86. package/prompts/council-session-review.md +17 -0
  87. package/prompts/creative-direction-matrix.md +22 -0
  88. package/prompts/design-critique-gate.md +28 -0
  89. package/prompts/docs-update.md +16 -0
  90. package/prompts/frontend-design-review.md +29 -0
  91. package/prompts/frontend-distinctiveness-benchmark.md +32 -0
  92. package/prompts/frontend-product-quality-scorecard.md +35 -0
  93. package/prompts/implement-feature.md +14 -0
  94. package/prompts/migration-review.md +14 -0
  95. package/prompts/screenshot-review.md +27 -0
  96. package/prompts/security-review.md +17 -0
  97. package/prompts/upgrade-review.md +18 -0
  98. package/prompts/visual-qa-plan.md +16 -0
  99. package/research/proposed-updates.md +70 -0
  100. package/research/scan-config.json +261 -0
  101. package/research/scan-plan.md +24 -0
  102. package/research/summaries/.gitkeep +1 -0
  103. package/research/summaries/agent-workflow-patterns.md +37 -0
  104. package/research/summaries/creative-design-patterns.md +38 -0
  105. package/research/summaries/design-critique-patterns.md +34 -0
  106. package/research/summaries/docs-and-agent-patterns.md +64 -0
  107. package/research/summaries/dogfood-adoption-patterns.md +33 -0
  108. package/research/summaries/frontend-design-patterns.md +64 -0
  109. package/research/summaries/frontend-distinctiveness-benchmark-patterns.md +38 -0
  110. package/research/summaries/frontend-product-quality-rubric-patterns.md +37 -0
  111. package/research/summaries/maturity-model-patterns.md +29 -0
  112. package/research/summaries/nextjs-patterns.md +65 -0
  113. package/research/summaries/repo-health-patterns.md +41 -0
  114. package/research/summaries/scan-overview.md +46 -0
  115. package/research/summaries/security-patterns.md +64 -0
  116. package/research/summaries/supabase-rls-patterns.md +54 -0
  117. package/research/summaries/supply-chain-patterns.md +38 -0
  118. package/research/summaries/testing-patterns.md +63 -0
  119. package/research/summaries/upgrade-lifecycle-patterns.md +26 -0
  120. package/research/summaries/visual-qa-patterns.md +39 -0
  121. package/rosters/next-supabase-default-council.json +228 -0
  122. package/schemas/agent-roster.schema.json +54 -0
  123. package/schemas/audit-report.schema.json +50 -0
  124. package/schemas/correction-rules.schema.json +32 -0
  125. package/schemas/council-session.schema.json +65 -0
  126. package/schemas/model-routing.schema.json +72 -0
  127. package/schemas/project-context.schema.json +94 -0
  128. package/schemas/session-event.schema.json +46 -0
  129. package/schemas/studio-session.schema.json +48 -0
  130. package/skills/accessibility-wcag.md +15 -0
  131. package/skills/agent-handoff-tracing.md +44 -0
  132. package/skills/best-practice-maturity-review.md +26 -0
  133. package/skills/content-first-design.md +50 -0
  134. package/skills/conversion-copywriting.md +38 -0
  135. package/skills/deployment-observability.md +14 -0
  136. package/skills/docs-maintainer.md +19 -0
  137. package/skills/frontend-design-system.md +68 -0
  138. package/skills/frontend-distinctiveness-benchmark.md +40 -0
  139. package/skills/frontend-product-quality-rubric.md +59 -0
  140. package/skills/landing-page-copy.md +29 -0
  141. package/skills/nextjs-app-router.md +18 -0
  142. package/skills/onboarding-empty-state-copy.md +37 -0
  143. package/skills/owasp-security-review.md +19 -0
  144. package/skills/planning-council.md +21 -0
  145. package/skills/positioning-messaging.md +42 -0
  146. package/skills/postgres-migrations.md +14 -0
  147. package/skills/product-voice-tone.md +35 -0
  148. package/skills/reference-led-design-critique.md +48 -0
  149. package/skills/supabase-auth-rls.md +20 -0
  150. package/skills/testing-qa.md +15 -0
  151. package/skills/upgrade-maintenance.md +32 -0
  152. package/skills/visual-regression-qa.md +42 -0
  153. package/templates/next-supabase/AGENTS.md +138 -0
  154. package/templates/next-supabase/AGENT_ROSTER.md +98 -0
  155. package/templates/next-supabase/ASSISTANT_ADAPTERS.md +82 -0
  156. package/templates/next-supabase/COUNCIL.md +54 -0
  157. package/templates/next-supabase/DECISIONS.md +45 -0
  158. package/templates/next-supabase/DEPLOYMENT.md +45 -0
  159. package/templates/next-supabase/DESIGN.md +171 -0
  160. package/templates/next-supabase/DOCS.md +62 -0
  161. package/templates/next-supabase/MESSAGING.md +81 -0
  162. package/templates/next-supabase/MODEL_ROUTING.md +109 -0
  163. package/templates/next-supabase/QUALITY_GATES.md +87 -0
  164. package/templates/next-supabase/SECURITY.md +54 -0
  165. package/templates/next-supabase/SKILLS.md +221 -0
  166. package/templates/next-supabase/SPEC.md +114 -0
  167. package/templates/next-supabase/STYLE_GUIDE.md +104 -0
  168. package/templates/next-supabase/TESTING.md +68 -0
  169. package/templates/next-supabase/UPGRADE.md +59 -0
@@ -0,0 +1,221 @@
1
+ # Skills
2
+
3
+ Use these reusable skills when building or reviewing this project.
4
+
5
+ ## Planning And Agent Council
6
+
7
+ Use for planning requests, roadmap work, ambiguous feature requests, core architecture changes, auth/data changes, release changes, and any task that needs multiple agent roles.
8
+
9
+ Required checks:
10
+ - Planner starts planning and ambiguous requests.
11
+ - Lead Architect reviews core changes before implementation.
12
+ - Security Reviewer joins auth, data mutation, external-call, dependency, secret, and release-risk changes.
13
+ - QA Engineer verifies behavior changes before completion.
14
+ - Documentation Maintainer updates living docs when behavior, architecture, release, or standards change.
15
+
16
+ ## Best-Practice Maturity Review
17
+
18
+ Use for setup audits, release readiness, roadmap checkpoints, dogfood reviews, and any claim that work is best-practice rather than merely functional.
19
+
20
+ Required checks:
21
+ - `QUALITY_GATES.md` names the target level: baseline, strong, or best-practice.
22
+ - Affected areas are mapped across council, architecture, Supabase/RLS, security, frontend, accessibility, testing, release, docs, and repo health.
23
+ - Evidence is named for each affected area.
24
+ - Missing evidence is treated as incomplete, not as a passing caveat.
25
+ - Research findings are promoted into templates, skills, checklists, audit checks, tests, release gates, or decisions before they count as kit behavior.
26
+
27
+ ## Agent Handoff Tracing
28
+
29
+ Use for meaningful multi-agent work, core changes, security-sensitive changes, frontend acceptance reviews, release work, and any task where a decision should survive beyond the chat thread.
30
+
31
+ Required checks:
32
+ - Select the workflow from `.agent-kit/agent-roster.json`.
33
+ - Select or confirm the model profile from `MODEL_ROUTING.md` and `.agent-kit/model-routing.json`.
34
+ - Read `.agent-kit/project-context.json`, `.agent-kit/project-context.md`, and active correction files before routing meaningful work.
35
+ - Record council-session evidence in Agent Studio with `agent-kit session ...` commands when available, or in `COUNCIL.md` / schema-backed records when CLI tooling is unavailable.
36
+ - Capture each agent decision, risk, next handoff, and evidence.
37
+ - Mark required outputs as missing, partial, complete, or not applicable.
38
+ - Record verification commands, results, and skipped-test rationale.
39
+ - Record human corrections before continuing and promote durable project or agent corrections when the correction should apply to future sessions.
40
+
41
+ ## Upgrade Maintenance
42
+
43
+ Use for Agent Kit, Next.js, Supabase, UI library, testing tool, release workflow, or assistant-adapter upgrades.
44
+
45
+ Required checks:
46
+ - Read `UPGRADE.md` before accepting versioned behavior changes.
47
+ - Run `agent-kit diff` before accepting template changes.
48
+ - Run `agent-kit update` only on a branch where conflicts can be reviewed.
49
+ - Preserve valid local overrides in `.agent-kit/overrides.json`.
50
+ - Check Next.js upgrade guides and codemods when framework behavior changes.
51
+ - Check Supabase migration history, RLS impact, generated types, and rollback risk when data/auth behavior changes.
52
+ - Record package versions, migration order, rollback notes, verification commands, owner, and date.
53
+
54
+ ## Next.js App Router Architecture
55
+
56
+ Use for routing, Server Components, Client Components, Server Actions, Route Handlers, data fetching, caching, revalidation, metadata, and protected app layouts.
57
+
58
+ Required checks:
59
+ - Server/client boundary is explicit.
60
+ - Secrets never enter client bundles.
61
+ - Data loading preserves auth context.
62
+ - Loading, error, and empty states are handled.
63
+ - Caching and revalidation cannot leak user-specific data.
64
+
65
+ ## Supabase Auth, SSR, And RLS
66
+
67
+ Use for Supabase Auth, SSR clients, middleware, sessions, Row Level Security, Storage policies, and service-role usage.
68
+
69
+ Required checks:
70
+ - RLS protects every user-owned or tenant-owned table.
71
+ - UI checks are not treated as authorization.
72
+ - Service-role keys are server-only.
73
+ - Auth redirects and session refreshes are tested.
74
+ - IDOR is prevented at the SQL policy boundary.
75
+
76
+ ## Postgres Migrations And Schema
77
+
78
+ Use for schema changes, constraints, indexes, SQL functions, triggers, seed data, and rollback planning.
79
+
80
+ Required checks:
81
+ - Migrations are ordered and reversible where practical.
82
+ - Constraints protect integrity.
83
+ - Indexes support expected access patterns.
84
+ - Data migrations have failure and retry guidance.
85
+
86
+ ## OWASP Security Review
87
+
88
+ Use for every auth change, API route, Server Action, data mutation, external call, file upload, or dependency addition.
89
+
90
+ Required checks:
91
+ - Injection, broken auth, IDOR, SSRF, insecure configuration, vulnerable dependencies, and unsafe deserialization are considered.
92
+ - Inputs are validated and outputs are safely rendered.
93
+ - Errors are explicit but do not leak secrets.
94
+
95
+ ## Frontend Design System
96
+
97
+ Use for every user-facing screen and component.
98
+
99
+ Required checks:
100
+ - `DESIGN.md` has enough brand, content, user-need, and creative-direction context for the screen.
101
+ - Reference-set, anti-reference, source-safety, and distinctiveness evidence exists for significant frontend work.
102
+ - Frontend distinctiveness benchmark evidence exists for significant frontend work: first-screen proof, content fingerprint, reference benchmark, asset provenance, state proof, and visual QA proof.
103
+ - Frontend product-quality scorecard exists for significant frontend work.
104
+ - Interface is domain-specific and task-first.
105
+ - Design tokens and component patterns are consistent.
106
+ - Avoid generic AI-site defaults.
107
+ - Loading, empty, error, disabled, success, and mobile states are designed.
108
+ - Use the matching `.agent-kit/design-briefs/*` brief for SaaS, admin, marketplace, content, tool, ecommerce, portfolio/venue, education, community/social, or AI workflow surfaces.
109
+ - Review final desktop and mobile screenshots with `.agent-kit/prompts/screenshot-review.md`.
110
+
111
+ ## Content-First Creative Direction
112
+
113
+ Use before designing or changing a user-facing site, product screen, dashboard, tool, marketplace, content experience, ecommerce flow, portfolio, venue page, education product, community surface, or AI workflow UI.
114
+
115
+ Required checks:
116
+ - Audience, user needs, product category, and content inventory are explicit.
117
+ - Brand personality, visual constraints, category references, and non-goals are captured.
118
+ - At least two creative directions are considered before implementation.
119
+ - The chosen direction affects tokens, layout, copy, imagery, density, and interaction tone.
120
+ - Missing real content or assets are documented instead of hidden behind generic placeholders.
121
+
122
+ ## Reference-Led Design Critique
123
+
124
+ Use before accepting significant frontend work, especially when the product risks looking like a generic AI-generated site.
125
+
126
+ Required checks:
127
+ - `DESIGN.md` includes 3-5 references and 2-3 anti-references.
128
+ - References are used for hierarchy, density, state treatment, typography, content handling, or interaction learning without copying source designs.
129
+ - Source-safety notes name brand marks, layouts, copy, and protected assets that must not be copied.
130
+ - Distinctiveness is judged as weak, adequate, or strong.
131
+ - `.agent-kit/prompts/design-critique-gate.md` records required changes and missing evidence before acceptance.
132
+
133
+ ## Frontend Product Quality Rubric
134
+
135
+ Use before accepting significant frontend work when a repeatable acceptance score is needed.
136
+
137
+ Required checks:
138
+ - User/task fit, content specificity, visual identity, information architecture, component states, accessibility and interaction, and source safety are scored `0-2`.
139
+ - Critical zeroes are rejected.
140
+ - Total score is at least `10/14` before acceptance.
141
+ - Best-practice frontend claim requires at least `12/14`, desktop/mobile review, and visual QA evidence.
142
+ - Best-practice frontend claim also requires passing distinctiveness benchmark evidence.
143
+
144
+ ## Frontend Distinctiveness Benchmark
145
+
146
+ Use before accepting significant frontend work that could still be interchangeable with another product in the same category.
147
+
148
+ Required checks:
149
+ - The first viewport proves the real product object, task, workflow, content, or decision.
150
+ - Product nouns, labels, data shapes, records, actions, and edge cases are visible or documented.
151
+ - References are translated into lessons and anti-references without copied source design, brand identity, copy, or assets.
152
+ - Asset provenance is recorded for real, generated, licensed, and placeholder visuals.
153
+ - Important states and desktop/mobile evidence exist for the change risk.
154
+ - Reject work that would still look valid after only changing the logo or headline.
155
+
156
+ ## Marketing Copy And Messaging
157
+
158
+ Use before writing or accepting public-facing pages, landing pages, pricing copy, CTAs, onboarding copy, empty states, product voice, or conversion-critical UX copy.
159
+
160
+ Required checks:
161
+ - `MESSAGING.md` identifies audience, pain, desired outcome, alternatives, differentiator, proof, objections, voice, and conversion goal.
162
+ - Missing positioning inputs are asked as explicit questions before final copy is written.
163
+ - Claims are supported by named proof or marked as assumptions.
164
+ - Headline, subhead, CTA, proof, and objection handling match the same value proposition.
165
+ - Copy uses real product nouns, workflows, constraints, and customer language.
166
+ - CTAs have one primary action and clear secondary actions.
167
+ - Risky pricing, privacy, security, compliance, performance, medical, financial, or legal claims are reviewed before release.
168
+ - Marketing Copy Lead hands off public-facing copy to Frontend Design Lead for layout and hierarchy review.
169
+
170
+ ## Accessibility WCAG 2.1 AA
171
+
172
+ Use for forms, navigation, modals, menus, tables, dashboards, and any custom interaction.
173
+
174
+ Required checks:
175
+ - Semantic HTML is preferred.
176
+ - ARIA is used only when needed.
177
+ - Keyboard navigation and focus states work.
178
+ - Color contrast meets WCAG 2.1 AA.
179
+
180
+ ## Testing And QA
181
+
182
+ Use for unit, integration, regression, Playwright smoke coverage, visual QA, and acceptance evidence.
183
+
184
+ Required checks:
185
+ - Core logic has unit tests.
186
+ - Preserved behavior has regression tests.
187
+ - Critical paths have smoke tests.
188
+ - Auth and data mutation paths are prioritized.
189
+ - High-risk UI changes have screenshot or visual-regression evidence.
190
+
191
+ ## Visual Regression QA
192
+
193
+ Use when changing user-facing screens, reusable components, visual design tokens, responsive layouts, image-heavy pages, or any surface where appearance is part of acceptance.
194
+
195
+ Required checks:
196
+ - Visual QA tier is named: baseline screenshots, Playwright screenshots, Storybook visual tests, or visual-regression service.
197
+ - Component states and important responsive breakpoints are captured.
198
+ - Dynamic or volatile regions are mocked, masked, frozen, or excluded with rationale.
199
+ - Baseline updates require human review and a short rationale.
200
+ - Visual checks do not replace accessibility, keyboard, semantic, auth, or data-boundary tests.
201
+
202
+ ## Documentation Maintenance
203
+
204
+ Use after every significant change.
205
+
206
+ Required checks:
207
+ - `SPEC.md` reflects current behavior.
208
+ - `DECISIONS.md` records important tradeoffs.
209
+ - `DOCS.md` explains workflows and integration points.
210
+ - `COUNCIL.md` captures required handoffs and evidence for meaningful multi-agent work.
211
+ - `MODEL_ROUTING.md` captures model profile and IDE enforcement evidence.
212
+ - `QUALITY_GATES.md`, `DESIGN.md`, `MESSAGING.md`, `STYLE_GUIDE.md`, `SECURITY.md`, `TESTING.md`, `DEPLOYMENT.md`, and `UPGRADE.md` stay current.
213
+
214
+ ## Compatibility Profiles
215
+
216
+ Use `.agent-kit/profiles/*` before feature planning when the project is a SaaS, marketplace, admin app, or content app.
217
+
218
+ Required checks:
219
+ - The project type's auth, data, design, testing, and handoff risks are named.
220
+ - Agent ownership matches the profile.
221
+ - Missing profile assumptions are recorded in `DECISIONS.md`.
@@ -0,0 +1,114 @@
1
+ # Specification
2
+
3
+ This file is the living functional and technical specification for the project.
4
+
5
+ ## Product Summary
6
+
7
+ Describe the product, primary users, core workflows, and business-critical behavior.
8
+
9
+ ## Current Architecture
10
+
11
+ Document the current system shape:
12
+
13
+ - Next.js routing model
14
+ - Server Components and Client Components
15
+ - Route Handlers and Server Actions
16
+ - Supabase Auth flow
17
+ - Supabase tables, RLS policies, and Storage buckets
18
+ - Deployment target
19
+ - Observability and logging
20
+
21
+ ## Behavioral Contracts
22
+
23
+ List behavior that must be preserved during changes:
24
+
25
+ - Agent council routing in `.agent-kit/agent-roster.json`
26
+ - Model profile routing in `MODEL_ROUTING.md` and `.agent-kit/model-routing.json`
27
+ - Council-session evidence in `COUNCIL.md`
28
+ - Agent, council-session, model-routing, and audit-report schema contracts in `.agent-kit/schemas/`
29
+ - Planner default ownership for planning and Lead Architect review for core changes
30
+ - Quality gate evidence in `QUALITY_GATES.md`
31
+ - Content-first design direction in `DESIGN.md`
32
+ - Messaging and copy evidence in `MESSAGING.md`
33
+ - Reference-led design critique evidence in `DESIGN.md`
34
+ - Auth and session behavior
35
+ - User ownership and tenant boundaries
36
+ - Data mutation rules
37
+ - API response expectations
38
+ - UI workflows and critical paths
39
+
40
+ ## Data Model
41
+
42
+ Document tables, relationships, constraints, indexes, and ownership rules.
43
+
44
+ ## RLS Policy Inventory
45
+
46
+ Track authorization at the data boundary.
47
+
48
+ | Table/Bucket | Owner Boundary | Select | Insert | Update | Delete | Notes |
49
+ | --- | --- | --- | --- | --- | --- | --- |
50
+ | `example_table` | `user_id = auth.uid()` | Required | Required | Required | Optional | Replace with real policy names. |
51
+
52
+ ## Security Requirements
53
+
54
+ - Authorization is enforced by Supabase RLS.
55
+ - Service-role keys are server-only.
56
+ - User input is validated at all boundaries.
57
+ - User-controlled output is safely rendered.
58
+ - Privileged operations are logged.
59
+
60
+ ## Quality Gate Level
61
+
62
+ Record the current maturity target and evidence.
63
+
64
+ | Area | Baseline | Strong | Best-Practice | Evidence |
65
+ | --- | --- | --- | --- | --- |
66
+ | Council routing | TBD | TBD | TBD | `AGENT_ROSTER.md`, `COUNCIL.md` |
67
+ | Model routing | TBD | TBD | TBD | `MODEL_ROUTING.md`, `ASSISTANT_ADAPTERS.md` |
68
+ | Architecture | TBD | TBD | TBD | Affected-layer map, `DECISIONS.md` |
69
+ | Supabase/RLS | TBD | TBD | TBD | RLS inventory, migration tests |
70
+ | Messaging | TBD | TBD | TBD | `MESSAGING.md`, proof map, objection handling, CTA hierarchy |
71
+ | Frontend | TBD | TBD | TBD | `DESIGN.md`, reference-set evidence, design critique verdict, product-quality scorecard, screenshots, visual QA |
72
+ | Testing | TBD | TBD | TBD | Unit, regression, smoke, visual evidence |
73
+ | Release | TBD | TBD | TBD | `DEPLOYMENT.md`, logs, rollback notes |
74
+
75
+ ## UX Requirements
76
+
77
+ - Interfaces are mobile-first and accessible.
78
+ - Loading, empty, error, disabled, and success states are handled.
79
+ - Visual design is domain-specific and avoids generic AI-site defaults.
80
+ - Audience, user needs, real content, brand constraints, and creative direction are documented before frontend implementation.
81
+ - Audience, pain, desired outcome, differentiator, proof, objections, voice, and CTA hierarchy are documented before public-facing or conversion-facing copy is accepted.
82
+ - Reference set, anti-references, source-safety notes, and design critique verdict are documented before accepting significant frontend work.
83
+ - Frontend product-quality scorecard is documented before accepting significant frontend work.
84
+ - First screens show the real product, task, object, content, or workflow.
85
+
86
+ ## Brand And Content Inventory
87
+
88
+ Track the inputs that make the UI specific to this product.
89
+
90
+ | Area | Current Decision | Evidence |
91
+ | --- | --- | --- |
92
+ | Product category | TBD | `DESIGN.md` |
93
+ | Primary audience | TBD | User research, analytics, stakeholder input, or project brief |
94
+ | User needs | TBD | `DESIGN.md` and accepted stories |
95
+ | Real content/data | TBD | Seeds, CMS, database schema, product copy, assets |
96
+ | Value proposition | TBD | `MESSAGING.md`, proof, objections, and CTA evidence |
97
+ | Brand constraints | TBD | Logo, colors, fonts, imagery, platform rules |
98
+ | Reference set | TBD | `DESIGN.md`, category references, source-safety notes |
99
+ | Anti-references | TBD | `DESIGN.md`, explicit non-goals |
100
+ | Chosen creative direction | TBD | Creative-direction matrix and screenshots |
101
+ | Design critique verdict | TBD | `DESIGN.md`, critique-gate review |
102
+ | Visual QA tier | TBD | `TESTING.md`, Storybook, Playwright report, visual-regression service, or screenshot artifacts |
103
+
104
+ ## Component And State Inventory
105
+
106
+ Track important UI surfaces so design quality is reviewable.
107
+
108
+ | Surface | Components | Loading | Empty | Error | Disabled | Success | Mobile Notes |
109
+ | --- | --- | --- | --- | --- | --- | --- | --- |
110
+ | Primary workflow | TBD | TBD | TBD | TBD | TBD | TBD | TBD |
111
+
112
+ ## Open Questions
113
+
114
+ Track unresolved product or technical decisions here until they become entries in `DECISIONS.md`.
@@ -0,0 +1,104 @@
1
+ # Style Guide
2
+
3
+ ## Code Style
4
+
5
+ - Prefer explicit names over clever abbreviations.
6
+ - Keep server-only logic in server-only modules.
7
+ - Keep UI components focused on rendering and interaction.
8
+ - Validate inputs at boundaries before calling business logic.
9
+ - Return clear errors; do not silently swallow failures.
10
+
11
+ ## Next.js Patterns
12
+
13
+ - Use Server Components by default.
14
+ - Use Client Components only for browser state, events, effects, or client-only libraries.
15
+ - Keep Route Handlers and Server Actions thin.
16
+ - Keep user-specific data out of shared caches.
17
+
18
+ ## Supabase Patterns
19
+
20
+ - Use SSR-safe Supabase clients.
21
+ - Enforce ownership and tenancy through RLS.
22
+ - Keep service-role access isolated to trusted server code.
23
+ - Document every policy assumption.
24
+
25
+ ## Frontend Design Rules
26
+
27
+ Use `DESIGN.md` before visual implementation. Frontend work should be content-first: audience, user needs, real content, brand constraints, and creative direction must be understood before styling starts.
28
+
29
+ Do not default to generic AI-site visual patterns:
30
+
31
+ - No generic purple-blue gradient hero as the default solution.
32
+ - No fake metrics or placeholder dashboard cards.
33
+ - No vague SaaS copy.
34
+ - No oversized rounded card grids unless the domain calls for them.
35
+ - No landing page when the user asked for a working app or tool.
36
+
37
+ Prefer:
38
+
39
+ - Task-first screens.
40
+ - Domain-specific navigation and information hierarchy.
41
+ - Real workflow states.
42
+ - Reusable design tokens.
43
+ - Accessible forms and controls.
44
+ - Clear density rules for admin, SaaS, and operational tools.
45
+ - Mobile-first responsive layouts.
46
+ - Creative direction that is visibly tied to product content and user need.
47
+
48
+ Use `.agent-kit/prompts/brand-content-intake.md` and `.agent-kit/prompts/creative-direction-matrix.md` when inputs are under-specified. Use `.agent-kit/design-briefs/*` before designing SaaS, admin dashboard, marketplace, content app, tool, ecommerce, portfolio/venue, education, community/social, or AI workflow surfaces. Use `.agent-kit/prompts/screenshot-review.md` after implementation to review desktop and mobile screenshots. Use `.agent-kit/prompts/visual-qa-plan.md` when a change needs repeatable visual regression or component-state evidence.
49
+
50
+ Use `.agent-kit/prompts/design-critique-gate.md` before accepting significant frontend work. `DESIGN.md` should name a reference set, anti-references, source-safety notes, and a distinctiveness verdict so a design cannot pass only because it has tokens, states, and screenshots.
51
+
52
+ Use `.agent-kit/prompts/frontend-distinctiveness-benchmark.md` before accepting significant frontend work. `DESIGN.md` should prove first-screen specificity, content fingerprint, reference benchmark, asset provenance, state proof, and visual QA proof so a design cannot pass while remaining interchangeable with another product in the same category.
53
+
54
+ Use `.agent-kit/prompts/frontend-product-quality-scorecard.md` before accepting significant frontend work. `DESIGN.md` should score user/task fit, content specificity, visual identity, information architecture, component states, accessibility and interaction, and source safety. Reject work with critical zeroes or a total score below `10/14`; reserve best-practice claims for `12/14` or higher with desktop/mobile and visual QA evidence.
55
+
56
+ ## Messaging And Copy Rules
57
+
58
+ Use `MESSAGING.md` before writing public-facing or conversion-facing copy. Copy should identify the audience, pain, desired outcome, differentiator, proof, objections, voice, and CTA hierarchy before it is accepted.
59
+
60
+ Prefer:
61
+
62
+ - Specific product nouns, workflows, constraints, and customer language.
63
+ - Claims tied to proof or marked as assumptions.
64
+ - One primary CTA with clear secondary actions.
65
+ - Useful next steps for onboarding, empty, error, permission, upgrade, and pricing copy.
66
+
67
+ Reject unsupported superlatives, invented proof, dark patterns, forced urgency, vague AI claims, and risky pricing, privacy, security, compliance, performance, medical, financial, or legal wording.
68
+
69
+ ## Design Token Inventory
70
+
71
+ Define design tokens instead of ad hoc styling.
72
+
73
+ | Token Area | Required Decisions |
74
+ | --- | --- |
75
+ | Color | Semantic colors, contrast, status colors |
76
+ | Typography | Font family, scale, weights, line height |
77
+ | Spacing | Base unit, dense/admin spacing, section spacing |
78
+ | Radius | Component radius defaults and exceptions |
79
+ | Motion | Duration, easing, reduced-motion behavior |
80
+ | Shadow/Depth | When elevation is allowed |
81
+
82
+ ## Component States
83
+
84
+ Every interactive component should consider:
85
+
86
+ - Default
87
+ - Hover
88
+ - Focus
89
+ - Disabled
90
+ - Loading
91
+ - Empty
92
+ - Error
93
+ - Success
94
+ - Mobile
95
+
96
+ For reusable components, capture these states as Storybook stories, Playwright screenshot cases, or documented screenshot evidence when the component is visually significant.
97
+
98
+ ## Accessibility
99
+
100
+ - Use semantic HTML first.
101
+ - Use ARIA only when semantics are insufficient.
102
+ - Keep keyboard navigation predictable.
103
+ - Maintain visible focus states.
104
+ - Meet WCAG 2.1 AA contrast.
@@ -0,0 +1,68 @@
1
+ # Testing
2
+
3
+ Testing should be proportional to risk. Auth, data mutations, payments, admin actions, and migrations receive the most coverage.
4
+
5
+ ## Required Test Types
6
+
7
+ - Unit tests for core logic and edge cases.
8
+ - Regression tests for preserved behavior.
9
+ - Integration tests for API, Server Actions, and Supabase interactions where practical.
10
+ - Playwright smoke tests for auth and critical user workflows.
11
+ - Visual QA for important user-facing screens and reusable component states.
12
+
13
+ ## Critical Smoke Paths
14
+
15
+ Define project-specific smoke tests for:
16
+
17
+ - Login and logout
18
+ - Protected route access
19
+ - Primary user workflow
20
+ - Data creation and update
21
+ - Error and empty states
22
+ - Mobile navigation
23
+
24
+ ## Visual QA And Regression
25
+
26
+ Choose the smallest reliable visual QA tier for the project:
27
+
28
+ | Tier | Use When | Evidence |
29
+ | --- | --- | --- |
30
+ | Baseline | Any user-facing UI exists | Desktop/mobile screenshots reviewed with `.agent-kit/prompts/screenshot-review.md` |
31
+ | Strong | Primary workflows or responsive layouts change often | Playwright screenshot checks such as `toHaveScreenshot()` for stable pages/states |
32
+ | Mature | Shared component system, design system, or frequent UI releases | Storybook state stories plus visual regression in CI through Chromatic, Argos, Loki, Playwright snapshots, or equivalent |
33
+
34
+ Required rules:
35
+
36
+ - Capture default, loading, empty, error, disabled, success, permission-denied, and mobile states where relevant.
37
+ - Stabilize dynamic data, animations, dates, avatars, generated media, and third-party widgets before visual comparison.
38
+ - Review baseline updates as product changes; do not auto-accept visual diffs without rationale.
39
+ - Keep accessibility, semantic, keyboard, auth, and data-boundary tests separate from visual checks.
40
+
41
+ ## CI Gates
42
+
43
+ Every project should define the smallest reliable CI gate for its risk profile.
44
+
45
+ Recommended baseline:
46
+
47
+ - Install from lockfile
48
+ - Typecheck
49
+ - Unit tests
50
+ - Build
51
+ - Dependency audit
52
+ - `agent-kit audit --min-readiness baseline-setup`
53
+ - Playwright smoke tests for critical paths
54
+ - Visual QA evidence for high-risk UI changes
55
+
56
+ ## Security-Focused Tests
57
+
58
+ Prioritize:
59
+
60
+ - IDOR attempts
61
+ - Cross-tenant access attempts
62
+ - Unauthorized API calls
63
+ - RLS-protected reads and writes
64
+ - Service-role-only operations
65
+
66
+ ## Test Gaps
67
+
68
+ If test infrastructure does not exist, document the smallest viable setup and the risk of shipping without it.
@@ -0,0 +1,59 @@
1
+ # Upgrade Guide
2
+
3
+ Use this file when upgrading Agent Kit, Next.js, Supabase, shared UI primitives, or any tool that changes project behavior.
4
+
5
+ ## Agent Kit Upgrade Flow
6
+
7
+ ```bash
8
+ npx @agent-skills/next-supabase-kit@latest doctor
9
+ npx @agent-skills/next-supabase-kit@latest diff
10
+ npx @agent-skills/next-supabase-kit@latest update
11
+ npx @agent-skills/next-supabase-kit@latest audit --min-readiness baseline-setup
12
+ ```
13
+
14
+ Use `agent-kit audit --min-readiness best-practice-candidate` only after starter placeholders and upgrade evidence are replaced with project-specific evidence.
15
+
16
+ ## Required Review
17
+
18
+ - Create a branch before running `agent-kit update`.
19
+ - Run `agent-kit diff` before accepting changed templates.
20
+ - Review `.agent-kit/conflicts/` before accepting changed templates.
21
+ - Preserve valid local customizations in `.agent-kit/overrides.json`.
22
+ - Review `AGENTS.md`, `AGENT_ROSTER.md`, `ASSISTANT_ADAPTERS.md`, `MODEL_ROUTING.md`, `COUNCIL.md`, `QUALITY_GATES.md`, `SECURITY.md`, `TESTING.md`, and `DEPLOYMENT.md`.
23
+ - Record accepted tradeoffs in `DECISIONS.md`.
24
+ - Update this file with package version, release notes, migration status, rollback notes, owner, and date.
25
+
26
+ ## Next.js Upgrade Notes
27
+
28
+ - Check the official Next.js upgrade guide for the target version.
29
+ - Use official Next.js codemods when the upgrade guide recommends them.
30
+ - Confirm routing, Server Component, Client Component, Route Handler, Server Action, caching, metadata, and middleware behavior.
31
+ - Confirm model-routing recommendations, IDE enforcement limits, and dated model comments still match the project's active tools.
32
+ - Run build, tests, smoke checks, and visual QA for affected screens.
33
+
34
+ ## Supabase Upgrade Notes
35
+
36
+ - Treat schema, RLS, storage, auth, and edge-function changes as migration work.
37
+ - Check local and remote migration history before deployment.
38
+ - Do not rely on dashboard-only database changes for production behavior.
39
+ - Record migration order, rollback risk, and verification evidence in `DEPLOYMENT.md`.
40
+ - Regenerate typed clients after schema changes when the project uses generated Supabase types.
41
+
42
+ ## Rollback Evidence
43
+
44
+ | Item | Value |
45
+ | --- | --- |
46
+ | Previous package/framework version | TBD |
47
+ | New package/framework version | TBD |
48
+ | Branch or revert commit | TBD |
49
+ | Template conflicts reviewed | TBD |
50
+ | Database migrations applied | TBD |
51
+ | Rollback command or process | TBD |
52
+ | Verification commands | TBD |
53
+ | Owner/date | TBD |
54
+
55
+ ## Upgrade History
56
+
57
+ | Date | Change | Evidence | Outcome |
58
+ | --- | --- | --- | --- |
59
+ | TBD | TBD | TBD | TBD |