@cofoundr/init 1.5.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 (74) hide show
  1. package/README.md +140 -0
  2. package/bin/cofoundr.mjs +10 -0
  3. package/content/.claude-plugin/plugin.json +18 -0
  4. package/content/README.md +227 -0
  5. package/content/agents/brand-intake.md +129 -0
  6. package/content/agents/consolidate.md +154 -0
  7. package/content/agents/launch-kit-detect.md +109 -0
  8. package/content/agents/spec-phase.md +131 -0
  9. package/content/commands/audit.md +137 -0
  10. package/content/commands/constitution.md +107 -0
  11. package/content/commands/document.md +155 -0
  12. package/content/commands/implement.md +108 -0
  13. package/content/commands/new-feature.md +188 -0
  14. package/content/commands/new-project.md +243 -0
  15. package/content/commands/next.md +129 -0
  16. package/content/commands/onboard.md +176 -0
  17. package/content/commands/plan.md +138 -0
  18. package/content/commands/quick-brief.md +95 -0
  19. package/content/commands/resume.md +99 -0
  20. package/content/commands/review.md +76 -0
  21. package/content/commands/rules-check.md +54 -0
  22. package/content/commands/scope-guard.md +33 -0
  23. package/content/commands/setup-skills.md +109 -0
  24. package/content/commands/specify.md +53 -0
  25. package/content/commands/tasks.md +91 -0
  26. package/content/commands/translate.md +197 -0
  27. package/content/manifest.json +59 -0
  28. package/content/scaffold/.cofoundr/README.md +67 -0
  29. package/content/scaffold/.cofoundr/constitution.md.tmpl +54 -0
  30. package/content/scaffold/.cofoundr/manifest.json.tmpl +15 -0
  31. package/content/scaffold/.cofoundr/memory/decisions.md.tmpl +19 -0
  32. package/content/scaffold/.cofoundr/memory/knowledge.md.tmpl +23 -0
  33. package/content/scaffold/.cofoundr/memory/project.md.tmpl +27 -0
  34. package/content/scaffold/.cofoundr/specs/README.md +38 -0
  35. package/content/scaffold/AGENTS.md.tmpl +74 -0
  36. package/content/templates/agents.md +144 -0
  37. package/content/templates/brand.md +180 -0
  38. package/content/templates/feature.md +70 -0
  39. package/content/templates/phases/phase-template/README.md +65 -0
  40. package/content/templates/phases/phase-template/decisions.md +52 -0
  41. package/content/templates/phases/phase-template/research.md +59 -0
  42. package/content/templates/phases/phase-template/spec.md +90 -0
  43. package/content/templates/phases/phase-template/tests.md +65 -0
  44. package/content/templates/phases/phase-template/ui-spec.md +75 -0
  45. package/content/templates/phases.md +234 -0
  46. package/content/templates/prd.md +89 -0
  47. package/content/templates/product.md +73 -0
  48. package/content/templates/rules.md +99 -0
  49. package/content/templates/tech.md +129 -0
  50. package/package.json +39 -0
  51. package/src/adapters/aider.mjs +35 -0
  52. package/src/adapters/claude-code.mjs +114 -0
  53. package/src/adapters/cline.mjs +46 -0
  54. package/src/adapters/codex.mjs +29 -0
  55. package/src/adapters/copilot.mjs +54 -0
  56. package/src/adapters/cursor.mjs +69 -0
  57. package/src/adapters/gemini.mjs +41 -0
  58. package/src/adapters/index.mjs +14 -0
  59. package/src/adapters/windsurf.mjs +69 -0
  60. package/src/cli.mjs +124 -0
  61. package/src/commands/doctor.mjs +90 -0
  62. package/src/commands/init.mjs +190 -0
  63. package/src/commands/list.mjs +28 -0
  64. package/src/commands/onboard.mjs +130 -0
  65. package/src/commands/remove.mjs +89 -0
  66. package/src/commands/sync.mjs +81 -0
  67. package/src/core/detect.mjs +121 -0
  68. package/src/core/fs.mjs +42 -0
  69. package/src/core/license.mjs +170 -0
  70. package/src/core/log.mjs +32 -0
  71. package/src/core/prompts.mjs +62 -0
  72. package/src/core/scaffold.mjs +179 -0
  73. package/src/core/source.mjs +54 -0
  74. package/src/core/version.mjs +10 -0
@@ -0,0 +1,90 @@
1
+ ---
2
+ description: >
3
+ Technical spec for Phase [N]. Source of truth for the AI during build.
4
+ Every section must be concrete enough that an AI coding agent can build
5
+ from it without guessing. Generated by /cofoundr:next during planning.
6
+ ---
7
+
8
+ # Phase [N] — Technical Spec
9
+
10
+ ## TL;DR
11
+ <!-- ≤60 words. The technical summary: what data moves, what surfaces are built, what integrations are touched. -->
12
+
13
+ ---
14
+
15
+ ## Data model
16
+
17
+ <!-- New tables, column additions to existing tables, and RLS policies. Use plain SQL CREATE TABLE. Every table must have id, created_at, updated_at, and owner-scoping columns. Every table must have RLS policies listed in pseudocode. Reference tech.md for the project-wide conventions rather than restating them. -->
18
+
19
+ ```sql
20
+ -- New table example
21
+ create table [name] (
22
+ id uuid primary key default gen_random_uuid(),
23
+ account_id uuid not null references accounts(id) on delete cascade,
24
+ created_at timestamptz not null default now(),
25
+ updated_at timestamptz not null default now()
26
+ );
27
+
28
+ -- RLS
29
+ alter table [name] enable row level security;
30
+ -- policy: owners can select/update their own rows
31
+ -- policy: service role can insert
32
+ ```
33
+
34
+ ## API endpoints
35
+
36
+ <!-- One row per endpoint. Include method, path, auth requirement, request shape, success response, error cases. If Launch Kit, reference enhanceRouteHandler and authActionClient patterns from tech.md rather than restating them. -->
37
+
38
+ ### POST /api/[path]
39
+
40
+ - **Auth:** [user | service-role | public]
41
+ - **Request:** `{ field: type, ... }`
42
+ - **Success:** `200 { ... }`
43
+ - **Errors:** `401 unauthorized`, `403 forbidden`, `422 validation`, `5xx server`
44
+
45
+ ---
46
+
47
+ ## External integrations
48
+
49
+ <!-- Third-party services this phase calls. For each: the service, the exact endpoint or SDK method, auth mechanism, rate limits or cost envelope, and how failure is handled. -->
50
+
51
+ - **Service:** ...
52
+ - Endpoints used: ...
53
+ - Auth: ...
54
+ - Rate limits: ...
55
+ - Failure mode: ...
56
+
57
+ ## Server-side logic
58
+
59
+ <!-- Server actions, background jobs, cron schedules, webhook handlers. For each, name the trigger, the inputs, the outputs, and the side effects. -->
60
+
61
+ - ...
62
+
63
+ ## Client-side surfaces
64
+
65
+ <!-- New routes, new components, state changes. For each route: path, loaders, protected-vs-public. Reference ui-spec.md for visual detail; this file covers data flow and state shape. -->
66
+
67
+ - **Route:** `/[path]` — purpose, auth, data loaded
68
+
69
+ ## Security
70
+
71
+ <!-- New attack surface introduced by this phase and how it's handled. Never-class items from rules.md that apply. Specific things like: token encryption, CSRF, magic-byte validation, RLS coverage, rate limiting. -->
72
+
73
+ - ...
74
+
75
+ ## Feature flags and rollout
76
+
77
+ <!-- Which parts ship behind a flag and why. If nothing is flagged, say so and justify. -->
78
+
79
+ - ...
80
+
81
+ ## Observability
82
+
83
+ <!-- What we log, what we alert on, what we want to see in a dashboard. Keep it scoped to this phase's surface. -->
84
+
85
+ - Log: ...
86
+ - Alert: ...
87
+
88
+ ---
89
+
90
+ <!-- When spec.md is complete, ui-spec.md starts. This file should be concrete enough that the AI can build it without re-asking design questions. -->
@@ -0,0 +1,65 @@
1
+ ---
2
+ description: >
3
+ Test plan for Phase [N]. Happy path, edge cases, errors, security, and
4
+ performance budgets. Written before code so the AI has an explicit target.
5
+ Generated by /cofoundr:next during planning.
6
+ ---
7
+
8
+ # Phase [N] — Tests
9
+
10
+ ## TL;DR
11
+ <!-- ≤60 words. The one end-to-end flow a founder will click through to decide this phase is done, plus the highest-risk edge case we're covering. -->
12
+
13
+ ---
14
+
15
+ ## Happy path
16
+
17
+ <!-- Step-by-step walkthrough of the primary success flow. Numbered steps, each with the action and the observable outcome. A founder should be able to follow this in the browser and tick each step. -->
18
+
19
+ 1. Action: ... → Observable: ...
20
+ 2. Action: ... → Observable: ...
21
+ 3. Action: ... → Observable: ...
22
+
23
+ ## Edge cases
24
+
25
+ <!-- Unusual but realistic situations the user might encounter. Each edge case names the scenario and the expected behavior. -->
26
+
27
+ - **Scenario:** ... → **Expected:** ...
28
+ - **Scenario:** ... → **Expected:** ...
29
+
30
+ ## Error cases
31
+
32
+ <!-- What the user sees when things fail. Cover at minimum: network failure, third-party API failure, validation failure, auth failure. Error messages should match copy in ui-spec.md. -->
33
+
34
+ - **Network fails:** ...
35
+ - **Third-party fails:** ...
36
+ - **Validation fails:** ...
37
+ - **Unauthorized:** ...
38
+
39
+ ## Security
40
+
41
+ <!-- Tests that prove the security posture in spec.md holds. RLS prevents cross-account reads, auth gates endpoints, validation rejects malformed input, secrets never appear in client responses or logs. -->
42
+
43
+ - [ ] RLS: user A cannot see user B's rows.
44
+ - [ ] Auth: unauthenticated request to protected endpoint returns 401.
45
+ - [ ] Validation: malformed request returns 422 with a readable error.
46
+ - [ ] Secrets: grep the built bundle for known secret names — none appear.
47
+
48
+ ## Performance budget
49
+
50
+ <!-- Latency and resource targets for the primary flows in this phase. Cite a measurement method (e.g. Chrome DevTools, Vercel analytics). -->
51
+
52
+ - Primary flow [name]: budget [N]ms p95
53
+ - Load: budget [N]ms TTFB on landing
54
+
55
+ ## Manual checklist
56
+
57
+ <!-- The condensed founder-visible tick list. Extracted from happy path + error cases. Built to be run top-to-bottom in a browser without reading anything else in this folder. -->
58
+
59
+ - [ ] ...
60
+ - [ ] ...
61
+ - [ ] ...
62
+
63
+ ---
64
+
65
+ <!-- When tests.md is complete, the phase can be marked buildable. During build, the <verify> lines in tasks reference this file's checklists. -->
@@ -0,0 +1,75 @@
1
+ ---
2
+ description: >
3
+ UI spec for Phase [N]. Screens, states, copy, and brand tokens. Written
4
+ before any component is built. Reads brand.md for tokens and product.md
5
+ for voice. Generated by /cofoundr:next during planning.
6
+ ---
7
+
8
+ # Phase [N] — UI Spec
9
+
10
+ ## TL;DR
11
+ <!-- ≤60 words. Which screens this phase ships and the one UX principle that guides every decision inside them. -->
12
+
13
+ ---
14
+
15
+ ## Screens
16
+
17
+ <!-- One subsection per screen. List route, purpose, entry points, exit points, primary action. -->
18
+
19
+ ### Screen: [Name] — `/[route]`
20
+
21
+ - **Purpose:** ...
22
+ - **Entry points:** ...
23
+ - **Exit points:** ...
24
+ - **Primary action:** ...
25
+
26
+ #### States
27
+
28
+ <!-- Every screen has at minimum: loading, empty, ready, error. List any additional states specific to this screen. For each state, describe what the user sees. -->
29
+
30
+ - **Loading:** ...
31
+ - **Empty:** ...
32
+ - **Ready:** ...
33
+ - **Error:** ...
34
+
35
+ #### Copy
36
+
37
+ <!-- Exact strings the user will read. Headings, body copy, button labels, empty-state copy, error messages. These should match the voice defined in brand.md. -->
38
+
39
+ - Heading: "..."
40
+ - Body: "..."
41
+ - Primary button: "..."
42
+ - Empty state: "..."
43
+ - Error: "..."
44
+
45
+ #### Components used
46
+
47
+ <!-- List the components this screen composes. If Launch Kit, reference the kit's shadcn/ui components by name. If custom, note that a new component is needed. -->
48
+
49
+ - ...
50
+
51
+ ---
52
+
53
+ ## Brand token usage
54
+
55
+ <!-- Explicit references to brand.md tokens used on these screens. No hardcoded colors, fonts, or spacing. If brand.md doesn't exist yet, flag that /cofoundr:next brand is required before this phase can be fully spec'd. -->
56
+
57
+ - **Accent color:** `brand.accent` — used on [elements]
58
+ - **Heading type:** `brand.type.heading` — used on [elements]
59
+ - **Spacing scale:** `brand.spacing` — used throughout
60
+
61
+ ## Responsive behavior
62
+
63
+ <!-- Minimum breakpoints to support. Which parts collapse or reflow. Mobile-first if no reason to do otherwise. -->
64
+
65
+ - ...
66
+
67
+ ## Accessibility
68
+
69
+ <!-- Keyboard navigation path, focus order, screen-reader landmarks, color-contrast notes, any aria-* requirements for interactive states. -->
70
+
71
+ - ...
72
+
73
+ ---
74
+
75
+ <!-- When ui-spec.md is complete, research.md is next. The AI should be able to build every screen from this file without asking design questions during the build. -->
@@ -0,0 +1,234 @@
1
+ # Build Phases
2
+
3
+ <!-- HOW-TO: This is your build roadmap. Phases are grouped into milestones — each milestone is a shippable product increment. Within each phase, tasks are scoped to ≤45 minutes. The AI works through these in order. Every task has a verify block so you know when it's actually done — not "I think it's done" but "here's the observable proof." -->
4
+
5
+ ## TL;DR
6
+
7
+ <!-- HOW-TO: ≤60 words. Name the milestones, the phases within each, and the core user flow that Milestone 1 delivers. -->
8
+
9
+ *Two milestones. Milestone 1 (MVP): Phase 0 sets up the repo, auth, and database; Phase 1 delivers the core loop — connect Slack, trigger a morning pull, see a prioritized daily list. Milestone 2 (Growth): Phase 2 adds the second integration. Each task is ≤45 minutes with a verify checkpoint.*
10
+
11
+ ## Milestone Summary
12
+
13
+ <!-- HOW-TO: One row per milestone. The Success Condition is what the founder can see or measure in their browser when the milestone is complete — not a technical definition of done. -->
14
+
15
+ | Milestone | Phases | Goal | Success Condition |
16
+ |-----------|--------|------|-------------------|
17
+ | *Milestone 1 — MVP* | *Phase 0, Phase 1* | *Working product with the core loop* | *A real user can connect Slack, receive a morning pull, and interact with their task list* |
18
+ | *Milestone 2 — Growth* | *Phase 2* | *Second integration live* | *User can connect Trello or Linear and see tasks from both sources in one list* |
19
+
20
+ ---
21
+
22
+ ## Milestone 1 — MVP
23
+
24
+ **Goal:** *Working product that delivers the core user value end-to-end.*
25
+ **Success condition:** *A real user can connect Slack, receive a morning pull, and interact with their task list on the production URL.*
26
+
27
+ ---
28
+
29
+ ## Phase 0 — Project Setup + Auth
30
+
31
+ <!-- HOW-TO: This phase is MANDATORY. Every project starts here. Do not skip to features. The number one AI-build failure mode is jumping straight to feature code without a committed, authenticated, deployable skeleton. -->
32
+
33
+ **Goal:** *Deployable skeleton with auth, database schema, and CI — zero features, fully working.*
34
+
35
+ ### Task 0.1 — Initialize repository
36
+
37
+ **Files:** `.gitignore`, `package.json`, `.env.example`, `tsconfig.json`
38
+
39
+ - [ ] Create Next.js 15 App Router project with TypeScript strict mode
40
+ - [ ] Add `.env*` and `*.local` to `.gitignore`
41
+ - [ ] Create `.env.example` with placeholder keys (no real values)
42
+ - [ ] Commit initial state
43
+
44
+ <verify>Git repo exists with initial commit. `npx next build` succeeds. `.env` is gitignored. `.env.example` lists every required variable.</verify>
45
+
46
+ ### Task 0.2 — Set up Supabase + schema
47
+
48
+ **Files:** `supabase/migrations/001_initial.sql`, `src/lib/supabase.ts`
49
+
50
+ - [ ] Create Supabase project and link to local dev
51
+ - [ ] Run the CREATE TABLE statements from `tech.md`
52
+ - [ ] Verify RLS policies are active on all tables
53
+ - [ ] Create Supabase client utilities (browser + server)
54
+ - [ ] Commit
55
+
56
+ <verify>Running `supabase db reset` succeeds. All tables exist with RLS enabled. `SELECT * FROM profiles` returns empty (not an error).</verify>
57
+
58
+ ### Task 0.3 — Set up authentication
59
+
60
+ **Files:** `src/app/login/page.tsx`, `src/app/auth/callback/route.ts`, `src/middleware.ts`
61
+
62
+ - [ ] Implement Supabase Auth with email/password login
63
+ - [ ] Add auth middleware to protect all routes except `/login`
64
+ - [ ] Create login page with form and error handling
65
+ - [ ] Create auth callback route for email confirmation
66
+ - [ ] Commit
67
+
68
+ <verify>User can sign up, receive confirmation email, confirm, and log in. Visiting `/` while logged out redirects to `/login`. Visiting `/login` while logged in redirects to `/`.</verify>
69
+
70
+ ### Task 0.4 — Deploy skeleton to Vercel
71
+
72
+ **Files:** `vercel.json` (if needed)
73
+
74
+ - [ ] Connect repo to Vercel
75
+ - [ ] Add environment variables to Vercel dashboard
76
+ - [ ] Deploy and verify auth works on production URL
77
+ - [ ] Commit any deployment-related config changes
78
+
79
+ <verify>Production URL loads login page. Sign-up and login work on the deployed URL, not just localhost.</verify>
80
+
81
+ **Phase 0 success criteria:**
82
+ - *Git repo with 4+ commits*
83
+ - *Auth flow works end-to-end on production URL*
84
+ - *Database schema matches `tech.md` with RLS active*
85
+ - *No secrets in git history*
86
+
87
+ **⛔ HALT — stop and ask the human if:**
88
+ - 3 consecutive tasks in this phase fail (something is wrong with the environment, not your code)
89
+ - Supabase project creation fails or RLS policies won't enable
90
+ - The tech stack in `tech.md` conflicts with the founder's hosting environment
91
+
92
+ ---
93
+
94
+ ## Phase 1 — One End-to-End Happy Path
95
+
96
+ <!-- HOW-TO: This phase is MANDATORY. Pick the single most important user flow from your P0 features and build it end-to-end. "End-to-end" means: the user can do the thing, see the result, and come back tomorrow and see it persisted. Resist the urge to build two half-features instead of one complete one. -->
97
+
98
+ **Goal:** *A user can connect Slack, trigger a pull, and see a prioritized daily task list — the core product loop, fully working.*
99
+
100
+ ### Boundary Map
101
+
102
+ <!-- HOW-TO: List what this phase creates and what it depends on from prior phases. This prevents the next phase from accidentally rebuilding something this phase already built. Phase 0 doesn't need a boundary map because it has no prior phases to consume from. -->
103
+
104
+ | Produces | Consumes |
105
+ |----------|----------|
106
+ | *Slack OAuth flow (`/api/integrations/slack/`)* | *Auth system (Phase 0)* |
107
+ | *Pull engine + Inngest function (`/api/pull/`)* | *Database schema + RLS (Phase 0)* |
108
+ | *TaskList, TaskItem components* | *Supabase client utilities (Phase 0)* |
109
+ | *`tasks` table populated with real data* | *User profiles table (Phase 0)* |
110
+
111
+ ### Task 1.1 — Slack OAuth flow
112
+
113
+ **Files:** `src/app/api/integrations/slack/connect/route.ts`, `src/app/api/integrations/slack/callback/route.ts`, `src/app/settings/page.tsx`
114
+
115
+ - [ ] Implement Slack OAuth initiation (server route)
116
+ - [ ] Handle OAuth callback and store tokens in `integrations` table
117
+ - [ ] Show connection status on settings page
118
+ - [ ] Add disconnect functionality
119
+ - [ ] Commit
120
+
121
+ <verify>User clicks "Connect Slack" → completes Slack OAuth → sees green checkmark with workspace name. User clicks "Disconnect" → checkmark disappears. Refreshing the page preserves the connection state.</verify>
122
+
123
+ ### Task 1.2 — Morning pull engine
124
+
125
+ **Files:** `src/app/api/pull/route.ts`, `src/lib/integrations/slack.ts`, `src/lib/inngest/functions.ts`
126
+
127
+ - [ ] Create Slack message fetcher (channels the user is in, last 24 hours)
128
+ - [ ] Map Slack messages to task records in `tasks` table
129
+ - [ ] Create Inngest scheduled function that runs at user's configured pull time
130
+ - [ ] Add manual "Pull now" button for testing
131
+ - [ ] Commit
132
+
133
+ <verify>User clicks "Pull now" → tasks appear within 60 seconds. Tasks have source, title, and link back to Slack. Running pull twice on the same day doesn't create duplicates.</verify>
134
+
135
+ ### Task 1.3 — Daily focus view
136
+
137
+ **Files:** `src/app/page.tsx`, `src/components/TaskList.tsx`, `src/components/TaskItem.tsx`
138
+
139
+ - [ ] Display today's pulled tasks grouped by source
140
+ - [ ] Implement drag-to-reorder with optimistic UI updates
141
+ - [ ] Add "focus" toggle (max 3 items) — focus items pin to top
142
+ - [ ] Add "complete" toggle — completed items show strikethrough and move to bottom
143
+ - [ ] Commit
144
+
145
+ <verify>User sees today's tasks. Dragging reorders them. Marking 3 as focus pins them to top. Marking one as complete shows strikethrough. Refreshing the page preserves all changes.</verify>
146
+
147
+ ### Task 1.4 — Polish and edge cases
148
+
149
+ **Files:** *various*
150
+
151
+ - [ ] Empty state when no integrations connected (prompt to connect)
152
+ - [ ] Empty state when no tasks pulled (show "all clear" message)
153
+ - [ ] Loading states for pull and reorder actions
154
+ - [ ] Error handling for failed pulls (show retry option)
155
+ - [ ] Commit
156
+
157
+ <verify>Disconnecting all integrations shows empty state with connect prompt. A fresh account with no pulls shows a clean onboarding message. Slow network shows loading indicators, not blank screens.</verify>
158
+
159
+ **Phase 1 success criteria:**
160
+ - *Complete Slack → Pull → View → Reorder → Focus → Complete flow works*
161
+ - *Data persists across sessions*
162
+ - *Edge cases handled (empty states, errors, loading)*
163
+ - *Works on production URL*
164
+
165
+ **⛔ HALT — stop and ask the human if:**
166
+ - 3 consecutive task failures in this phase
167
+ - Auth or database from Phase 0 is broken or missing
168
+ - OAuth credentials (Slack app) haven't been created yet — you can't fake this
169
+ - The founder hasn't answered which Slack channels to pull from
170
+ - A task would take more than 2 hours — break it into subtasks first
171
+
172
+ ---
173
+
174
+ ## Milestone 2 — Growth
175
+
176
+ **Goal:** *Expand the product's value by adding a second task source.*
177
+ **Success condition:** *User can connect both Slack and Trello/Linear and see a unified task list from both.*
178
+
179
+ ---
180
+
181
+ ## Phase 2 — Second Integration
182
+
183
+ <!-- HOW-TO: Replace the placeholder below with the next priority from your PRD. Keep the same structure: goal, 3-4 tasks, verify blocks, success criteria. -->
184
+
185
+ **Goal:** *User can connect Trello or Linear as a second source, and morning pulls aggregate tasks from both Slack and the project board.*
186
+
187
+ ### Boundary Map
188
+
189
+ | Produces | Consumes |
190
+ |----------|----------|
191
+ | *Generalized OAuth flow (`/api/integrations/[provider]/`)* | *Slack OAuth pattern (Phase 1)* |
192
+ | *Trello/Linear fetcher (`/lib/integrations/`)* | *Pull engine (Phase 1)* |
193
+ | *Multi-source badge UI* | *TaskList component (Phase 1)* |
194
+
195
+ ### Task 2.1 — Trello/Linear OAuth flow
196
+
197
+ **Files:** `src/app/api/integrations/[provider]/connect/route.ts`, `src/app/api/integrations/[provider]/callback/route.ts`
198
+
199
+ - [ ] *Generalize OAuth flow to support multiple providers*
200
+ - [ ] *Implement Trello OAuth (or Linear, based on user preference)*
201
+ - [ ] *Show both integrations on settings page*
202
+ - [ ] Commit
203
+
204
+ <verify>*User can connect both Slack and Trello/Linear. Settings page shows status of each. Disconnecting one doesn't affect the other.*</verify>
205
+
206
+ ### Task 2.2 — Multi-source pull
207
+
208
+ **Files:** `src/lib/integrations/trello.ts` or `src/lib/integrations/linear.ts`, `src/app/api/pull/route.ts`
209
+
210
+ - [ ] *Add fetcher for second integration*
211
+ - [ ] *Update pull engine to aggregate from all connected sources*
212
+ - [ ] *Tasks from different sources display with source badges*
213
+ - [ ] Commit
214
+
215
+ <verify>*Morning pull returns tasks from both Slack and Trello/Linear. Each task shows its source. Duplicate detection works across sources.*</verify>
216
+
217
+ **Phase 2 success criteria:**
218
+ - *Both integrations connect and pull independently*
219
+ - *Daily view shows tasks from all sources in one unified list*
220
+ - *Phase 1 functionality unchanged*
221
+
222
+ **⛔ HALT — stop and ask the human if:**
223
+ - 3 consecutive task failures in this phase
224
+ - Phase 1 pull engine or OAuth flow is broken
225
+ - The founder hasn't decided between Trello and Linear
226
+ - API rate limits from the second integration block development
227
+
228
+ ---
229
+
230
+ ## Convention: Decimal Phases
231
+
232
+ <!-- HOW-TO: If you need to insert urgent work between phases, use decimal numbering (e.g., Phase 1.1) instead of renumbering everything. Renumbering phases breaks references in commit messages, AI conversation history, and your own notes. Decimal phases keep the original numbering stable. -->
233
+
234
+ *Example: If a critical auth bug surfaces after Phase 1, create "Phase 1.1 — Auth Token Refresh Fix" rather than renumbering Phase 2 to Phase 3. The original phase numbers are permanent anchors.*
@@ -0,0 +1,89 @@
1
+ # Product Requirements Document
2
+
3
+ <!-- HOW-TO: This is the contract between you and your AI builder. If a feature isn't here, it doesn't get built. If the acceptance criteria are vague, you'll get vague output. -->
4
+
5
+ ## TL;DR
6
+
7
+ <!-- HOW-TO: ≤60 words. Summarize the features that ship in v1 and explicitly state what's deferred. -->
8
+
9
+ *TaskPilot v1 ships three things: OAuth connection to Slack + one project board, a morning pull that creates a prioritized task list, and a drag-to-reorder daily focus view. Email integration, AI prioritization, and mobile apps are deferred to v2.*
10
+
11
+ ## P0 — Must Ship
12
+
13
+ <!-- HOW-TO: These are launch-blocking. If any P0 is incomplete, you don't ship. Each feature needs a name, a one-line description, and acceptance criteria written as observable behaviors — what the user sees or experiences. -->
14
+
15
+ ### Connect Integrations
16
+
17
+ *User connects Slack and one project board (Trello or Linear) via OAuth.*
18
+
19
+ **Acceptance criteria:**
20
+ - *User clicks "Connect Slack" and completes OAuth flow without leaving the app*
21
+ - *User sees a green checkmark and workspace name after successful connection*
22
+ - *User can disconnect and reconnect without losing previously pulled tasks*
23
+ - *If OAuth fails, user sees a specific error message (not a generic "something went wrong")*
24
+
25
+ ### Morning Pull
26
+
27
+ *App pulls pending items from connected tools at the user's configured time each day.*
28
+
29
+ **Acceptance criteria:**
30
+ - *User sets a pull time (e.g., 7:00 AM) and timezone in settings*
31
+ - *At the configured time, the app fetches unresolved items from all connected tools*
32
+ - *User sees a notification (browser or email) that their daily list is ready*
33
+ - *Pull completes within 60 seconds for up to 200 items*
34
+
35
+ ### Daily Focus View
36
+
37
+ *User sees a single prioritized list and marks their top 3 tasks for the day.*
38
+
39
+ **Acceptance criteria:**
40
+ - *User sees all pulled items grouped by source (Slack, Trello/Linear)*
41
+ - *User drags items to reorder the list*
42
+ - *User marks up to 3 items as "today's focus" — these pin to the top*
43
+ - *Non-focus items collapse into an "everything else" section*
44
+ - *Completed items show a strikethrough and move to the bottom*
45
+
46
+ ## P1 — Should Ship
47
+
48
+ <!-- HOW-TO: Important but not launch-blocking. Build these immediately after P0 is stable. -->
49
+
50
+ ### Email Digest
51
+
52
+ *User receives a daily email summary of their focus items and yesterday's completions.*
53
+
54
+ **Acceptance criteria:**
55
+ - *Email arrives within 5 minutes of the morning pull*
56
+ - *Email shows today's focus items and yesterday's completion rate*
57
+ - *User can reply "done" to any item to mark it complete from email*
58
+
59
+ ### Snooze Items
60
+
61
+ *User can snooze non-urgent items to a future date.*
62
+
63
+ **Acceptance criteria:**
64
+ - *User clicks "snooze" and picks a date from a date picker*
65
+ - *Snoozed items disappear from the daily list until the chosen date*
66
+ - *User sees a count of snoozed items in the sidebar*
67
+
68
+ ## P2 — Nice to Have
69
+
70
+ <!-- HOW-TO: Tracked but not committed. These might become P0 in v2. -->
71
+
72
+ ### AI Priority Suggestions
73
+
74
+ *App suggests a priority order based on deadlines, mentions, and item age.*
75
+
76
+ **Acceptance criteria:**
77
+ - *User sees a "suggested order" button on the daily focus view*
78
+ - *Clicking it reorders items with an explanation tooltip ("due tomorrow", "mentioned 3x")*
79
+ - *User can accept, modify, or dismiss the suggestion*
80
+
81
+ ## Clarifications Log
82
+
83
+ <!-- HOW-TO: Track every decision made during build. When the AI or you make an ambiguous call, log it here. This becomes your institutional memory. -->
84
+
85
+ | Question | Answer | Decision | Date |
86
+ |----------|--------|----------|------|
87
+ | *Should Slack DMs be pulled or only channel messages?* | *Channels only in v1* | *DMs add privacy complexity — defer to v2* | *2025-01-15* |
88
+ | *What happens if OAuth token expires mid-pull?* | *Retry once, then notify user to reconnect* | *Silent retry + notification is better UX than failing silently* | *2025-01-16* |
89
+ | *Max items per daily list?* | *200 items hard cap* | *Performance degrades above 200; show "oldest items hidden" warning* | *2025-01-17* |
@@ -0,0 +1,73 @@
1
+ # Product Brief
2
+
3
+ <!-- HOW-TO: This is the single document your AI assistant, your co-founder, and your first investor will read to understand what you're building. Keep it tight — this file should take under 3 minutes to read. Every section maps to a specific planning question so nothing gets missed. -->
4
+
5
+ ## TL;DR
6
+
7
+ <!-- HOW-TO: Write exactly one paragraph, 60 words max. This combats the "curse of knowledge" — founders who live inside their idea forget that nobody else has context. If you can't summarize it in 60 words, you don't understand it well enough yet. -->
8
+
9
+ *TaskPilot is a lightweight daily planner for solo founders who lose hours to context-switching between Slack, email, and project boards. It pulls pending items from connected tools into a single prioritized list each morning, so founders start every day knowing exactly what to work on first.*
10
+
11
+ ## The Problem
12
+
13
+ <!-- HOW-TO: Keyed to Interrogation Q1 — "What problem does the user face today, and how are they currently solving it (badly)?" Be specific. "People are overwhelmed" is not a problem statement. "Solo founders spend 40 minutes every morning triaging notifications across 4+ tools before they start real work" is. Name the problem, quantify the pain, and describe the broken workaround they're using today. -->
14
+
15
+ *Solo founders spend 40+ minutes every morning triaging notifications across Slack, email, Trello, and GitHub before starting real work. Most end up working on whatever feels urgent rather than what actually moves the business forward.*
16
+
17
+ *The current workaround is a daily manual copy-paste into a Notes doc — tedious and abandoned within two weeks. Some founders try "Slack-free mornings," but that just moves the triage to the afternoon and delays time-sensitive items.*
18
+
19
+ *The cost: 3+ hours per week lost to triage, plus the invisible cost of starting every day on someone else's agenda instead of your own roadmap.*
20
+
21
+ ## The User
22
+
23
+ <!-- HOW-TO: One sentence. Name the role, not a demographic. "25-34 year old male in San Francisco" is a demographic. "Solo founder running a pre-seed startup with no project manager" is a role. Roles tell you what the user needs; demographics tell you what ads to buy. -->
24
+
25
+ *A solo founder or solo technical co-founder running a pre-seed startup with no dedicated project manager.*
26
+
27
+ **Secondary user:** *An early employee (first 1-3 hires) who inherits the founder's multi-tool chaos but has even less context about which tasks matter most.*
28
+
29
+ <!-- HOW-TO: If you have a secondary user, name them. But be clear about who comes first — build for the primary user, validate with the secondary. -->
30
+
31
+ ## The Solution
32
+
33
+ <!-- HOW-TO: One paragraph describing what the product does — not how it works technically. Write it as if you're explaining to the user, not to an engineer. Avoid implementation details like "uses webhooks" or "stores in Postgres." Those belong in tech.md. -->
34
+
35
+ *TaskPilot connects to Slack, email, and one project board (Trello or Linear). Each morning at a time the user sets, it pulls all pending items, groups them by project, and presents a single prioritized list. The user drags to reorder, marks the top 3 as "today's focus," and gets a clean view with everything else hidden until tomorrow.*
36
+
37
+ *The core loop takes under 2 minutes: open TaskPilot, review the auto-generated list, drag your priorities to the top, and start building. No setup, no configuration beyond connecting your tools.*
38
+
39
+ ## The Analogue
40
+
41
+ <!-- HOW-TO: Name one existing product people will compare this to, and what's different. The "X for Y" frame gives people an instant mental model. If you skipped this during the planning conversation, add it now — it's too useful to leave blank. The comparison doesn't have to be flattering — it just needs to be instantly understood. -->
42
+
43
+ *"Superhuman for daily planning" — Superhuman made email fast; TaskPilot makes your whole morning triage fast by pulling from every tool, not just email.*
44
+
45
+ *Key difference: Superhuman is a replacement for Gmail. TaskPilot sits on top of your existing tools and doesn't replace any of them.*
46
+
47
+ <!-- HOW-TO: The analogue isn't a competitive analysis. It's a communication shortcut. You'll do competitive analysis later. Right now you need something people can repeat to each other in one sentence. -->
48
+
49
+ ## Why Now
50
+
51
+ <!-- HOW-TO: Founders almost never volunteer this. The planning conversation forces it because investors and builders both need it. What changed recently — a market shift, a technology unlock, a regulation, a cultural moment — that makes this idea viable now when it wasn't two years ago? -->
52
+
53
+ *Three things changed:*
54
+
55
+ 1. *Slack, Linear, and Trello all now offer stable OAuth + webhook APIs that didn't exist or were unreliable before 2024.*
56
+ 2. *AI prioritization models (small LLMs) are cheap enough to run per-user at <$0.01/day.*
57
+ 3. *The solo-founder movement has grown 3x since 2020, creating a large enough niche to sustain a focused tool.*
58
+
59
+ *Two years ago you'd have needed a team of 3 just to maintain the integrations. Today a solo dev with AI tooling can build and maintain this.*
60
+
61
+ ## What This Is NOT
62
+
63
+ <!-- HOW-TO: Non-goals prevent scope creep. List 3 things users might expect that you explicitly won't build in v1. These are decisions, not limitations — own them. Non-goals are some of the most important sentences in this document because they prevent the most common failure mode in AI-assisted building: the AI "helpfully" adding features you didn't ask for. -->
64
+
65
+ 1. *Not a project management tool — no boards, no sprints, no team features. If you need Jira, use Jira.*
66
+ 2. *Not a calendar app — it doesn't schedule your day, it prioritizes your tasks. It tells you WHAT to work on, not WHEN.*
67
+ 3. *Not an automation platform — it won't auto-reply to Slack messages or close tickets. It's read-only from your connected tools.*
68
+
69
+ <!-- HOW-TO: If the AI suggests building any of the above, point it back to this section. Non-goals are not "not yet" — they are "not this product." If one of your non-goals turns out to be the real product, that's a pivot — rewrite this entire document from scratch. -->
70
+
71
+ ---
72
+
73
+ <!-- HOW-TO: This file is complete when a stranger can read it in 3 minutes and accurately describe your product to someone else. If they can't, the file is too vague or too long. Read it aloud to someone unfamiliar with your idea — their confused face is your editing guide. -->