@howlil/ez-agents 2.0.0 → 3.0.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 (145) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +157 -110
  3. package/README.zh-CN.md +84 -84
  4. package/agents/ez-plan-checker.md +2 -2
  5. package/agents/ez-research-synthesizer.md +1 -1
  6. package/agents/ez-ui-auditor.md +0 -2
  7. package/agents/ez-ui-checker.md +2 -4
  8. package/agents/ez-ui-researcher.md +0 -2
  9. package/agents/ez-verifier.md +1 -1
  10. package/bin/install.js +211 -211
  11. package/commands/ez/debug.md +1 -1
  12. package/commands/ez/map-codebase.md +1 -1
  13. package/commands/ez/reapply-patches.md +3 -3
  14. package/commands/ez/research-phase.md +1 -1
  15. package/{get-shit-done → ez-agents}/bin/ez-tools.cjs +1 -1
  16. package/{get-shit-done → ez-agents}/bin/lib/assistant-adapter.cjs +205 -205
  17. package/{get-shit-done → ez-agents}/bin/lib/audit-exec.cjs +150 -150
  18. package/{get-shit-done → ez-agents}/bin/lib/auth.cjs +175 -175
  19. package/{get-shit-done → ez-agents}/bin/lib/circuit-breaker.cjs +118 -118
  20. package/{get-shit-done → ez-agents}/bin/lib/commands.cjs +666 -666
  21. package/{get-shit-done → ez-agents}/bin/lib/config.cjs +183 -183
  22. package/{get-shit-done → ez-agents}/bin/lib/core.cjs +495 -495
  23. package/{get-shit-done → ez-agents}/bin/lib/file-lock.cjs +236 -236
  24. package/{get-shit-done → ez-agents}/bin/lib/frontmatter.cjs +299 -299
  25. package/{get-shit-done → ez-agents}/bin/lib/fs-utils.cjs +153 -153
  26. package/{get-shit-done → ez-agents}/bin/lib/git-utils.cjs +203 -203
  27. package/{get-shit-done → ez-agents}/bin/lib/health-check.cjs +163 -163
  28. package/{get-shit-done → ez-agents}/bin/lib/index.cjs +113 -113
  29. package/{get-shit-done → ez-agents}/bin/lib/init.cjs +710 -710
  30. package/{get-shit-done → ez-agents}/bin/lib/logger.cjs +117 -117
  31. package/{get-shit-done → ez-agents}/bin/lib/milestone.cjs +241 -241
  32. package/{get-shit-done → ez-agents}/bin/lib/model-provider.cjs +146 -146
  33. package/{get-shit-done → ez-agents}/bin/lib/phase.cjs +908 -908
  34. package/{get-shit-done → ez-agents}/bin/lib/retry.cjs +119 -119
  35. package/{get-shit-done → ez-agents}/bin/lib/roadmap.cjs +305 -305
  36. package/{get-shit-done → ez-agents}/bin/lib/safe-exec.cjs +128 -128
  37. package/{get-shit-done → ez-agents}/bin/lib/safe-path.cjs +130 -130
  38. package/{get-shit-done → ez-agents}/bin/lib/state.cjs +721 -721
  39. package/{get-shit-done → ez-agents}/bin/lib/temp-file.cjs +239 -239
  40. package/{get-shit-done → ez-agents}/bin/lib/template.cjs +222 -222
  41. package/{get-shit-done → ez-agents}/bin/lib/test-file-lock.cjs +112 -112
  42. package/{get-shit-done → ez-agents}/bin/lib/test-graceful.cjs +93 -93
  43. package/{get-shit-done → ez-agents}/bin/lib/test-logger.cjs +60 -60
  44. package/{get-shit-done → ez-agents}/bin/lib/test-safe-exec.cjs +38 -38
  45. package/{get-shit-done → ez-agents}/bin/lib/test-safe-path.cjs +33 -33
  46. package/{get-shit-done → ez-agents}/bin/lib/test-temp-file.cjs +125 -125
  47. package/{get-shit-done → ez-agents}/bin/lib/timeout-exec.cjs +62 -62
  48. package/{get-shit-done → ez-agents}/bin/lib/verify.cjs +820 -820
  49. package/{get-shit-done → ez-agents}/references/checkpoints.md +776 -776
  50. package/{get-shit-done → ez-agents}/references/questioning.md +162 -162
  51. package/{get-shit-done → ez-agents}/references/tdd.md +263 -263
  52. package/{get-shit-done → ez-agents}/templates/codebase/concerns.md +310 -310
  53. package/{get-shit-done → ez-agents}/templates/codebase/conventions.md +307 -307
  54. package/{get-shit-done → ez-agents}/templates/codebase/integrations.md +280 -280
  55. package/{get-shit-done → ez-agents}/templates/codebase/stack.md +186 -186
  56. package/{get-shit-done → ez-agents}/templates/codebase/testing.md +480 -480
  57. package/{get-shit-done → ez-agents}/templates/config.json +37 -37
  58. package/{get-shit-done → ez-agents}/templates/continue-here.md +78 -78
  59. package/{get-shit-done → ez-agents}/templates/milestone-archive.md +123 -123
  60. package/{get-shit-done → ez-agents}/templates/milestone.md +115 -115
  61. package/{get-shit-done → ez-agents}/templates/requirements.md +231 -231
  62. package/{get-shit-done → ez-agents}/templates/research-project/ARCHITECTURE.md +204 -204
  63. package/{get-shit-done → ez-agents}/templates/research-project/FEATURES.md +147 -147
  64. package/{get-shit-done → ez-agents}/templates/research-project/PITFALLS.md +200 -200
  65. package/{get-shit-done → ez-agents}/templates/research-project/STACK.md +120 -120
  66. package/{get-shit-done → ez-agents}/templates/research-project/SUMMARY.md +170 -170
  67. package/{get-shit-done → ez-agents}/templates/retrospective.md +54 -54
  68. package/{get-shit-done → ez-agents}/templates/roadmap.md +202 -202
  69. package/{get-shit-done → ez-agents}/templates/summary-minimal.md +41 -41
  70. package/{get-shit-done → ez-agents}/templates/summary-standard.md +48 -48
  71. package/{get-shit-done → ez-agents}/templates/summary.md +248 -248
  72. package/{get-shit-done → ez-agents}/templates/user-setup.md +311 -311
  73. package/{get-shit-done → ez-agents}/templates/verification-report.md +322 -322
  74. package/{get-shit-done → ez-agents}/workflows/add-phase.md +112 -112
  75. package/{get-shit-done → ez-agents}/workflows/add-tests.md +351 -351
  76. package/{get-shit-done → ez-agents}/workflows/add-todo.md +158 -158
  77. package/{get-shit-done → ez-agents}/workflows/audit-milestone.md +332 -332
  78. package/{get-shit-done → ez-agents}/workflows/autonomous.md +743 -743
  79. package/{get-shit-done → ez-agents}/workflows/check-todos.md +177 -177
  80. package/{get-shit-done → ez-agents}/workflows/cleanup.md +152 -152
  81. package/{get-shit-done → ez-agents}/workflows/complete-milestone.md +766 -766
  82. package/ez-agents/workflows/debug.md +0 -0
  83. package/{get-shit-done → ez-agents}/workflows/diagnose-issues.md +219 -219
  84. package/{get-shit-done → ez-agents}/workflows/discovery-phase.md +289 -289
  85. package/{get-shit-done → ez-agents}/workflows/discuss-phase.md +762 -762
  86. package/{get-shit-done → ez-agents}/workflows/execute-phase.md +468 -468
  87. package/{get-shit-done → ez-agents}/workflows/execute-plan.md +483 -483
  88. package/{get-shit-done → ez-agents}/workflows/health.md +159 -159
  89. package/{get-shit-done → ez-agents}/workflows/help.md +492 -492
  90. package/{get-shit-done → ez-agents}/workflows/insert-phase.md +130 -130
  91. package/{get-shit-done → ez-agents}/workflows/list-phase-assumptions.md +178 -178
  92. package/{get-shit-done → ez-agents}/workflows/map-codebase.md +316 -316
  93. package/{get-shit-done → ez-agents}/workflows/new-milestone.md +384 -384
  94. package/{get-shit-done → ez-agents}/workflows/new-project.md +1111 -1111
  95. package/{get-shit-done → ez-agents}/workflows/node-repair.md +92 -92
  96. package/{get-shit-done → ez-agents}/workflows/pause-work.md +122 -122
  97. package/{get-shit-done → ez-agents}/workflows/plan-milestone-gaps.md +274 -274
  98. package/{get-shit-done → ez-agents}/workflows/plan-phase.md +651 -651
  99. package/{get-shit-done → ez-agents}/workflows/progress.md +382 -382
  100. package/{get-shit-done → ez-agents}/workflows/quick.md +610 -610
  101. package/{get-shit-done → ez-agents}/workflows/remove-phase.md +155 -155
  102. package/{get-shit-done → ez-agents}/workflows/research-phase.md +74 -74
  103. package/{get-shit-done → ez-agents}/workflows/resume-project.md +307 -307
  104. package/{get-shit-done → ez-agents}/workflows/set-profile.md +81 -81
  105. package/{get-shit-done → ez-agents}/workflows/settings.md +242 -242
  106. package/{get-shit-done → ez-agents}/workflows/stats.md +57 -57
  107. package/{get-shit-done → ez-agents}/workflows/transition.md +544 -544
  108. package/{get-shit-done → ez-agents}/workflows/ui-phase.md +290 -290
  109. package/{get-shit-done → ez-agents}/workflows/ui-review.md +157 -157
  110. package/{get-shit-done → ez-agents}/workflows/update.md +320 -320
  111. package/{get-shit-done → ez-agents}/workflows/validate-phase.md +167 -167
  112. package/{get-shit-done → ez-agents}/workflows/verify-phase.md +243 -243
  113. package/{get-shit-done → ez-agents}/workflows/verify-work.md +5 -5
  114. package/hooks/dist/ez-check-update.js +81 -0
  115. package/hooks/dist/ez-context-monitor.js +141 -0
  116. package/hooks/dist/ez-statusline.js +115 -0
  117. package/package.json +13 -3
  118. package/scripts/build-hooks.js +43 -43
  119. package/scripts/run-tests.cjs +29 -29
  120. /package/{get-shit-done → ez-agents}/references/continuation-format.md +0 -0
  121. /package/{get-shit-done → ez-agents}/references/decimal-phase-calculation.md +0 -0
  122. /package/{get-shit-done → ez-agents}/references/git-integration.md +0 -0
  123. /package/{get-shit-done → ez-agents}/references/git-planning-commit.md +0 -0
  124. /package/{get-shit-done → ez-agents}/references/model-profile-resolution.md +0 -0
  125. /package/{get-shit-done → ez-agents}/references/model-profiles.md +0 -0
  126. /package/{get-shit-done → ez-agents}/references/phase-argument-parsing.md +0 -0
  127. /package/{get-shit-done → ez-agents}/references/planning-config.md +0 -0
  128. /package/{get-shit-done → ez-agents}/references/ui-brand.md +0 -0
  129. /package/{get-shit-done → ez-agents}/references/verification-patterns.md +0 -0
  130. /package/{get-shit-done → ez-agents}/templates/DEBUG.md +0 -0
  131. /package/{get-shit-done → ez-agents}/templates/UAT.md +0 -0
  132. /package/{get-shit-done → ez-agents}/templates/UI-SPEC.md +0 -0
  133. /package/{get-shit-done → ez-agents}/templates/VALIDATION.md +0 -0
  134. /package/{get-shit-done → ez-agents}/templates/codebase/architecture.md +0 -0
  135. /package/{get-shit-done → ez-agents}/templates/codebase/structure.md +0 -0
  136. /package/{get-shit-done → ez-agents}/templates/context.md +0 -0
  137. /package/{get-shit-done → ez-agents}/templates/copilot-instructions.md +0 -0
  138. /package/{get-shit-done → ez-agents}/templates/debug-subagent-prompt.md +0 -0
  139. /package/{get-shit-done → ez-agents}/templates/discovery.md +0 -0
  140. /package/{get-shit-done → ez-agents}/templates/phase-prompt.md +0 -0
  141. /package/{get-shit-done → ez-agents}/templates/planner-subagent-prompt.md +0 -0
  142. /package/{get-shit-done → ez-agents}/templates/project.md +0 -0
  143. /package/{get-shit-done → ez-agents}/templates/research.md +0 -0
  144. /package/{get-shit-done → ez-agents}/templates/state.md +0 -0
  145. /package/{get-shit-done → ez-agents}/templates/summary-complex.md +0 -0
@@ -1,280 +1,280 @@
1
- # External Integrations Template
2
-
3
- Template for `.planning/codebase/INTEGRATIONS.md` - captures external service dependencies.
4
-
5
- **Purpose:** Document what external systems this codebase communicates with. Focused on "what lives outside our code that we depend on."
6
-
7
- ---
8
-
9
- ## File Template
10
-
11
- ```markdown
12
- # External Integrations
13
-
14
- **Analysis Date:** [YYYY-MM-DD]
15
-
16
- ## APIs & External Services
17
-
18
- **Payment Processing:**
19
- - [Service] - [What it's used for: e.g., "subscription billing, one-time payments"]
20
- - SDK/Client: [e.g., "stripe npm package v14.x"]
21
- - Auth: [e.g., "API key in STRIPE_SECRET_KEY env var"]
22
- - Endpoints used: [e.g., "checkout sessions, webhooks"]
23
-
24
- **Email/SMS:**
25
- - [Service] - [What it's used for: e.g., "transactional emails"]
26
- - SDK/Client: [e.g., "sendgrid/mail v8.x"]
27
- - Auth: [e.g., "API key in SENDGRID_API_KEY env var"]
28
- - Templates: [e.g., "managed in SendGrid dashboard"]
29
-
30
- **External APIs:**
31
- - [Service] - [What it's used for]
32
- - Integration method: [e.g., "REST API via fetch", "GraphQL client"]
33
- - Auth: [e.g., "OAuth2 token in AUTH_TOKEN env var"]
34
- - Rate limits: [if applicable]
35
-
36
- ## Data Storage
37
-
38
- **Databases:**
39
- - [Type/Provider] - [e.g., "PostgreSQL on Supabase"]
40
- - Connection: [e.g., "via DATABASE_URL env var"]
41
- - Client: [e.g., "Prisma ORM v5.x"]
42
- - Migrations: [e.g., "prisma migrate in migrations/"]
43
-
44
- **File Storage:**
45
- - [Service] - [e.g., "AWS S3 for user uploads"]
46
- - SDK/Client: [e.g., "@aws-sdk/client-s3"]
47
- - Auth: [e.g., "IAM credentials in AWS_* env vars"]
48
- - Buckets: [e.g., "prod-uploads, dev-uploads"]
49
-
50
- **Caching:**
51
- - [Service] - [e.g., "Redis for session storage"]
52
- - Connection: [e.g., "REDIS_URL env var"]
53
- - Client: [e.g., "ioredis v5.x"]
54
-
55
- ## Authentication & Identity
56
-
57
- **Auth Provider:**
58
- - [Service] - [e.g., "Supabase Auth", "Auth0", "custom JWT"]
59
- - Implementation: [e.g., "Supabase client SDK"]
60
- - Token storage: [e.g., "httpOnly cookies", "localStorage"]
61
- - Session management: [e.g., "JWT refresh tokens"]
62
-
63
- **OAuth Integrations:**
64
- - [Provider] - [e.g., "Google OAuth for sign-in"]
65
- - Credentials: [e.g., "GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET"]
66
- - Scopes: [e.g., "email, profile"]
67
-
68
- ## Monitoring & Observability
69
-
70
- **Error Tracking:**
71
- - [Service] - [e.g., "Sentry"]
72
- - DSN: [e.g., "SENTRY_DSN env var"]
73
- - Release tracking: [e.g., "via SENTRY_RELEASE"]
74
-
75
- **Analytics:**
76
- - [Service] - [e.g., "Mixpanel for product analytics"]
77
- - Token: [e.g., "MIXPANEL_TOKEN env var"]
78
- - Events tracked: [e.g., "user actions, page views"]
79
-
80
- **Logs:**
81
- - [Service] - [e.g., "CloudWatch", "Datadog", "none (stdout only)"]
82
- - Integration: [e.g., "AWS Lambda built-in"]
83
-
84
- ## CI/CD & Deployment
85
-
86
- **Hosting:**
87
- - [Platform] - [e.g., "Vercel", "AWS Lambda", "Docker on ECS"]
88
- - Deployment: [e.g., "automatic on main branch push"]
89
- - Environment vars: [e.g., "configured in Vercel dashboard"]
90
-
91
- **CI Pipeline:**
92
- - [Service] - [e.g., "GitHub Actions"]
93
- - Workflows: [e.g., "test.yml, deploy.yml"]
94
- - Secrets: [e.g., "stored in GitHub repo secrets"]
95
-
96
- ## Environment Configuration
97
-
98
- **Development:**
99
- - Required env vars: [List critical vars]
100
- - Secrets location: [e.g., ".env.local (gitignored)", "1Password vault"]
101
- - Mock/stub services: [e.g., "Stripe test mode", "local PostgreSQL"]
102
-
103
- **Staging:**
104
- - Environment-specific differences: [e.g., "uses staging Stripe account"]
105
- - Data: [e.g., "separate staging database"]
106
-
107
- **Production:**
108
- - Secrets management: [e.g., "Vercel environment variables"]
109
- - Failover/redundancy: [e.g., "multi-region DB replication"]
110
-
111
- ## Webhooks & Callbacks
112
-
113
- **Incoming:**
114
- - [Service] - [Endpoint: e.g., "/api/webhooks/stripe"]
115
- - Verification: [e.g., "signature validation via stripe.webhooks.constructEvent"]
116
- - Events: [e.g., "payment_intent.succeeded, customer.subscription.updated"]
117
-
118
- **Outgoing:**
119
- - [Service] - [What triggers it]
120
- - Endpoint: [e.g., "external CRM webhook on user signup"]
121
- - Retry logic: [if applicable]
122
-
123
- ---
124
-
125
- *Integration audit: [date]*
126
- *Update when adding/removing external services*
127
- ```
128
-
129
- <good_examples>
130
- ```markdown
131
- # External Integrations
132
-
133
- **Analysis Date:** 2025-01-20
134
-
135
- ## APIs & External Services
136
-
137
- **Payment Processing:**
138
- - Stripe - Subscription billing and one-time course payments
139
- - SDK/Client: stripe npm package v14.8
140
- - Auth: API key in STRIPE_SECRET_KEY env var
141
- - Endpoints used: checkout sessions, customer portal, webhooks
142
-
143
- **Email/SMS:**
144
- - SendGrid - Transactional emails (receipts, password resets)
145
- - SDK/Client: @sendgrid/mail v8.1
146
- - Auth: API key in SENDGRID_API_KEY env var
147
- - Templates: Managed in SendGrid dashboard (template IDs in code)
148
-
149
- **External APIs:**
150
- - OpenAI API - Course content generation
151
- - Integration method: REST API via openai npm package v4.x
152
- - Auth: Bearer token in OPENAI_API_KEY env var
153
- - Rate limits: 3500 requests/min (tier 3)
154
-
155
- ## Data Storage
156
-
157
- **Databases:**
158
- - PostgreSQL on Supabase - Primary data store
159
- - Connection: via DATABASE_URL env var
160
- - Client: Prisma ORM v5.8
161
- - Migrations: prisma migrate in prisma/migrations/
162
-
163
- **File Storage:**
164
- - Supabase Storage - User uploads (profile images, course materials)
165
- - SDK/Client: @supabase/supabase-js v2.x
166
- - Auth: Service role key in SUPABASE_SERVICE_ROLE_KEY
167
- - Buckets: avatars (public), course-materials (private)
168
-
169
- **Caching:**
170
- - None currently (all database queries, no Redis)
171
-
172
- ## Authentication & Identity
173
-
174
- **Auth Provider:**
175
- - Supabase Auth - Email/password + OAuth
176
- - Implementation: Supabase client SDK with server-side session management
177
- - Token storage: httpOnly cookies via @supabase/ssr
178
- - Session management: JWT refresh tokens handled by Supabase
179
-
180
- **OAuth Integrations:**
181
- - Google OAuth - Social sign-in
182
- - Credentials: GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET (Supabase dashboard)
183
- - Scopes: email, profile
184
-
185
- ## Monitoring & Observability
186
-
187
- **Error Tracking:**
188
- - Sentry - Server and client errors
189
- - DSN: SENTRY_DSN env var
190
- - Release tracking: Git commit SHA via SENTRY_RELEASE
191
-
192
- **Analytics:**
193
- - None (planned: Mixpanel)
194
-
195
- **Logs:**
196
- - Vercel logs - stdout/stderr only
197
- - Retention: 7 days on Pro plan
198
-
199
- ## CI/CD & Deployment
200
-
201
- **Hosting:**
202
- - Vercel - Next.js app hosting
203
- - Deployment: Automatic on main branch push
204
- - Environment vars: Configured in Vercel dashboard (synced to .env.example)
205
-
206
- **CI Pipeline:**
207
- - GitHub Actions - Tests and type checking
208
- - Workflows: .github/workflows/ci.yml
209
- - Secrets: None needed (public repo tests only)
210
-
211
- ## Environment Configuration
212
-
213
- **Development:**
214
- - Required env vars: DATABASE_URL, NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY
215
- - Secrets location: .env.local (gitignored), team shared via 1Password vault
216
- - Mock/stub services: Stripe test mode, Supabase local dev project
217
-
218
- **Staging:**
219
- - Uses separate Supabase staging project
220
- - Stripe test mode
221
- - Same Vercel account, different environment
222
-
223
- **Production:**
224
- - Secrets management: Vercel environment variables
225
- - Database: Supabase production project with daily backups
226
-
227
- ## Webhooks & Callbacks
228
-
229
- **Incoming:**
230
- - Stripe - /api/webhooks/stripe
231
- - Verification: Signature validation via stripe.webhooks.constructEvent
232
- - Events: payment_intent.succeeded, customer.subscription.updated, customer.subscription.deleted
233
-
234
- **Outgoing:**
235
- - None
236
-
237
- ---
238
-
239
- *Integration audit: 2025-01-20*
240
- *Update when adding/removing external services*
241
- ```
242
- </good_examples>
243
-
244
- <guidelines>
245
- **What belongs in INTEGRATIONS.md:**
246
- - External services the code communicates with
247
- - Authentication patterns (where secrets live, not the secrets themselves)
248
- - SDKs and client libraries used
249
- - Environment variable names (not values)
250
- - Webhook endpoints and verification methods
251
- - Database connection patterns
252
- - File storage locations
253
- - Monitoring and logging services
254
-
255
- **What does NOT belong here:**
256
- - Actual API keys or secrets (NEVER write these)
257
- - Internal architecture (that's ARCHITECTURE.md)
258
- - Code patterns (that's PATTERNS.md)
259
- - Technology choices (that's STACK.md)
260
- - Performance issues (that's CONCERNS.md)
261
-
262
- **When filling this template:**
263
- - Check .env.example or .env.template for required env vars
264
- - Look for SDK imports (stripe, @sendgrid/mail, etc.)
265
- - Check for webhook handlers in routes/endpoints
266
- - Note where secrets are managed (not the secrets)
267
- - Document environment-specific differences (dev/staging/prod)
268
- - Include auth patterns for each service
269
-
270
- **Useful for phase planning when:**
271
- - Adding new external service integrations
272
- - Debugging authentication issues
273
- - Understanding data flow outside the application
274
- - Setting up new environments
275
- - Auditing third-party dependencies
276
- - Planning for service outages or migrations
277
-
278
- **Security note:**
279
- Document WHERE secrets live (env vars, Vercel dashboard, 1Password), never WHAT the secrets are.
280
- </guidelines>
1
+ # External Integrations Template
2
+
3
+ Template for `.planning/codebase/INTEGRATIONS.md` - captures external service dependencies.
4
+
5
+ **Purpose:** Document what external systems this codebase communicates with. Focused on "what lives outside our code that we depend on."
6
+
7
+ ---
8
+
9
+ ## File Template
10
+
11
+ ```markdown
12
+ # External Integrations
13
+
14
+ **Analysis Date:** [YYYY-MM-DD]
15
+
16
+ ## APIs & External Services
17
+
18
+ **Payment Processing:**
19
+ - [Service] - [What it's used for: e.g., "subscription billing, one-time payments"]
20
+ - SDK/Client: [e.g., "stripe npm package v14.x"]
21
+ - Auth: [e.g., "API key in STRIPE_SECRET_KEY env var"]
22
+ - Endpoints used: [e.g., "checkout sessions, webhooks"]
23
+
24
+ **Email/SMS:**
25
+ - [Service] - [What it's used for: e.g., "transactional emails"]
26
+ - SDK/Client: [e.g., "sendgrid/mail v8.x"]
27
+ - Auth: [e.g., "API key in SENDGRID_API_KEY env var"]
28
+ - Templates: [e.g., "managed in SendGrid dashboard"]
29
+
30
+ **External APIs:**
31
+ - [Service] - [What it's used for]
32
+ - Integration method: [e.g., "REST API via fetch", "GraphQL client"]
33
+ - Auth: [e.g., "OAuth2 token in AUTH_TOKEN env var"]
34
+ - Rate limits: [if applicable]
35
+
36
+ ## Data Storage
37
+
38
+ **Databases:**
39
+ - [Type/Provider] - [e.g., "PostgreSQL on Supabase"]
40
+ - Connection: [e.g., "via DATABASE_URL env var"]
41
+ - Client: [e.g., "Prisma ORM v5.x"]
42
+ - Migrations: [e.g., "prisma migrate in migrations/"]
43
+
44
+ **File Storage:**
45
+ - [Service] - [e.g., "AWS S3 for user uploads"]
46
+ - SDK/Client: [e.g., "@aws-sdk/client-s3"]
47
+ - Auth: [e.g., "IAM credentials in AWS_* env vars"]
48
+ - Buckets: [e.g., "prod-uploads, dev-uploads"]
49
+
50
+ **Caching:**
51
+ - [Service] - [e.g., "Redis for session storage"]
52
+ - Connection: [e.g., "REDIS_URL env var"]
53
+ - Client: [e.g., "ioredis v5.x"]
54
+
55
+ ## Authentication & Identity
56
+
57
+ **Auth Provider:**
58
+ - [Service] - [e.g., "Supabase Auth", "Auth0", "custom JWT"]
59
+ - Implementation: [e.g., "Supabase client SDK"]
60
+ - Token storage: [e.g., "httpOnly cookies", "localStorage"]
61
+ - Session management: [e.g., "JWT refresh tokens"]
62
+
63
+ **OAuth Integrations:**
64
+ - [Provider] - [e.g., "Google OAuth for sign-in"]
65
+ - Credentials: [e.g., "GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET"]
66
+ - Scopes: [e.g., "email, profile"]
67
+
68
+ ## Monitoring & Observability
69
+
70
+ **Error Tracking:**
71
+ - [Service] - [e.g., "Sentry"]
72
+ - DSN: [e.g., "SENTRY_DSN env var"]
73
+ - Release tracking: [e.g., "via SENTRY_RELEASE"]
74
+
75
+ **Analytics:**
76
+ - [Service] - [e.g., "Mixpanel for product analytics"]
77
+ - Token: [e.g., "MIXPANEL_TOKEN env var"]
78
+ - Events tracked: [e.g., "user actions, page views"]
79
+
80
+ **Logs:**
81
+ - [Service] - [e.g., "CloudWatch", "Datadog", "none (stdout only)"]
82
+ - Integration: [e.g., "AWS Lambda built-in"]
83
+
84
+ ## CI/CD & Deployment
85
+
86
+ **Hosting:**
87
+ - [Platform] - [e.g., "Vercel", "AWS Lambda", "Docker on ECS"]
88
+ - Deployment: [e.g., "automatic on main branch push"]
89
+ - Environment vars: [e.g., "configured in Vercel dashboard"]
90
+
91
+ **CI Pipeline:**
92
+ - [Service] - [e.g., "GitHub Actions"]
93
+ - Workflows: [e.g., "test.yml, deploy.yml"]
94
+ - Secrets: [e.g., "stored in GitHub repo secrets"]
95
+
96
+ ## Environment Configuration
97
+
98
+ **Development:**
99
+ - Required env vars: [List critical vars]
100
+ - Secrets location: [e.g., ".env.local (gitignored)", "1Password vault"]
101
+ - Mock/stub services: [e.g., "Stripe test mode", "local PostgreSQL"]
102
+
103
+ **Staging:**
104
+ - Environment-specific differences: [e.g., "uses staging Stripe account"]
105
+ - Data: [e.g., "separate staging database"]
106
+
107
+ **Production:**
108
+ - Secrets management: [e.g., "Vercel environment variables"]
109
+ - Failover/redundancy: [e.g., "multi-region DB replication"]
110
+
111
+ ## Webhooks & Callbacks
112
+
113
+ **Incoming:**
114
+ - [Service] - [Endpoint: e.g., "/api/webhooks/stripe"]
115
+ - Verification: [e.g., "signature validation via stripe.webhooks.constructEvent"]
116
+ - Events: [e.g., "payment_intent.succeeded, customer.subscription.updated"]
117
+
118
+ **Outgoing:**
119
+ - [Service] - [What triggers it]
120
+ - Endpoint: [e.g., "external CRM webhook on user signup"]
121
+ - Retry logic: [if applicable]
122
+
123
+ ---
124
+
125
+ *Integration audit: [date]*
126
+ *Update when adding/removing external services*
127
+ ```
128
+
129
+ <good_examples>
130
+ ```markdown
131
+ # External Integrations
132
+
133
+ **Analysis Date:** 2025-01-20
134
+
135
+ ## APIs & External Services
136
+
137
+ **Payment Processing:**
138
+ - Stripe - Subscription billing and one-time course payments
139
+ - SDK/Client: stripe npm package v14.8
140
+ - Auth: API key in STRIPE_SECRET_KEY env var
141
+ - Endpoints used: checkout sessions, customer portal, webhooks
142
+
143
+ **Email/SMS:**
144
+ - SendGrid - Transactional emails (receipts, password resets)
145
+ - SDK/Client: @sendgrid/mail v8.1
146
+ - Auth: API key in SENDGRID_API_KEY env var
147
+ - Templates: Managed in SendGrid dashboard (template IDs in code)
148
+
149
+ **External APIs:**
150
+ - OpenAI API - Course content generation
151
+ - Integration method: REST API via openai npm package v4.x
152
+ - Auth: Bearer token in OPENAI_API_KEY env var
153
+ - Rate limits: 3500 requests/min (tier 3)
154
+
155
+ ## Data Storage
156
+
157
+ **Databases:**
158
+ - PostgreSQL on Supabase - Primary data store
159
+ - Connection: via DATABASE_URL env var
160
+ - Client: Prisma ORM v5.8
161
+ - Migrations: prisma migrate in prisma/migrations/
162
+
163
+ **File Storage:**
164
+ - Supabase Storage - User uploads (profile images, course materials)
165
+ - SDK/Client: @supabase/supabase-js v2.x
166
+ - Auth: Service role key in SUPABASE_SERVICE_ROLE_KEY
167
+ - Buckets: avatars (public), course-materials (private)
168
+
169
+ **Caching:**
170
+ - None currently (all database queries, no Redis)
171
+
172
+ ## Authentication & Identity
173
+
174
+ **Auth Provider:**
175
+ - Supabase Auth - Email/password + OAuth
176
+ - Implementation: Supabase client SDK with server-side session management
177
+ - Token storage: httpOnly cookies via @supabase/ssr
178
+ - Session management: JWT refresh tokens handled by Supabase
179
+
180
+ **OAuth Integrations:**
181
+ - Google OAuth - Social sign-in
182
+ - Credentials: GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET (Supabase dashboard)
183
+ - Scopes: email, profile
184
+
185
+ ## Monitoring & Observability
186
+
187
+ **Error Tracking:**
188
+ - Sentry - Server and client errors
189
+ - DSN: SENTRY_DSN env var
190
+ - Release tracking: Git commit SHA via SENTRY_RELEASE
191
+
192
+ **Analytics:**
193
+ - None (planned: Mixpanel)
194
+
195
+ **Logs:**
196
+ - Vercel logs - stdout/stderr only
197
+ - Retention: 7 days on Pro plan
198
+
199
+ ## CI/CD & Deployment
200
+
201
+ **Hosting:**
202
+ - Vercel - Next.js app hosting
203
+ - Deployment: Automatic on main branch push
204
+ - Environment vars: Configured in Vercel dashboard (synced to .env.example)
205
+
206
+ **CI Pipeline:**
207
+ - GitHub Actions - Tests and type checking
208
+ - Workflows: .github/workflows/ci.yml
209
+ - Secrets: None needed (public repo tests only)
210
+
211
+ ## Environment Configuration
212
+
213
+ **Development:**
214
+ - Required env vars: DATABASE_URL, NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY
215
+ - Secrets location: .env.local (gitignored), team shared via 1Password vault
216
+ - Mock/stub services: Stripe test mode, Supabase local dev project
217
+
218
+ **Staging:**
219
+ - Uses separate Supabase staging project
220
+ - Stripe test mode
221
+ - Same Vercel account, different environment
222
+
223
+ **Production:**
224
+ - Secrets management: Vercel environment variables
225
+ - Database: Supabase production project with daily backups
226
+
227
+ ## Webhooks & Callbacks
228
+
229
+ **Incoming:**
230
+ - Stripe - /api/webhooks/stripe
231
+ - Verification: Signature validation via stripe.webhooks.constructEvent
232
+ - Events: payment_intent.succeeded, customer.subscription.updated, customer.subscription.deleted
233
+
234
+ **Outgoing:**
235
+ - None
236
+
237
+ ---
238
+
239
+ *Integration audit: 2025-01-20*
240
+ *Update when adding/removing external services*
241
+ ```
242
+ </good_examples>
243
+
244
+ <guidelines>
245
+ **What belongs in INTEGRATIONS.md:**
246
+ - External services the code communicates with
247
+ - Authentication patterns (where secrets live, not the secrets themselves)
248
+ - SDKs and client libraries used
249
+ - Environment variable names (not values)
250
+ - Webhook endpoints and verification methods
251
+ - Database connection patterns
252
+ - File storage locations
253
+ - Monitoring and logging services
254
+
255
+ **What does NOT belong here:**
256
+ - Actual API keys or secrets (NEVER write these)
257
+ - Internal architecture (that's ARCHITECTURE.md)
258
+ - Code patterns (that's PATTERNS.md)
259
+ - Technology choices (that's STACK.md)
260
+ - Performance issues (that's CONCERNS.md)
261
+
262
+ **When filling this template:**
263
+ - Check .env.example or .env.template for required env vars
264
+ - Look for SDK imports (stripe, @sendgrid/mail, etc.)
265
+ - Check for webhook handlers in routes/endpoints
266
+ - Note where secrets are managed (not the secrets)
267
+ - Document environment-specific differences (dev/staging/prod)
268
+ - Include auth patterns for each service
269
+
270
+ **Useful for phase planning when:**
271
+ - Adding new external service integrations
272
+ - Debugging authentication issues
273
+ - Understanding data flow outside the application
274
+ - Setting up new environments
275
+ - Auditing third-party dependencies
276
+ - Planning for service outages or migrations
277
+
278
+ **Security note:**
279
+ Document WHERE secrets live (env vars, Vercel dashboard, 1Password), never WHAT the secrets are.
280
+ </guidelines>