diff --git a/.claude/commands/design-os/cost-estimator.md b/.claude/commands/design-os/cost-estimator.md new file mode 100644 index 00000000..92b5fef6 --- /dev/null +++ b/.claude/commands/design-os/cost-estimator.md @@ -0,0 +1,164 @@ +# Cost Estimator & Optimizer + +You are helping the user estimate and optimize the infrastructure and service costs for their product. This creates a clear picture of what it will cost to run the product at different scales. + +## Step 1: Check Prerequisites + +First, verify that the product overview and tech stack exist: + +1. Read `/product/product-overview.md` to understand the product +2. Read `/product/tech-stack/tech-stack.md` to understand the technology choices + +If the product overview is missing: + +"Before estimating costs, you'll need to establish your product vision. Please run `/product-vision` first." + +If the tech stack is missing: + +"Before estimating costs, you'll need to define your tech stack. Please run `/tech-stack` first so I know which services and infrastructure to estimate." + +Stop here if prerequisites are missing. + +## Step 2: Explain the Process + +"Let's estimate the monthly costs for running **[Product Name]** based on your tech stack. + +I'll create cost estimates for different usage tiers: +1. **Starter** — Early stage, small user base +2. **Growth** — Scaling up, moderate traffic +3. **Scale** — Production-grade, high traffic + +I'll also suggest optimizations to reduce costs. + +Do you have a target budget or any pricing constraints I should know about?" + +Wait for their response. + +## Step 3: Analyze Tech Stack Costs + +Based on the tech stack choices, identify all cost-bearing services: + +- **Hosting/Compute** — Server instances, serverless functions, edge workers +- **Database** — Managed database services, storage, backups +- **Authentication** — Auth service pricing per MAU +- **Storage** — File storage, CDN, media processing +- **Email/Notifications** — Transactional email, push notifications +- **Monitoring** — Error tracking, analytics, logging +- **Domain/DNS** — Domain registration, DNS hosting +- **Third-party APIs** — Any external services + +For each service, research typical pricing for the chosen technology. + +## Step 4: Build Cost Tiers + +Present cost estimates for each tier using the AskUserQuestion tool to refine: + +"Here's my estimate for the **Starter** tier (~[X] users): + +| Category | Item | Monthly Cost | Notes | +|----------|------|-------------|-------| +| Hosting | [Service] | $[X] | [Plan details] | +| Database | [Service] | $[X] | [Plan details] | +| Auth | [Service] | $[X] | [Plan details] | +| ... | ... | ... | ... | + +**Estimated total: $[X]/mo** + +Does this look reasonable? Any services I'm missing?" + +Repeat for Growth and Scale tiers. + +## Step 5: Identify Optimizations + +Suggest ways to reduce costs: + +"Here are some cost optimizations to consider: + +1. **[Optimization]** — [How it saves money and estimated savings] +2. **[Optimization]** — [How it saves money and estimated savings] +3. **[Optimization]** — [How it saves money and estimated savings] + +Common optimizations: +- Use free tiers where available (Vercel, Supabase, Clerk all have generous free tiers) +- Use serverless instead of always-on servers for low-traffic stages +- Self-host open-source alternatives for services with high per-user costs +- Use CDN caching to reduce compute costs +- Reserve instances for predictable workloads at scale +- Consolidate services (e.g., Supabase for auth + database + storage) + +Which of these interest you?" + +## Step 6: Present Final Estimate + +"Here's your complete cost estimate for **[Product Name]**: + +**Starter ([X] users):** ~$[X]/mo +**Growth ([X] users):** ~$[X]/mo +**Scale ([X] users):** ~$[X]/mo + +**Top optimizations:** +- [Optimization 1] +- [Optimization 2] +- [Optimization 3] + +Ready to save?" + +## Step 7: Create the File + +Once approved, create the file at `/product/cost-estimator/cost-estimate.md` with this exact format: + +```markdown +# Cost Estimate + +## [Tier Name] ([User Count]) + +| Category | Item | Monthly Cost | Notes | +|----------|------|-------------|-------| +| [Category] | [Item] | $[Amount] | [Notes] | +| [Category] | [Item] | $[Amount] | [Notes] | + +## [Tier Name] ([User Count]) + +| Category | Item | Monthly Cost | Notes | +|----------|------|-------------|-------| +| [Category] | [Item] | $[Amount] | [Notes] | +| [Category] | [Item] | $[Amount] | [Notes] | + +[Add more tiers as needed] + +## Optimizations +- [Optimization 1 with details] +- [Optimization 2 with details] +- [Optimization 3 with details] +``` + +**Important:** The format with `## Tier Name (User Count)` and the markdown table must match exactly for the app to parse it correctly. Cost values should include the dollar sign (e.g., `$50`). + +## Step 8: Confirm Completion + +Let the user know: + +"I've created your cost estimate at `/product/cost-estimator/cost-estimate.md`. + +**Summary:** +- Starter ([X] users): ~$[X]/mo +- Growth ([X] users): ~$[X]/mo +- Scale ([X] users): ~$[X]/mo + +**Key optimizations identified:** [count] + +This gives you a clear picture of what it will cost to run your product. Review and adjust the estimates as you get more specific pricing from providers. + +Next step: Run `/qa-tests` to generate QA test cases for your product sections." + +## Important Notes + +- Use realistic pricing from actual service providers (as of your knowledge) +- Always include free tier options where available +- Round to reasonable numbers — don't give false precision +- Include notes explaining what each line item covers +- Costs should be monthly unless otherwise specified +- Focus on infrastructure costs, not development costs +- The Growth tier should represent a realistic near-term target +- Include 3 tiers minimum — Starter, Growth, Scale +- Optimizations should be actionable and specific diff --git a/.claude/commands/design-os/figma.md b/.claude/commands/design-os/figma.md new file mode 100644 index 00000000..78a04854 --- /dev/null +++ b/.claude/commands/design-os/figma.md @@ -0,0 +1,153 @@ +# Figma Integration + +You are helping the user link their Figma design files to their Design OS project. This creates a bridge between the design tool and the product planning workflow. + +## Step 1: Check Prerequisites + +First, verify that the design system exists: + +Read `/product/design-system/colors.json` or `/product/design-system/typography.json` to check if the design system has been set up. + +If neither exists: + +"Before linking Figma files, I'd recommend setting up your design tokens first with `/design-tokens`. This ensures your Figma designs align with the chosen color palette and typography. + +Would you like to proceed anyway, or run `/design-tokens` first?" + +Use AskUserQuestion to let the user choose. Proceed if they want to continue. + +## Step 2: Gather Figma Links + +"Let's connect your Figma files to **[Product Name]** (or 'your project' if no product overview exists). + +I'll need: +1. **Main Figma file URL** — The primary design file for your product +2. **Embed URL** (optional) — For an embedded preview in Design OS +3. **Additional links** (optional) — Prototypes, component libraries, etc. + +Please share your main Figma file URL. It should look like: +`https://www.figma.com/design/[file-id]/[file-name]`" + +Wait for the user to provide their Figma URL. + +## Step 3: Validate and Process URLs + +When the user provides a URL, validate it: + +- It should start with `https://www.figma.com/` or `https://figma.com/` +- Common formats: + - Design file: `https://www.figma.com/design/[id]/[name]` + - Prototype: `https://www.figma.com/proto/[id]/[name]` + - Board/FigJam: `https://www.figma.com/board/[id]/[name]` + - File (legacy): `https://www.figma.com/file/[id]/[name]` + +If the URL doesn't look like a Figma URL, ask for clarification. + +## Step 4: Generate Embed URL + +Create the embed URL from the file URL: + +The Figma embed format is: +`https://www.figma.com/embed?embed_host=share&url=[encoded-file-url]` + +Let the user know: + +"I'll set up an embedded preview so you can view the design directly in Design OS. + +Do you have any additional Figma links to add? For example: +- A clickable **prototype** +- A **component library** or design system file +- Specific **frames** or pages to reference + +If not, we'll just use the main file." + +Use AskUserQuestion to gather additional links. + +## Step 5: Classify Links + +For each link provided, determine the type: + +- URLs containing `/proto/` → type: `prototype` +- URLs containing `/board/` → type: `board` +- URLs with `node-id=` parameter → type: `frame` +- All other Figma URLs → type: `file` + +## Step 6: Ask About Access Token (Optional) + +"Do you have a Figma personal access token for API integration? This is optional and enables features like: +- Fetching file metadata +- Syncing component lists +- Pulling design tokens directly from Figma + +If you don't have one, that's fine — the links and embedded preview will still work. + +You can generate a token at: Figma → Settings → Personal access tokens" + +Use AskUserQuestion with options: +- "I have an access token" — Ask them to provide it +- "Skip for now" — Leave accessToken empty + +**Important:** If they provide a token, remind them to keep it secure and not commit it to public repositories. + +## Step 7: Present Configuration and Confirm + +"Here's your Figma integration setup: + +**Main File:** [URL] +**Embedded Preview:** Enabled +**Linked Files:** +- [Label] — [Type] — [URL] +- [Label] — [Type] — [URL] +**Access Token:** [Configured / Not configured] + +Ready to save?" + +## Step 8: Create the File + +Once approved, create the file at `/product/design-system/figma.json` with this format: + +```json +{ + "fileUrl": "[main-figma-file-url]", + "embedUrl": "https://www.figma.com/embed?embed_host=share&url=[encoded-file-url]", + "accessToken": "", + "links": [ + { + "label": "[Descriptive Label]", + "url": "[figma-url]", + "type": "[file|prototype|board|frame]" + } + ] +} +``` + +**Notes:** +- The main file URL should always be included in the `links` array as well +- Labels should be descriptive (e.g., "Main Design File", "Interactive Prototype", "Component Library") +- `embedUrl` should URL-encode the file URL in the query parameter +- `accessToken` should be an empty string if not provided — never store placeholder values + +## Step 9: Confirm Completion + +Let the user know: + +"I've set up the Figma integration at `/product/design-system/figma.json`. + +**What's configured:** +- Embedded preview in the Design tab +- [N] linked Figma files +- Quick-access links to open files directly in Figma + +You can view the integration on the Design page in Design OS. The embedded preview will appear in the Figma Integration step. + +To update links or add more files, edit `product/design-system/figma.json` directly or run `/figma` again." + +## Important Notes + +- Always validate that URLs are actual Figma URLs before saving +- The embed URL must use URL encoding for the file URL parameter +- Never store sensitive tokens in plain text suggestions — warn the user about security +- Include the main file in the links array so it appears in the linked files list +- Labels should be user-friendly, not raw URLs +- If the user has multiple Figma files (design + prototype), include all of them +- The `accessToken` field is for future API integration — leave empty if not provided diff --git a/.claude/commands/design-os/qa-tests.md b/.claude/commands/design-os/qa-tests.md new file mode 100644 index 00000000..6591c645 --- /dev/null +++ b/.claude/commands/design-os/qa-tests.md @@ -0,0 +1,177 @@ +# QA Test Case Generator + +You are helping the user generate comprehensive QA test cases for their product. These test cases cover the main user flows and edge cases for each section, providing a testing blueprint for QA validation. + +## Step 1: Check Prerequisites + +First, verify that the required product files exist: + +1. Read `/product/product-overview.md` to understand the product +2. Read `/product/product-roadmap.md` to get the list of sections +3. Read any existing section specs at `/product/sections/*/spec.md` + +If the product overview is missing: + +"Before generating test cases, you'll need to establish your product vision. Please run `/product-vision` first." + +If the roadmap is missing: + +"Before generating test cases, you'll need to define your product roadmap. Please run `/product-roadmap` first." + +Stop here if prerequisites are missing. + +## Step 2: Explain the Process + +"Let's generate QA test cases for **[Product Name]**. + +I'll create test cases covering: +- **Critical** — Core functionality that must work (login, primary actions) +- **High** — Key user flows that affect daily usage +- **Medium** — Important features and secondary flows +- **Low** — Edge cases and nice-to-have validations + +I'll generate test cases for each of your sections: +[List sections from roadmap] + +Should I focus on any specific sections first, or generate tests for all sections?" + +Wait for their response. + +## Step 3: Analyze Each Section + +For each section that has a spec, analyze: + +1. Read the section spec at `/product/sections/[section-id]/spec.md` +2. Identify the user flows listed +3. Identify the UI requirements listed +4. Consider common edge cases and error states + +If a section doesn't have a spec yet, note it and generate basic test cases based on the roadmap description. + +## Step 4: Generate Test Cases + +For each section, generate test cases following this pattern: + +"Here are the test cases for **[Section Title]**: + +**TC-001: [Test Title]** (Critical) +- Section: [Section Name] +- Steps: + 1. [Step 1] + 2. [Step 2] + 3. [Step 3] +- Expected: [What should happen] + +**TC-002: [Test Title]** (High) +... + +Should I adjust any of these test cases, or add more for specific scenarios?" + +Use AskUserQuestion to refine. + +### Test Case Coverage Guidelines + +For each section, aim to cover: + +1. **Happy path** — The main user flow works as expected (Critical) +2. **Empty states** — What happens when there's no data (High) +3. **Error handling** — Invalid inputs, failed operations (High) +4. **Boundary conditions** — Max items, long text, special characters (Medium) +5. **Navigation** — Can the user get to and from this section (Medium) +6. **Responsive behavior** — Works on mobile and desktop (Low) +7. **Loading states** — Appropriate feedback during operations (Low) + +## Step 5: Generate Coverage Summary + +After creating all test cases, provide a coverage summary: + +"**Coverage Summary:** + +Total test cases: [N] +- Critical: [N] tests +- High: [N] tests +- Medium: [N] tests +- Low: [N] tests + +Sections covered: [N]/[Total sections] +- [Section 1]: [N] tests +- [Section 2]: [N] tests + +Any gaps you'd like me to address?" + +## Step 6: Present Final Test Suite and Confirm + +Present the complete test suite for approval: + +"Here's your complete QA test suite with [N] test cases across [N] sections. + +Ready to save?" + +## Step 7: Create the File + +Once approved, create the file at `/product/qa-tests/qa-tests.md` with this exact format: + +```markdown +# QA Test Cases + +## Coverage Summary +[Summary paragraph describing what's covered, total test count, and any known gaps] + +## Test Cases + +### TC-001: [Test Title] +**Section:** [Section Name] +**Priority:** critical +**Steps:** +1. [Step 1] +2. [Step 2] +3. [Step 3] +**Expected Result:** [What should happen when the test passes] + +### TC-002: [Test Title] +**Section:** [Section Name] +**Priority:** high +**Steps:** +1. [Step 1] +2. [Step 2] +**Expected Result:** [What should happen when the test passes] + +[Add more test cases as needed] +``` + +**Important:** +- Test IDs must follow the `TC-XXX` format (e.g., TC-001, TC-002) +- Priority must be one of: `critical`, `high`, `medium`, `low` +- Steps must be numbered (1., 2., 3.) +- Each test case must have Section, Priority, Steps, and Expected Result fields +- The format must match exactly for the app to parse it correctly + +## Step 8: Confirm Completion + +Let the user know: + +"I've created your QA test suite at `/product/qa-tests/qa-tests.md`. + +**Summary:** +- [N] total test cases +- [N] critical, [N] high, [N] medium, [N] low priority +- Covering [N] sections + +These test cases provide a comprehensive testing blueprint. You can use them for: +- Manual QA testing during development +- Writing automated tests (unit, integration, E2E) +- Acceptance criteria for each section + +To regenerate or update test cases, run `/qa-tests` again." + +## Important Notes + +- Generate at least 3-5 test cases per section +- Always include at least one critical test per section (happy path) +- Include empty state and error handling tests for each section +- Test steps should be specific and actionable — not vague +- Expected results should be observable and verifiable +- Use section names from the roadmap, not arbitrary names +- Number test cases sequentially across all sections (TC-001, TC-002, etc.) +- Keep test cases focused — one test per scenario, not mega-tests +- Consider cross-section interactions where applicable diff --git a/.claude/commands/design-os/tech-stack.md b/.claude/commands/design-os/tech-stack.md new file mode 100644 index 00000000..55e26d9b --- /dev/null +++ b/.claude/commands/design-os/tech-stack.md @@ -0,0 +1,182 @@ +# Tech Stack & Architecture + +You are helping the user define the technology choices and architecture for their product. This establishes the "how" — the tools, frameworks, and structural patterns that will power the product. + +## Step 1: Check Prerequisites + +First, verify that the product overview and roadmap exist: + +1. Read `/product/product-overview.md` to understand what the product does +2. Read `/product/product-roadmap.md` to understand the planned sections +3. Read `/product/data-model/data-model.md` if it exists, for entity context + +If the product overview is missing, let the user know: + +"Before defining your tech stack, you'll need to establish your product vision. Please run `/product-vision` first." + +Stop here if the prerequisite is missing. + +## Step 2: Gather Initial Input + +Review the product overview, roadmap, and data model, then present your initial analysis: + +"Based on your product — **[Product Name]** — I'll help you choose the right technologies and define the architecture. + +Let's cover: +1. **Technology Choices** — Frontend, backend, database, hosting, etc. +2. **Architecture Layers** — How the system is organized +3. **Architecture Diagram** — A visual overview + +Do you already have preferences for any technologies (e.g., React, Node.js, PostgreSQL), or would you like me to suggest a stack based on your product requirements?" + +Wait for their response before proceeding. + +## Step 3: Define Technology Choices + +Walk through each category with the user. For each, suggest options based on the product type: + +**Categories to cover:** +- **Frontend Framework** — React, Vue, Svelte, Next.js, etc. +- **Backend/API** — Node.js, Python/Django, Go, serverless functions, etc. +- **Database** — PostgreSQL, MongoDB, SQLite, Supabase, etc. +- **Hosting/Infrastructure** — Vercel, AWS, Railway, Fly.io, etc. +- **Authentication** — Auth0, Clerk, Supabase Auth, NextAuth, etc. +- **Styling** — Tailwind CSS, CSS Modules, Styled Components, etc. + +For each category, use AskUserQuestion to ask: + +"For **[Category]**, I'd suggest **[Choice]** because [rationale based on product needs]. + +Other options to consider: +- [Alternative 1] — [brief rationale] +- [Alternative 2] — [brief rationale] + +What would you prefer?" + +Only include categories that are relevant to the product. Skip categories that don't apply. + +## Step 4: Define Architecture Layers + +Based on the chosen technologies, propose architecture layers: + +"Here's how I'd structure your architecture: + +**[Layer 1 Name]** — [Description] +- [Component 1] +- [Component 2] + +**[Layer 2 Name]** — [Description] +- [Component 1] +- [Component 2] + +Common layers include: +- **Presentation** — UI components, pages, routing +- **Application** — Business logic, state management, API clients +- **API** — REST/GraphQL endpoints, middleware, validation +- **Data** — Database models, migrations, seed data +- **Infrastructure** — Hosting, CI/CD, monitoring + +Does this structure make sense for your product?" + +Use AskUserQuestion to refine. + +## Step 5: Create Architecture Diagram + +Create a simple ASCII architecture diagram showing how the layers connect: + +"Here's a high-level view of your architecture: + +``` +[Browser] → [Frontend (React)] → [API (Node.js)] → [Database (PostgreSQL)] + ↓ + [Auth (Clerk)] + [Storage (S3)] +``` + +Does this capture the main flow?" + +## Step 6: Present Final Choices and Confirm + +Present the complete tech stack for approval: + +"Here's your complete tech stack and architecture: + +**Technology Choices:** +- **Frontend:** [Choice] — [Rationale] +- **Backend:** [Choice] — [Rationale] +- **Database:** [Choice] — [Rationale] +[etc.] + +**Architecture:** +[Layer summary] + +**Diagram:** +[ASCII diagram] + +Ready to save?" + +## Step 7: Create the File + +Once approved, create the file at `/product/tech-stack/tech-stack.md` with this exact format: + +```markdown +# Tech Stack & Architecture + +## Technology Choices + +### [Category] +**Choice:** [Technology Name] +**Rationale:** [Why this choice fits the product] + +### [Category] +**Choice:** [Technology Name] +**Rationale:** [Why this choice fits the product] + +[Add more categories as needed] + +## Architecture + +### [Layer Name] +[Description of this layer's responsibility] +- [Component 1] +- [Component 2] + +### [Layer Name] +[Description of this layer's responsibility] +- [Component 1] +- [Component 2] + +[Add more layers as needed] + +## Architecture Diagram +``` +[ASCII diagram here] +``` +``` + +**Important:** The format with `### Category`, `**Choice:**`, and `**Rationale:**` must match exactly for the app to parse it correctly. + +## Step 8: Confirm Completion + +Let the user know: + +"I've created your tech stack definition at `/product/tech-stack/tech-stack.md`. + +**Technologies chosen:** +- [List key choices] + +**Architecture layers:** +- [List layers] + +This provides a clear technical foundation for your product. The implementation agent will use these choices when building your app. + +Next step: Run `/cost-estimator` to estimate infrastructure and service costs based on your tech stack." + +## Important Notes + +- Suggest technologies that match the product's complexity — don't over-engineer simple products +- Consider the user's experience level — suggest well-documented, widely-adopted tools when possible +- Keep the architecture layers practical — 3-5 layers is ideal +- The ASCII diagram should be simple and readable +- Focus on the "what" and "why", not detailed configuration +- Don't include pricing in the tech stack — that's for the cost estimator diff --git a/agents.md b/agents.md index 29086b6e..b6dfae1b 100644 --- a/agents.md +++ b/agents.md @@ -45,6 +45,10 @@ Define the core entities and relationships in your product. This establishes the Choose your color palette (from Tailwind) and typography (from Google Fonts). These tokens are applied to all screen designs. **Output:** `product/design-system/colors.json`, `product/design-system/typography.json` +### 4b. Figma Integration (`/figma`) +Link your Figma design files for embedded previews and quick access from the Design tab. +**Output:** `product/design-system/figma.json` + ### 5. Application Shell (`/design-shell`) Design the persistent navigation and layout that wraps all sections. **Output:** `product/shell/spec.md`, `src/shell/components/` @@ -55,7 +59,19 @@ Design the persistent navigation and layout that wraps all sections. - `/design-screen` — Create screen designs - `/screenshot-design` — Capture screenshots -### 7. Export (`/export-product`) +### 7. Tech Stack & Architecture (`/tech-stack`) +Define the technology choices (frontend, backend, database, hosting, etc.) and architecture layers for your product. +**Output:** `product/tech-stack/tech-stack.md` + +### 8. Cost Estimator & Optimizer (`/cost-estimator`) +Estimate infrastructure and service costs at different usage tiers, and identify cost optimizations. +**Output:** `product/cost-estimator/cost-estimate.md` + +### 9. QA Test Case Generator (`/qa-tests`) +Generate comprehensive QA test cases covering all sections with priority levels and step-by-step instructions. +**Output:** `product/qa-tests/qa-tests.md` + +### 10. Export (`/export-product`) Generate the complete export package with all components, types, and handoff documentation. **Output:** `product-plan/` @@ -73,7 +89,17 @@ product/ # Product definition (portable) │ ├── design-system/ # Design tokens │ ├── colors.json # { primary, secondary, neutral } -│ └── typography.json # { heading, body, mono } +│ ├── typography.json # { heading, body, mono } +│ └── figma.json # Figma integration { fileUrl, embedUrl, links } +│ +├── tech-stack/ # Tech stack & architecture +│ └── tech-stack.md # Technology choices and architecture layers +│ +├── cost-estimator/ # Cost estimates +│ └── cost-estimate.md # Cost tiers and optimizations +│ +├── qa-tests/ # QA test cases +│ └── qa-tests.md # Test cases with priorities and steps │ ├── shell/ # Application shell │ └── spec.md # Shell specification diff --git a/src/components/CostEstimatorPage.tsx b/src/components/CostEstimatorPage.tsx new file mode 100644 index 00000000..65a2d295 --- /dev/null +++ b/src/components/CostEstimatorPage.tsx @@ -0,0 +1,141 @@ +import { useMemo } from 'react' +import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' +import { AppLayout } from '@/components/AppLayout' +import { EmptyState } from '@/components/EmptyState' +import { StepIndicator, type StepStatus } from '@/components/StepIndicator' +import { NextPhaseButton } from '@/components/NextPhaseButton' +import { loadProductData } from '@/lib/product-loader' + +export function CostEstimatorPage() { + const productData = useMemo(() => loadProductData(), []) + const costEstimate = productData.costEstimate + + const hasCostEstimate = !!costEstimate + const stepStatus: StepStatus = hasCostEstimate ? 'completed' : 'current' + + return ( + +
+ {/* Page intro */} +
+

+ Cost Estimator & Optimizer +

+

+ Estimate infrastructure and service costs, and identify optimizations. +

+
+ + {/* Step 1: Cost Estimate */} + + {!costEstimate ? ( + + ) : ( +
+ {/* Cost Tiers */} + {costEstimate.tiers.map((tier, index) => ( + + + + {tier.name} + + {tier.users} + + + + +
+ {/* Total */} +
+ + Estimated Monthly Cost + + + ${tier.monthlyCost.toLocaleString()}/mo + +
+ + {/* Line items */} + {tier.items.length > 0 && ( +
+ {tier.items.map((item, ii) => ( +
+
+
+ {item.category} +
+
+ {item.item} +
+ {item.notes && ( +
+ {item.notes} +
+ )} +
+
+ ${item.monthlyCost.toLocaleString()}/mo +
+
+ ))} +
+ )} +
+
+
+ ))} + + {/* Optimizations */} + {costEstimate.optimizations.length > 0 && ( + + + + Cost Optimizations + + ({costEstimate.optimizations.length}) + + + + +
    + {costEstimate.optimizations.map((opt, index) => ( +
  • + + + {opt} + +
  • + ))} +
+
+
+ )} + + {/* Edit hint */} +
+

+ To update the cost estimate, run{' '} + /cost-estimator{' '} + or edit the file directly at{' '} + + product/cost-estimator/cost-estimate.md + +

+
+
+ )} +
+ + {/* Next Phase Button */} + {hasCostEstimate && ( + + + + )} +
+
+ ) +} diff --git a/src/components/DesignPage.tsx b/src/components/DesignPage.tsx index 46c43f4b..59e08de0 100644 --- a/src/components/DesignPage.tsx +++ b/src/components/DesignPage.tsx @@ -6,7 +6,7 @@ import { EmptyState } from '@/components/EmptyState' import { StepIndicator, type StepStatus } from '@/components/StepIndicator' import { NextPhaseButton } from '@/components/NextPhaseButton' import { loadProductData } from '@/lib/product-loader' -import { ChevronRight, Layout } from 'lucide-react' +import { ChevronRight, Layout, ExternalLink, Figma } from 'lucide-react' // Map Tailwind color names to actual color values for preview const colorMap: Record = { @@ -34,12 +34,20 @@ const colorMap: Record = stone: { light: '#d6d3d1', base: '#78716c', dark: '#57534e' }, } +const figmaLinkTypeLabels: Record = { + file: 'Design File', + prototype: 'Prototype', + board: 'Board', + frame: 'Frame', +} + /** * Determine the status of each step on the Design page - * Steps: 1. Design Tokens, 2. Shell Design + * Steps: 1. Design Tokens, 2. Figma Integration, 3. Shell Design */ function getDesignPageStepStatuses( hasDesignSystem: boolean, + hasFigma: boolean, hasShell: boolean ): StepStatus[] { const statuses: StepStatus[] = [] @@ -51,7 +59,16 @@ function getDesignPageStepStatuses( statuses.push('current') } - // Step 2: Shell + // Step 2: Figma Integration (optional — skip-friendly) + if (hasFigma) { + statuses.push('completed') + } else if (hasDesignSystem) { + statuses.push('current') + } else { + statuses.push('upcoming') + } + + // Step 3: Shell if (hasShell) { statuses.push('completed') } else if (hasDesignSystem) { @@ -69,10 +86,11 @@ export function DesignPage() { const shell = productData.shell const hasDesignSystem = !!(designSystem?.colors || designSystem?.typography) + const hasFigmaLinks = !!designSystem?.figma const hasShell = !!shell?.spec const allStepsComplete = hasDesignSystem && hasShell - const stepStatuses = getDesignPageStepStatuses(hasDesignSystem, hasShell) + const stepStatuses = getDesignPageStepStatuses(hasDesignSystem, hasFigmaLinks, hasShell) return ( @@ -162,8 +180,100 @@ export function DesignPage() { )} - {/* Step 2: Application Shell */} - + {/* Step 2: Figma Integration */} + + {!designSystem?.figma ? ( + + ) : ( + + + + + Figma Integration + + + + {/* Figma Embed */} + {designSystem.figma.embedUrl && ( +
+

+ Preview +

+
+