@withmata/blueprints 0.2.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 (77) hide show
  1. package/.claude/commands/audit.md +179 -0
  2. package/.claude/commands/discover.md +92 -0
  3. package/.claude/commands/new-blueprint.md +265 -0
  4. package/.claude/commands/new-project.md +230 -0
  5. package/.claude/commands/scaffold-auth.md +310 -0
  6. package/.claude/commands/scaffold-db.md +270 -0
  7. package/.claude/commands/scaffold-foundation.md +158 -0
  8. package/.cursor/commands/audit.md +179 -0
  9. package/.cursor/commands/discover.md +92 -0
  10. package/.cursor/commands/new-blueprint.md +265 -0
  11. package/.cursor/commands/new-project.md +230 -0
  12. package/.cursor/commands/scaffold-auth.md +310 -0
  13. package/.cursor/commands/scaffold-db.md +270 -0
  14. package/.cursor/commands/scaffold-foundation.md +158 -0
  15. package/.opencode/commands/audit.md +183 -0
  16. package/.opencode/commands/discover.md +96 -0
  17. package/.opencode/commands/new-blueprint.md +269 -0
  18. package/.opencode/commands/new-project.md +234 -0
  19. package/.opencode/commands/scaffold-auth.md +314 -0
  20. package/.opencode/commands/scaffold-db.md +274 -0
  21. package/.opencode/commands/scaffold-foundation.md +162 -0
  22. package/ENGINEERING.md +47 -0
  23. package/blueprints/discovery/product-discovery/BLUEPRINT.md +361 -0
  24. package/blueprints/discovery/product-discovery/templates/archetype-template.md +143 -0
  25. package/blueprints/discovery/product-discovery/templates/product-brief.md +65 -0
  26. package/blueprints/discovery/product-discovery/templates/product-thesis.md +64 -0
  27. package/blueprints/discovery/product-discovery/templates/research-summary.md +43 -0
  28. package/blueprints/features/auth-better-auth/BLUEPRINT.md +794 -0
  29. package/blueprints/features/auth-better-auth/files/client/auth-client.ts +31 -0
  30. package/blueprints/features/auth-better-auth/files/client/context/organization.ts +236 -0
  31. package/blueprints/features/auth-better-auth/files/client/hooks/use-create-organization.ts +45 -0
  32. package/blueprints/features/auth-better-auth/files/client/hooks/use-has-permission.ts +26 -0
  33. package/blueprints/features/auth-better-auth/files/client/hooks/use-organization.ts +64 -0
  34. package/blueprints/features/auth-better-auth/files/client/schema/auth.ts +21 -0
  35. package/blueprints/features/auth-better-auth/files/client/schema/organization.ts +51 -0
  36. package/blueprints/features/auth-better-auth/files/client/types/organization.ts +20 -0
  37. package/blueprints/features/auth-better-auth/files/db/auth-schema.ts +184 -0
  38. package/blueprints/features/auth-better-auth/files/db/drizzle.config.ts +21 -0
  39. package/blueprints/features/auth-better-auth/files/middleware/route-protection.ts +84 -0
  40. package/blueprints/features/auth-better-auth/files/server/auth-db.ts +18 -0
  41. package/blueprints/features/auth-better-auth/files/server/auth.ts +159 -0
  42. package/blueprints/features/auth-better-auth/files/server/env.ts +44 -0
  43. package/blueprints/features/auth-better-auth/files/server/middleware.ts +144 -0
  44. package/blueprints/features/db-drizzle-postgres/BLUEPRINT.md +596 -0
  45. package/blueprints/features/db-drizzle-postgres/files/db/drizzle.config.ts +18 -0
  46. package/blueprints/features/db-drizzle-postgres/files/db/env.example +3 -0
  47. package/blueprints/features/db-drizzle-postgres/files/db/package.json +33 -0
  48. package/blueprints/features/db-drizzle-postgres/files/db/src/client.ts +34 -0
  49. package/blueprints/features/db-drizzle-postgres/files/db/src/example-entity.ts +73 -0
  50. package/blueprints/features/db-drizzle-postgres/files/db/src/index.ts +8 -0
  51. package/blueprints/features/db-drizzle-postgres/files/db/src/scripts/seed.ts +50 -0
  52. package/blueprints/features/db-drizzle-postgres/files/db/tsconfig.json +13 -0
  53. package/blueprints/features/tailwind-v4/BLUEPRINT.md +29 -0
  54. package/blueprints/features/ui-shared-components/BLUEPRINT.md +35 -0
  55. package/blueprints/foundation/monorepo-turbo/BLUEPRINT.md +378 -0
  56. package/blueprints/foundation/monorepo-turbo/files/apps/web/app/globals.css +2 -0
  57. package/blueprints/foundation/monorepo-turbo/files/apps/web/app/layout.tsx +23 -0
  58. package/blueprints/foundation/monorepo-turbo/files/apps/web/app/page.tsx +7 -0
  59. package/blueprints/foundation/monorepo-turbo/files/apps/web/env.ts +13 -0
  60. package/blueprints/foundation/monorepo-turbo/files/apps/web/next.config.ts +12 -0
  61. package/blueprints/foundation/monorepo-turbo/files/apps/web/package.json +28 -0
  62. package/blueprints/foundation/monorepo-turbo/files/apps/web/postcss.config.mjs +5 -0
  63. package/blueprints/foundation/monorepo-turbo/files/apps/web/tsconfig.json +18 -0
  64. package/blueprints/foundation/monorepo-turbo/files/config/tailwind-config/package.json +14 -0
  65. package/blueprints/foundation/monorepo-turbo/files/config/tailwind-config/postcss.config.mjs +5 -0
  66. package/blueprints/foundation/monorepo-turbo/files/config/tailwind-config/shared-styles.css +88 -0
  67. package/blueprints/foundation/monorepo-turbo/files/config/typescript-config/base.json +19 -0
  68. package/blueprints/foundation/monorepo-turbo/files/config/typescript-config/nextjs.json +12 -0
  69. package/blueprints/foundation/monorepo-turbo/files/config/typescript-config/package.json +5 -0
  70. package/blueprints/foundation/monorepo-turbo/files/config/typescript-config/react-library.json +7 -0
  71. package/blueprints/foundation/monorepo-turbo/files/root/biome.json +46 -0
  72. package/blueprints/foundation/monorepo-turbo/files/root/gitignore +35 -0
  73. package/blueprints/foundation/monorepo-turbo/files/root/package.json +25 -0
  74. package/blueprints/foundation/monorepo-turbo/files/root/pnpm-workspace.yaml +5 -0
  75. package/blueprints/foundation/monorepo-turbo/files/root/turbo.json +30 -0
  76. package/dist/index.js +453 -0
  77. package/package.json +53 -0
@@ -0,0 +1,162 @@
1
+ ---
2
+ description: Set up Turborepo + pnpm monorepo skeleton
3
+ ---
4
+
5
+ # Scaffold Foundation
6
+
7
+ Set up the monorepo project skeleton using the foundation blueprint. **For single-repo applications** (standalone Next.js, Node, or Bun apps), skip this command and go directly to feature blueprints (`/scaffold-db`, `/scaffold-auth`) — they detect single-repo projects and adapt automatically.
8
+
9
+ ## Step 1: Read the Blueprint
10
+
11
+ Read the full foundation blueprint and all template files:
12
+
13
+ ```
14
+ ~/Documents/WithMata/my-blueprints/blueprints/foundation/monorepo-turbo/BLUEPRINT.md
15
+ ~/Documents/WithMata/my-blueprints/blueprints/foundation/monorepo-turbo/files/**/*
16
+ ```
17
+
18
+ If not found at that path, ask the user for the path to their blueprints repo.
19
+
20
+ The BLUEPRINT.md contains the full architecture documentation, naming conventions, folder conventions, and file manifest. Follow it precisely.
21
+
22
+ ## Step 2: Read Project Context
23
+
24
+ Check if `.project-context.md` exists in the target project root:
25
+
26
+ - **If it has a Discovery section**: use the product name to derive the npm scope (e.g., "Acme Dashboard" -> `@acme`). Use technical constraints to inform any decisions.
27
+
28
+ - **If it has a Foundation section already**: warn the user. Ask: "Foundation was already set up. Do you want to re-scaffold (destructive — replaces existing structure) or skip?"
29
+
30
+ - **If no context file exists**: that is fine. Ask the user directly for the product name and npm scope.
31
+
32
+ ## Step 3: Understand Current State
33
+
34
+ Explore the target project directory:
35
+
36
+ - Is it empty? Fresh start — scaffold everything.
37
+ - Does it already have files? Ask before overwriting anything.
38
+ - Is there an existing `package.json`? Read it for context.
39
+
40
+ ## Step 4: Ask Configuration Questions
41
+
42
+ Only three questions — skip any already answered by project context:
43
+
44
+ 1. **npm scope** — "What npm scope should internal packages use? (e.g., @acme)" Default: derive from product name.
45
+ 2. **Project name** — "What is the human-readable project name?" (for metadata, page titles). Default: from discovery context.
46
+ 3. **Node.js version** — "Target Node.js version?" Default: `>=22`.
47
+
48
+ ## Step 5: Scaffold
49
+
50
+ Create the monorepo skeleton by adapting all files from the blueprint. Replace placeholders:
51
+
52
+ - `{{SCOPE}}` -> the npm scope (e.g., `@acme`)
53
+ - `{{APP_NAME}}` -> the human-readable name (e.g., `Acme Dashboard`)
54
+
55
+ ### 5a. Root Configuration
56
+
57
+ From `files/root/`, create at project root:
58
+ - `package.json` — root monorepo config
59
+ - `turbo.json` — task orchestration
60
+ - `pnpm-workspace.yaml` — workspace patterns
61
+ - `biome.json` — linting + formatting
62
+ - `.gitignore` — from `files/root/gitignore`
63
+
64
+ ### 5b. Config Packages
65
+
66
+ From `files/config/`, create:
67
+ - `config/typescript-config/` — base.json, nextjs.json, react-library.json, package.json
68
+ - `config/tailwind-config/` — shared-styles.css, postcss.config.js, package.json
69
+
70
+ ### 5c. Next.js App Shell
71
+
72
+ From `files/apps/web/`, create:
73
+ - `apps/web/package.json`
74
+ - `apps/web/tsconfig.json`
75
+ - `apps/web/next.config.ts`
76
+ - `apps/web/env.ts`
77
+ - `apps/web/postcss.config.mjs`
78
+ - `apps/web/app/layout.tsx`
79
+ - `apps/web/app/page.tsx`
80
+ - `apps/web/app/globals.css`
81
+
82
+ ### 5d. Empty Workspace Directories
83
+
84
+ Create empty directories for feature blueprints:
85
+ - `apis/` — backend feature blueprint will add servers here
86
+ - `packages/` — feature blueprints will add shared packages here
87
+
88
+ ### 5e. Initialize
89
+
90
+ After creating all files:
91
+ 1. Initialize git if not already a repo: `git init`
92
+ 2. Run `pnpm install` to verify the workspace configuration is valid
93
+ 3. Verify the dev server starts: `pnpm dev` (briefly — just check it boots)
94
+
95
+ ## Step 6: Update Project Context
96
+
97
+ Append the `## Foundation` section to `.project-context.md`:
98
+
99
+ ```yaml
100
+ ## Foundation
101
+ monorepo_tool: turborepo
102
+ package_manager: pnpm
103
+ npm_scope: "<scope>"
104
+ node_version: ">=22"
105
+ workspaces:
106
+ apps: ["web"]
107
+ apis: []
108
+ packages: []
109
+ config: ["typescript-config", "tailwind-config"]
110
+ framework: next.js (app router)
111
+ typescript: strict
112
+ linter: biome
113
+ styling: tailwind-v4
114
+ env_validation: t3-env + zod
115
+ module_resolution: node subpath imports (#prefix)
116
+ foundation_completed: <date>
117
+ ```
118
+
119
+ If `.project-context.md` does not exist, create it with the standard header and the Foundation section.
120
+
121
+ ### Inject Maintenance Rules
122
+
123
+ Append the condensed maintenance rules to the target project's rules file(s):
124
+
125
+ 1. If `CLAUDE.md` exists in the target project → append rules there
126
+ 2. If `AGENTS.md` exists in the target project → append rules there
127
+ 3. If both exist → append to both (keep them in sync)
128
+ 4. If neither exists → ask the user which AI coding tool(s) they use:
129
+ - Claude Code → create CLAUDE.md with a `## Maintenance Rules` section
130
+ - OpenCode or Cursor → create AGENTS.md with a `## Maintenance Rules` section (both tools read AGENTS.md)
131
+ - Multiple tools → create all applicable files
132
+
133
+ The maintenance rules content is identical regardless of which file it goes into:
134
+
135
+ ```markdown
136
+ ## Maintenance Rules
137
+
138
+ ### Monorepo maintenance
139
+ - After every code change: format with Biome (`pnpm biome check --write .`) before considering work complete
140
+ - After adding new workspace packages: verify `pnpm-workspace.yaml` patterns match, run `pnpm install`
141
+ - After modifying shared configs (`config/typescript-config/`, `config/tailwind-config/`): verify all consumers still build
142
+ - After changing `turbo.json`: verify task ordering with `pnpm turbo run <task> --dry`
143
+ - After adding workspace dependencies: run `pnpm install` to create workspace links
144
+ - Keep `turbo.json` tasks with `cache: false` for any task with side effects (migrations, code generation)
145
+ ```
146
+
147
+ ## Step 7: Summarize
148
+
149
+ Tell the user:
150
+
151
+ - Project structure overview (directory tree)
152
+ - What was configured (scope, Node version, tooling)
153
+ - How to start development: `pnpm dev`
154
+ - Available feature blueprints to install next
155
+ - Suggest: "Run `/scaffold-auth` to add authentication. Other feature blueprints: ui-shared-components, tailwind-v4, db-drizzle-postgres."
156
+
157
+ ## Important Notes
158
+
159
+ - Never overwrite existing files without asking.
160
+ - Preserve all `// CONFIGURE:` comments in generated files so the user can find customization points.
161
+ - The Tailwind config is intentionally minimal — the UI feature blueprint extends it with shadcn, animations, and component-specific styles.
162
+ - Feature blueprints will add scripts to root `package.json` and tasks to `turbo.json` — the foundation provides the base that they extend.
package/ENGINEERING.md ADDED
@@ -0,0 +1,47 @@
1
+ # Engineering Preferences
2
+
3
+ These preferences apply to ALL blueprints in this repo and to any project scaffolded from them.
4
+
5
+ ## Stack
6
+
7
+ - **Language:** TypeScript (strict mode)
8
+ - **Monorepo:** Turborepo
9
+ - **Frontend:** Next.js (App Router)
10
+ - **Database:** PostgreSQL with Drizzle ORM
11
+ - **Auth:** Better Auth
12
+ - **Styling:** Tailwind CSS v4
13
+ - **Linting/Formatting:** Biome
14
+
15
+ ## Code Organization
16
+
17
+ - **Co-locate files** — tests, styles, and types live next to their source files, not in separate top-level directories
18
+ - **Barrel exports** — each module/package exposes a clean public API via `index.ts`
19
+ - **Feature-based structure** — organize by feature/domain, not by file type
20
+
21
+ ## Principles
22
+
23
+ - **Explicit over implicit** — no magic. Data flow should be traceable by reading the code
24
+ - **Typed error handling** — use discriminated unions or Result types for errors, not thrown exceptions for control flow
25
+ - **Validate at the boundary** — environment variables validated at startup using zod or t3-env. User input validated at API boundaries. Trust internal code
26
+ - **Minimal abstraction** — don't abstract until you have 3+ concrete use cases. Duplication is cheaper than the wrong abstraction
27
+ - **No over-engineering** — solve the problem at hand. Don't add configurability, feature flags, or extension points unless there's a concrete need
28
+
29
+ ## Conventions
30
+
31
+ - Use `pnpm` as the package manager
32
+ - Prefer named exports over default exports
33
+ - Use Node.js subpath imports (`#prefix`) for internal module resolution within apps/packages
34
+ - Shared config packages live in `config/` (separate from `packages/`)
35
+ - Environment variables: prefix client-side vars with `NEXT_PUBLIC_`, validate all with a schema
36
+
37
+ ## Blueprint System
38
+
39
+ - **Three tiers:** `blueprints/discovery/`, `blueprints/foundation/`, `blueprints/features/`
40
+ - **Execution order:** Discovery -> Foundation -> Features
41
+ - **Project types:** Blueprints support both `monorepo` and `single-repo` project types. Monorepo conventions (workspaces, Turbo, shared config packages) are conditional on project type. Single-repo apps skip Foundation and go directly to Features.
42
+ - **Blueprint dependencies:** Declared in `## Blueprint Dependencies` in each BLUEPRINT.md. Two types: `required` (checked during scaffolding, user prompted) and `recommended` (mentioned once). Auth requires DB. See individual BLUEPRINT.md files for the full dependency graph.
43
+ - **Project context:** Every blueprint appends to `.project-context.md` in the target project root — tool-agnostic location readable by any AI coding tool
44
+ - **Commands live in `.claude/commands/` (Claude Code), `.opencode/commands/` (OpenCode), and `.cursor/commands/` (Cursor)** — each tool auto-discovers from its own directory
45
+ - **Rules/preferences are in `ENGINEERING.md`** — tool-specific files (`CLAUDE.md`, `AGENTS.md`, `.cursor/rules/engineering.mdc`) point to it
46
+ - **Available commands:** `/new-project`, `/discover`, `/scaffold-foundation`, `/scaffold-auth`, `/scaffold-db`, `/audit`
47
+ - **BLUEPRINT.md required** in every blueprint directory. Placeholder blueprints must still have a BLUEPRINT.md documenting intended scope.
@@ -0,0 +1,361 @@
1
+ # Product Discovery Blueprint
2
+
3
+ ## Tier
4
+
5
+ Discovery — produces documentation and decisions, not code.
6
+
7
+ ## Problem
8
+
9
+ Building a product without validated problem definition, user understanding, or competitive positioning. The risk: months wasted building something nobody wants. This blueprint guides a rigorous, research-driven discovery session that transforms a raw idea into a defensible product strategy backed by evidence.
10
+
11
+ ## Status
12
+
13
+ Complete.
14
+
15
+ ## Blueprint Dependencies
16
+
17
+ None. This is the first stage — it has no prerequisites.
18
+
19
+ ## Output
20
+
21
+ A two-tier documentation system in `docs/product/` in the target project:
22
+
23
+ ```
24
+ docs/
25
+ └── product/
26
+ ├── product-thesis.md # Tier 1: Distilled, actionable (2-minute read)
27
+ ├── product-brief.md # Tier 2: Supporting research and detail
28
+ └── users/
29
+ ├── archetype-[name].md # One per customer archetype (contains personas within)
30
+ └── research-summary.md # Synthesis of user research
31
+ ```
32
+
33
+ | Document | Purpose |
34
+ |----------|---------|
35
+ | `product-thesis.md` | The "front page" — core pillars, success metrics, competitive evidence. Everything needed in 2 minutes. |
36
+ | `product-brief.md` | Supporting detail: market context, competitor deep dives, positioning, risks |
37
+ | `archetype-[name].md` | Vivid portrait of a customer type: their world, pressures, relationship to the problem, persona variations within |
38
+ | `research-summary.md` | User quotes, behavioral patterns, key insights with evidence, open questions |
39
+
40
+ **File naming rules:**
41
+ - Use lowercase with hyphens: `archetype-startup-marketer.md`, not `Archetype_StartupMarketer.md`
42
+ - Archetype names should be descriptive: `archetype-startup-marketer.md`, `archetype-agency-lead.md`
43
+ - Do NOT create separate persona files — personas live WITHIN their archetype file
44
+ - Do NOT create files beyond what's specified above
45
+
46
+ Templates for each document are in `templates/` within this blueprint.
47
+
48
+ ---
49
+
50
+ ## Process
51
+
52
+ This is a CONVERSATIONAL blueprint. Claude Code runs a structured 60-minute deep-dive session with the user, organized into five phases. Each phase has specific goals, frameworks, and quality gates.
53
+
54
+ ### Phase 1: Initial Framing (10-15 min)
55
+
56
+ **Goal:** Establish what's being built and who it's for.
57
+
58
+ Start by asking:
59
+ - "What do you want to build?"
60
+ - "Who are you building it for?"
61
+
62
+ **Then immediately begin researching** — don't wait for permission:
63
+ - Search for existing solutions in this space
64
+ - Look for market discussions and pain points
65
+ - Find competitive landscape data
66
+
67
+ ### Phase 2: Problem Deep Dive (20-25 min)
68
+
69
+ **Goal:** Move past symptoms to find the root problem worth solving.
70
+
71
+ **Announce framework:** "Let's use the 5 Whys technique to get to the root problem. This helps us move past symptoms to find the real underlying issue worth solving."
72
+
73
+ Dig into:
74
+ - Why does this problem exist?
75
+ - What are people doing today to solve it?
76
+ - What's inadequate about current solutions?
77
+ - How often does this problem occur?
78
+ - What's the real cost/impact?
79
+
80
+ **Auto-research triggers** (search immediately when these occur):
81
+ - User mentions current solutions → search for reviews, user complaints
82
+ - User claims market size → validate with actual data
83
+ - User describes a problem → find evidence in forums, Reddit, social media
84
+ - Any vague claim → search to validate or challenge
85
+
86
+ **Push back when:**
87
+ - Problem statement is too broad ("people want better productivity")
88
+ - Using "everyone" or generic "users" without specifics
89
+ - Assumed pain without evidence
90
+ - Starting with solution instead of problem
91
+ - Geographic/demographic vagueness
92
+
93
+ ### Phase 3: User Definition (15-20 min)
94
+
95
+ **Goal:** Build vivid customer archetypes that make target users real.
96
+
97
+ **Announce framework:** "Now let's build a customer archetype using scenario mapping and Jobs To Be Done. Instead of jumping to individual personas, we'll first understand the shared world these people inhabit — their pressures, culture, and relationship to the problem. Then we'll identify the specific role variations within that archetype."
98
+
99
+ **Step 1: Define the Archetype (the shared world)**
100
+
101
+ For the primary customer type, explore these dimensions:
102
+ - **Geography & Environment** — Where do they work? What cities? What's their physical environment like?
103
+ - **Culture & Community** — What do they believe? Who do they trust? Where do they hang out online?
104
+ - **Pressures** — What forces shape their daily reality? What keeps them up at night?
105
+ - **A Day in Their Life** — Walk through a typical day. Make it vivid and specific.
106
+ - **Relationship to the Problem** — How do they talk about it? What have they tried? Why hasn't it worked?
107
+ - **How They Make Decisions** — How do they find, evaluate, and adopt new solutions?
108
+
109
+ **Step 2: Identify Persona Variations**
110
+
111
+ Within the archetype, identify specific roles:
112
+ - What different positions/titles exist within this archetype?
113
+ - What's each persona's decision-making power? (Buyer, User, Approver, Influencer)
114
+ - What does each persona specifically care about?
115
+ - How do product goals translate to value for each persona?
116
+
117
+ **Research during this phase:**
118
+ - Search for user communities and forums
119
+ - Find real user complaints and discussions
120
+ - Validate assumptions about user behavior
121
+ - Look for how they describe the problem in their own words
122
+
123
+ **Archetype count:** Most products have 1-2 distinct archetypes. Don't force more. If two groups share the same world, pressures, and relationship to the problem, they're one archetype with persona variations — not two archetypes.
124
+
125
+ ### Phase 4: Solution Positioning (15-20 min)
126
+
127
+ **Goal:** Find a defensible competitive position backed by evidence.
128
+
129
+ **Announce framework:** "Let's map the competitive landscape using differentiation analysis to find your unique defensible position."
130
+
131
+ Research and document:
132
+ - **Direct competitors** — what they do, strengths, gaps
133
+ - **Adjacent solutions** — related tools people use
134
+ - **Workarounds** — how people hack together solutions today
135
+ - **Customer complaints** — what users are actually saying about existing tools
136
+
137
+ Map out:
138
+ - What exists in the market today
139
+ - Where you'd be differentiated
140
+ - Why now is the right time (market shifts, tech enablers, behavior changes)
141
+ - Critical assumptions that must be true
142
+ - Key risks
143
+
144
+ **Push back when:**
145
+ - "We're the only ones doing this" (search proves otherwise)
146
+ - Features without clear value proposition
147
+ - Differentiation based on vague claims like "better UX"
148
+ - Missing critical assumptions
149
+ - No clear "why now?"
150
+
151
+ ### Phase 5: Synthesis & Documentation (10 min)
152
+
153
+ **Goal:** Distill findings into the two-tier document system.
154
+
155
+ **Critical:** The job here is to DISTILL, not just organize. The founder should be able to read the Product Thesis in 2 minutes and understand exactly what they're building and how they'll know if it's working.
156
+
157
+ Summarize key findings and generate all documents using the templates.
158
+
159
+ ---
160
+
161
+ ## Frameworks
162
+
163
+ | Framework | Used In | Purpose |
164
+ |-----------|---------|---------|
165
+ | **5 Whys** | Phase 2: Problem Deep Dive | Move past symptoms to find root cause worth solving |
166
+ | **Jobs To Be Done** | Phase 3: User Definition | Understand underlying motivation, not just surface feature requests |
167
+ | **Scenario Mapping** | Phase 3: User Definition | Walk through actual days to spot where the problem hits |
168
+ | **Differentiation Analysis** | Phase 4: Solution Positioning | Find defensible competitive position by mapping the landscape |
169
+
170
+ **Framework transparency rule:** Always announce when using a framework. Be slightly verbose (not very) when explaining the methodology. This helps the founder understand the process and learn these techniques.
171
+
172
+ Examples:
173
+ - "I'm going to use the Jobs To Be Done framework now because it helps us understand the underlying motivation, not just the surface-level feature request."
174
+ - "Let's apply 5 Whys here to get past the symptom and find the root cause worth solving."
175
+ - "I'll use scenario mapping now so we can walk through their actual day and spot where the problem hits."
176
+
177
+ ---
178
+
179
+ ## Operating Principles
180
+
181
+ 1. **Data Over Opinions** — When challenging assumptions, back it up with research
182
+ 2. **Specificity Over Vagueness** — "People need X" gets "Which people? In what situation exactly? Why?"
183
+ 3. **Evidence Over Enthusiasm** — Excitement is great, but what's the proof?
184
+ 4. **Frameworks as Tools** — Name the technique you're using and explain why
185
+ 5. **Research Automatically** — Search for competitors, validate claims, find evidence — don't ask permission
186
+ 6. **Concrete Over Speculative** — Prioritize what's provable now over projections and assumptions
187
+ 7. **Distillation Over Comprehensiveness** — Force synthesis into actionable insights, not exhaustive reports
188
+
189
+ ---
190
+
191
+ ## Research Strategy
192
+
193
+ ### When to Auto-Search
194
+
195
+ Search immediately (don't ask permission) whenever:
196
+ - User describes a market or space → search competitors
197
+ - User makes claims about user behavior → validate or challenge
198
+ - User mentions a problem → find evidence in discussions
199
+ - User proposes differentiation → verify it's actually unique
200
+ - Any opportunity to strengthen or challenge the narrative with data
201
+
202
+ ### Search Patterns
203
+
204
+ - "Let me search for existing solutions in this space..."
205
+ - "I'm curious what users are actually saying about this problem..."
206
+ - "Let me validate that assumption..."
207
+ - "I want to see if there's evidence for this pain point..."
208
+
209
+ ### Integrating Findings
210
+
211
+ After research, always integrate findings back into the conversation:
212
+ - "Interesting — I found X, Y, and Z already doing this. Here's what they miss: [gap]. Is that where you're positioned?"
213
+ - "I found user complaints about [specific pain point] across 3 forums, which validates what you're saying. Here's what they're saying: [quote]"
214
+ - "The data suggests [insight] which contradicts your assumption. How does that affect your thinking?"
215
+
216
+ ---
217
+
218
+ ## Challenge Patterns
219
+
220
+ ### How to Push Back
221
+
222
+ Be direct but collaborative. The job is to make the concept bulletproof, not to validate ideas.
223
+
224
+ **With evidence:**
225
+ - "You mentioned [assumption]. I searched and found [contradicting data]. How do you reconcile this?"
226
+ - "That's still vague. Can you give me a specific example with names, location, and exact situation?"
227
+ - "I found 12 competitors doing exactly this. What makes your approach different?"
228
+
229
+ **Celebrate specificity:**
230
+ - "Now THAT's specific — great! This is exactly what we need."
231
+ - "Perfect example. I can actually visualize this person now."
232
+
233
+ **Flag quality issues:**
234
+ - "This persona feels generic. Tell me about ONE real person you know who has this problem."
235
+ - "We need geographic specifics. Are we talking San Francisco or Sao Paulo? It matters."
236
+
237
+ ### Bad vs Good Responses
238
+
239
+ | Bad (don't do this) | Good (do this instead) |
240
+ |---------------------|----------------------|
241
+ | "That's interesting!" | "I searched for existing invoicing tools and found 50+ solutions. What specific gap are you seeing that they miss?" |
242
+ | "Tell me more" | "That's still broad. Give me a concrete scenario — where is this person physically located, what just happened, what do they need to do in the next 5 minutes?" |
243
+
244
+ ### When to Push Back
245
+
246
+ - Problem statement is too broad ("people want better productivity")
247
+ - Using "everyone" or generic "users" without specifics
248
+ - Assumed pain without evidence
249
+ - Starting with solution instead of problem
250
+ - Geographic/demographic vagueness
251
+ - "We're the only ones doing this"
252
+ - Differentiation based on vague claims like "better UX"
253
+
254
+ ---
255
+
256
+ ## Quality Checkpoints
257
+
258
+ **All must pass before generating documentation. If any fail, keep probing.**
259
+
260
+ - [ ] Problem statement is specific with evidence
261
+ - [ ] Core product pillars can be articulated in 3-5 bullets
262
+ - [ ] At least one detailed archetype exists with vivid "world" description
263
+ - [ ] Archetype includes specific geography, culture, and community details
264
+ - [ ] Personas within archetype have clear decision-making roles (buyer/user/approver/influencer)
265
+ - [ ] Product value is connected to each persona specifically
266
+ - [ ] Direct competitors are identified with specific customer complaints
267
+ - [ ] Clear differentiation is articulated and defensible
268
+ - [ ] Product success metrics are defined (how do we know if it's working?)
269
+ - [ ] Critical assumptions are explicit
270
+ - [ ] All major claims are backed by research
271
+
272
+ ---
273
+
274
+ ## Document Quality Checklist
275
+
276
+ Writing quality standards for the generated documents:
277
+
278
+ ### Product Thesis (Tier 1)
279
+ - [ ] Can be read and understood in 2 minutes
280
+ - [ ] Core Product Pillars are 3-5 bullets max (distilled, not comprehensive)
281
+ - [ ] Competitive Reality includes real customer quotes, not just analysis
282
+ - [ ] Success Metrics are product-focused (does it work?), not business-focused (does it make money?)
283
+ - [ ] No speculative market sizing or business projections
284
+ - [ ] Critical Assumptions are explicit
285
+
286
+ ### Product Brief (Tier 2)
287
+ - [ ] Market data is labeled as directional/estimated
288
+ - [ ] No business metrics (revenue, customer targets, etc.)
289
+ - [ ] Provides supporting detail, not redundant summary of Tier 1
290
+
291
+ ### Archetypes & Personas
292
+ - [ ] "Their World" section is vivid and cinematic — you can visualize their Monday morning
293
+ - [ ] Geographic location is specific (city/region, not just "US")
294
+ - [ ] Community and culture details are included (where they hang out, who they trust)
295
+ - [ ] Problem is described in THEIR voice, not ours
296
+ - [ ] "How Our Product Fits" connects product metrics to concrete value for them
297
+ - [ ] Each persona within the archetype has clear decision power defined (buyer/user/approver/influencer)
298
+ - [ ] Each persona shows how product goals translate to value for THEM specifically
299
+ - [ ] Quotes feel real and specific, not generic
300
+ - [ ] Research sources are documented
301
+
302
+ ---
303
+
304
+ ## What's Configurable
305
+
306
+ - Number of archetypes (typically 1-2; don't force more)
307
+ - Depth of competitive analysis
308
+ - Whether to include market sizing estimates (directional only if included)
309
+
310
+ ---
311
+
312
+ ## What's Opinionated
313
+
314
+ - **Two-tier documentation** — Product Thesis (2-min distilled read) + Product Brief (supporting detail). Not one monolithic document.
315
+ - **Archetypes over personas** — Define the shared world first, then identify persona variations within. Personas are subordinate to their archetype, not standalone characters.
316
+ - **Evidence over enthusiasm** — Challenge assumptions with data. Default to "prove it" mode.
317
+ - **Product metrics over business metrics** — At this stage, "does the product work?" matters more than "will it make money?"
318
+ - **Exact document structure** — Files in `docs/product/` with specified hierarchy. Do not create additional files, rename folders, or deviate.
319
+ - **Distillation over comprehensiveness** — The Product Thesis forces synthesis into 3-5 core pillars. If you can't distill it, you don't understand it yet.
320
+ - **Framework transparency** — Always announce what technique you're using and why. The founder should learn the process.
321
+ - **Always produces written artifacts** — Not just a conversation. Every session ends with documents.
322
+
323
+ ---
324
+
325
+ ## Tone
326
+
327
+ - **Direct but collaborative** — "I'm pushing because I want this to succeed, not because I doubt you"
328
+ - **Data-driven** — Always cite sources when challenging
329
+ - **Framework-aware** — Tell them what you're doing and why (slightly verbose)
330
+ - **Celebratory** — When they get specific, acknowledge it enthusiastically
331
+ - **Skeptical** — Default to "prove it" mode, but with kindness
332
+ - **Patient** — This is a deep session. Take the time needed.
333
+
334
+ ---
335
+
336
+ ## Project Context Output
337
+
338
+ After completion, appends to `.claude/project-context.md` in the target project:
339
+
340
+ ```yaml
341
+ ## Product Discovery
342
+ product_name: "<name>"
343
+ problem_statement: "<one sentence>"
344
+ core_pillars:
345
+ - "<pillar 1>"
346
+ - "<pillar 2>"
347
+ - "<pillar 3>"
348
+ primary_archetype: "<archetype name>"
349
+ discovery_completed: <date>
350
+ artifacts:
351
+ - docs/product/product-thesis.md
352
+ - docs/product/product-brief.md
353
+ - docs/product/users/archetype-<name>.md
354
+ - docs/product/users/research-summary.md
355
+ ```
356
+
357
+ ---
358
+
359
+ ## Dependencies
360
+
361
+ None. This is the first stage — it has no prerequisites.