stitch-forge 0.3.1
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.
- package/.claude/skills/forge-build/SKILL.md +79 -0
- package/.claude/skills/forge-design/SKILL.md +64 -0
- package/.claude/skills/forge-discover/SKILL.md +139 -0
- package/.claude/skills/forge-generate/SKILL.md +77 -0
- package/.claude/skills/forge-preview/SKILL.md +26 -0
- package/.claude/skills/forge-research/SKILL.md +42 -0
- package/.claude/skills/forge-sync/SKILL.md +45 -0
- package/DESIGN.md +113 -0
- package/LICENSE +21 -0
- package/README.es.md +242 -0
- package/README.md +242 -0
- package/dist/adapters/astro.d.ts +8 -0
- package/dist/adapters/astro.js +24 -0
- package/dist/adapters/astro.js.map +1 -0
- package/dist/adapters/index.d.ts +3 -0
- package/dist/adapters/index.js +9 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/nextjs.d.ts +7 -0
- package/dist/adapters/nextjs.js +136 -0
- package/dist/adapters/nextjs.js.map +1 -0
- package/dist/adapters/static.d.ts +7 -0
- package/dist/adapters/static.js +43 -0
- package/dist/adapters/static.js.map +1 -0
- package/dist/adapters/types.d.ts +22 -0
- package/dist/adapters/types.js +6 -0
- package/dist/adapters/types.js.map +1 -0
- package/dist/commands/build.d.ts +7 -0
- package/dist/commands/build.js +98 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/design.d.ts +3 -0
- package/dist/commands/design.js +39 -0
- package/dist/commands/design.js.map +1 -0
- package/dist/commands/discover.d.ts +9 -0
- package/dist/commands/discover.js +91 -0
- package/dist/commands/discover.js.map +1 -0
- package/dist/commands/generate.d.ts +7 -0
- package/dist/commands/generate.js +105 -0
- package/dist/commands/generate.js.map +1 -0
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.js +99 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/preview.d.ts +5 -0
- package/dist/commands/preview.js +41 -0
- package/dist/commands/preview.js.map +1 -0
- package/dist/commands/research.d.ts +1 -0
- package/dist/commands/research.js +38 -0
- package/dist/commands/research.js.map +1 -0
- package/dist/commands/sync.d.ts +1 -0
- package/dist/commands/sync.js +53 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/commands/workflow.d.ts +1 -0
- package/dist/commands/workflow.js +38 -0
- package/dist/commands/workflow.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +113 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/auth.d.ts +15 -0
- package/dist/mcp/auth.js +56 -0
- package/dist/mcp/auth.js.map +1 -0
- package/dist/mcp/client.d.ts +65 -0
- package/dist/mcp/client.js +302 -0
- package/dist/mcp/client.js.map +1 -0
- package/dist/mcp/tools.d.ts +26 -0
- package/dist/mcp/tools.js +46 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/research/business-researcher.d.ts +41 -0
- package/dist/research/business-researcher.js +888 -0
- package/dist/research/business-researcher.js.map +1 -0
- package/dist/research/crawler.d.ts +11 -0
- package/dist/research/crawler.js +56 -0
- package/dist/research/crawler.js.map +1 -0
- package/dist/research/design-synthesizer.d.ts +46 -0
- package/dist/research/design-synthesizer.js +628 -0
- package/dist/research/design-synthesizer.js.map +1 -0
- package/dist/research/differ.d.ts +19 -0
- package/dist/research/differ.js +58 -0
- package/dist/research/differ.js.map +1 -0
- package/dist/research/known-state.json +68 -0
- package/dist/research/research-cache.d.ts +6 -0
- package/dist/research/research-cache.js +62 -0
- package/dist/research/research-cache.js.map +1 -0
- package/dist/research/types.d.ts +98 -0
- package/dist/research/types.js +6 -0
- package/dist/research/types.js.map +1 -0
- package/dist/research/updater.d.ts +5 -0
- package/dist/research/updater.js +43 -0
- package/dist/research/updater.js.map +1 -0
- package/dist/templates/design-md.d.ts +52 -0
- package/dist/templates/design-md.js +315 -0
- package/dist/templates/design-md.js.map +1 -0
- package/dist/templates/prompts.d.ts +31 -0
- package/dist/templates/prompts.js +39 -0
- package/dist/templates/prompts.js.map +1 -0
- package/dist/templates/workflows.d.ts +9 -0
- package/dist/templates/workflows.js +21 -0
- package/dist/templates/workflows.js.map +1 -0
- package/dist/tui/App.d.ts +1 -0
- package/dist/tui/App.js +87 -0
- package/dist/tui/App.js.map +1 -0
- package/dist/tui/Dashboard.d.ts +5 -0
- package/dist/tui/Dashboard.js +23 -0
- package/dist/tui/Dashboard.js.map +1 -0
- package/dist/tui/DesignEditor.d.ts +6 -0
- package/dist/tui/DesignEditor.js +76 -0
- package/dist/tui/DesignEditor.js.map +1 -0
- package/dist/tui/PromptBuilder.d.ts +5 -0
- package/dist/tui/PromptBuilder.js +102 -0
- package/dist/tui/PromptBuilder.js.map +1 -0
- package/dist/tui/components/QuotaMeter.d.ts +8 -0
- package/dist/tui/components/QuotaMeter.js +10 -0
- package/dist/tui/components/QuotaMeter.js.map +1 -0
- package/dist/tui/components/ScreenCard.d.ts +7 -0
- package/dist/tui/components/ScreenCard.js +6 -0
- package/dist/tui/components/ScreenCard.js.map +1 -0
- package/dist/tui/components/Spinner.d.ts +5 -0
- package/dist/tui/components/Spinner.js +7 -0
- package/dist/tui/components/Spinner.js.map +1 -0
- package/dist/tui/components/StatusBar.d.ts +7 -0
- package/dist/tui/components/StatusBar.js +6 -0
- package/dist/tui/components/StatusBar.js.map +1 -0
- package/dist/utils/config.d.ts +26 -0
- package/dist/utils/config.js +66 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/design-validator.d.ts +44 -0
- package/dist/utils/design-validator.js +396 -0
- package/dist/utils/design-validator.js.map +1 -0
- package/dist/utils/logger.d.ts +8 -0
- package/dist/utils/logger.js +10 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/output-validator.d.ts +18 -0
- package/dist/utils/output-validator.js +194 -0
- package/dist/utils/output-validator.js.map +1 -0
- package/dist/utils/preview.d.ts +4 -0
- package/dist/utils/preview.js +49 -0
- package/dist/utils/preview.js.map +1 -0
- package/dist/utils/prompt-enhancer.d.ts +21 -0
- package/dist/utils/prompt-enhancer.js +104 -0
- package/dist/utils/prompt-enhancer.js.map +1 -0
- package/dist/utils/quota.d.ts +18 -0
- package/dist/utils/quota.js +49 -0
- package/dist/utils/quota.js.map +1 -0
- package/dist/utils/validators.d.ts +125 -0
- package/dist/utils/validators.js +110 -0
- package/dist/utils/validators.js.map +1 -0
- package/package.json +77 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge-build
|
|
3
|
+
description: >
|
|
4
|
+
Build a deployable site from generated Stitch screens. Use when the user
|
|
5
|
+
wants to export, ship, publish, or turn their screens into a real website.
|
|
6
|
+
Maps screens to routes and generates a static HTML, Astro, or Next.js project.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
Build a deployable site from Stitch screens.
|
|
10
|
+
|
|
11
|
+
## Step 1: Select Framework
|
|
12
|
+
|
|
13
|
+
Present these options to the user before doing anything else:
|
|
14
|
+
|
|
15
|
+
| Framework | Best For | What It Generates |
|
|
16
|
+
|-----------|----------|-------------------|
|
|
17
|
+
| **static** (default) | Simple sites, GitHub Pages | Plain HTML files with shared nav, ready to deploy anywhere |
|
|
18
|
+
| **astro** | Content sites, blogs | Astro project via Stitch MCP `build_site` tool |
|
|
19
|
+
| **nextjs** | Apps, dynamic sites | Next.js App Router project with static export |
|
|
20
|
+
|
|
21
|
+
Check `.forgerc.json` for a saved `framework` preference. If set, confirm with the user: "Your config prefers [framework]. Use that, or choose a different one?"
|
|
22
|
+
|
|
23
|
+
## Step 2: Select Project & Screens
|
|
24
|
+
|
|
25
|
+
1. List all projects using `mcp__stitch__list_projects`. If multiple exist, ask which to build from.
|
|
26
|
+
2. List all screens using `mcp__stitch__list_screens`.
|
|
27
|
+
3. Present the route mapping for confirmation:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
Screen Route
|
|
31
|
+
Landing Page -> /
|
|
32
|
+
About Us -> /about-us
|
|
33
|
+
Pricing -> /pricing
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Rules:
|
|
37
|
+
- First screen or any named "home/landing/hero/main" maps to `/`
|
|
38
|
+
- Others map to `/{screen-name-lowercase}`
|
|
39
|
+
- Ask if the user wants to adjust any routes
|
|
40
|
+
|
|
41
|
+
## Step 3: Build
|
|
42
|
+
|
|
43
|
+
### Static HTML
|
|
44
|
+
For each screen:
|
|
45
|
+
1. Retrieve HTML using `mcp__stitch__get_screen_code` (or `mcp__stitch__get_screen` + download URL)
|
|
46
|
+
2. Save to `dist/{route}/index.html`
|
|
47
|
+
3. Inject shared navigation at the top of each page
|
|
48
|
+
4. Inject the Stitch Forge signature comment: `<!-- Built with Stitch Forge -->`
|
|
49
|
+
|
|
50
|
+
Tell the user: "Your site is in the `dist/` folder. Open `dist/index.html` in your browser to preview. To deploy to GitHub Pages, push the `dist/` folder. For Netlify/Vercel, point to the `dist/` directory."
|
|
51
|
+
|
|
52
|
+
### Astro
|
|
53
|
+
1. Call `mcp__stitch__build_site` with the project ID and route mapping
|
|
54
|
+
2. Follow the Stitch MCP output instructions
|
|
55
|
+
|
|
56
|
+
Tell the user: "Stitch generated an Astro project. Follow the output instructions to install dependencies and run the dev server."
|
|
57
|
+
|
|
58
|
+
### Next.js
|
|
59
|
+
For each screen:
|
|
60
|
+
1. Retrieve HTML using `mcp__stitch__get_screen_code`
|
|
61
|
+
2. Generate `app/{route}/page.tsx` with the HTML as a React component
|
|
62
|
+
3. Generate `package.json`, `next.config.js`, `tsconfig.json`, `app/layout.tsx`
|
|
63
|
+
4. Inject the Stitch Forge signature as a JSX comment
|
|
64
|
+
|
|
65
|
+
Tell the user: "Your Next.js project is in `dist/`. To run it: open a terminal, navigate to `dist/`, run `npm install`, then `npm run dev`. To deploy: push to Vercel or run `npm run build` for static export."
|
|
66
|
+
|
|
67
|
+
## Step 4: Next Steps
|
|
68
|
+
|
|
69
|
+
After building, suggest:
|
|
70
|
+
- "Open `dist/index.html` in your browser to review" (static)
|
|
71
|
+
- "If you want to refine a page, use `/forge-generate` with a specific change"
|
|
72
|
+
- "To deploy, push the `dist/` folder to your hosting provider"
|
|
73
|
+
|
|
74
|
+
## Guardrails
|
|
75
|
+
|
|
76
|
+
- ALWAYS confirm the framework choice before building
|
|
77
|
+
- ALWAYS show the route mapping before proceeding
|
|
78
|
+
- NEVER output raw CLI commands without context — explain what each step does
|
|
79
|
+
- If no screens exist, suggest running `/forge-generate` first
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge-design
|
|
3
|
+
description: >
|
|
4
|
+
Generate a DESIGN.md from a brand brief. Use when the user wants to
|
|
5
|
+
create a visual identity, design system, or brand style guide for a
|
|
6
|
+
web project. Also use when starting a new website from scratch. Asks
|
|
7
|
+
for company name, industry, target audience, and aesthetic direction.
|
|
8
|
+
Outputs an 8-section design spec with colors, typography, and anti-slop rules.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
Generate a complete DESIGN.md for a web project using Google Stitch.
|
|
12
|
+
|
|
13
|
+
## Instructions
|
|
14
|
+
|
|
15
|
+
1. If the user provided a brand brief as argument, use it. Otherwise ask for:
|
|
16
|
+
- Company/product name
|
|
17
|
+
- Industry or domain
|
|
18
|
+
- Target audience
|
|
19
|
+
- Aesthetic direction (e.g., "premium corporate", "playful startup", "minimal SaaS")
|
|
20
|
+
|
|
21
|
+
2. Generate a DESIGN.md with exactly these 8 sections:
|
|
22
|
+
|
|
23
|
+
1. **Visual Theme & Atmosphere** — 2-3 evocative sentences describing overall aesthetic. Use specific adjectives and references, not generic terms.
|
|
24
|
+
2. **Color Palette & Roles** — Markdown table with columns: Role, Name, Hex, Usage. Minimum 5 roles (Primary, Secondary, Surface, On-Surface, Error). All colors as hex values, never descriptions like "trustworthy blue". Give each color a descriptive name (e.g., "Deep Navy" not just "Primary").
|
|
25
|
+
3. **Typography** — Font families from Google Fonts (avoid Inter, Poppins as primary — they signal AI-generated design). Sizes in rem/px, weights as numbers (400/600/700), line heights. Include heading, body, and mono. Use a serif/sans-serif pairing for contrast.
|
|
26
|
+
4. **Spacing & Layout** — Base unit (e.g., 4px), scale, max content width, grid system, breakpoints.
|
|
27
|
+
5. **Component Patterns** — At least 3 components (buttons, cards, inputs, etc.) with structure and style rules. Vary border-radius and shadow styles.
|
|
28
|
+
6. **Iconography** — Style (outline/solid/duotone), default size, source library.
|
|
29
|
+
7. **Imagery Guidelines** — Photo style, illustration style, aspect ratios. Be specific about what imagery communicates.
|
|
30
|
+
8. **Do's and Don'ts** — At least 3 of each. MUST include these anti-slop defaults:
|
|
31
|
+
|
|
32
|
+
### Do
|
|
33
|
+
- Do use asymmetric or non-standard layouts for at least one feature section
|
|
34
|
+
- Do vary card sizes and spacing to create visual rhythm
|
|
35
|
+
- Do use the specified color palette exclusively (no AI-chosen colors)
|
|
36
|
+
- Do maintain high contrast (4.5:1 minimum) for all text
|
|
37
|
+
- Do vary section backgrounds (alternate between light/dark surfaces)
|
|
38
|
+
|
|
39
|
+
### Don't
|
|
40
|
+
- Don't use Inter, Poppins, or system sans-serif as the primary font
|
|
41
|
+
- Don't use purple-to-blue gradients anywhere
|
|
42
|
+
- Don't use uniform border-radius (>12px) on all elements
|
|
43
|
+
- Don't use standard three-column icon grids as the second page section
|
|
44
|
+
- Don't center-align body text longer than 2 lines
|
|
45
|
+
- Don't use generic stock photo illustrations (3D blobs, abstract shapes)
|
|
46
|
+
|
|
47
|
+
3. Validation rules:
|
|
48
|
+
- All colors must be hex values (#RRGGBB)
|
|
49
|
+
- Font sizes in rem or px only
|
|
50
|
+
- At least 5 color roles, 3 component patterns, 3 Do's and 3 Don'ts
|
|
51
|
+
- Keep total under ~3000 tokens (Stitch reads it as context on every generation)
|
|
52
|
+
|
|
53
|
+
4. If DESIGN.md already exists, ask before overwriting.
|
|
54
|
+
|
|
55
|
+
5. Write the file to `DESIGN.md` at the project root.
|
|
56
|
+
|
|
57
|
+
6. After writing, check if a Stitch design system exists using `mcp__stitch__list_design_systems`. If the user has a Stitch project:
|
|
58
|
+
- Offer to create a design system with `mcp__stitch__create_design_system`
|
|
59
|
+
- Or update an existing one with `mcp__stitch__update_design_system`
|
|
60
|
+
- Apply it to the project with `mcp__stitch__apply_design_system` so all future generations respect it
|
|
61
|
+
|
|
62
|
+
7. **Next step**: Suggest running `/forge-generate` to create the first screen using the new design system.
|
|
63
|
+
|
|
64
|
+
Reference: See `docs/design-md-guide.md` for the full specification.
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge-discover
|
|
3
|
+
description: >
|
|
4
|
+
Research a business and generate a tailored DESIGN.md. Use when the user
|
|
5
|
+
wants to redesign a website, create a design system, or build a web
|
|
6
|
+
presence for a specific business. Investigates the business model,
|
|
7
|
+
analyzes competitors, understands the audience, and only generates
|
|
8
|
+
when confident enough. The recommended entry point for any real
|
|
9
|
+
business project.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Research a business and generate a tailored DESIGN.md with autonomous investigation.
|
|
13
|
+
|
|
14
|
+
## Core Principle: Understand Before Designing
|
|
15
|
+
|
|
16
|
+
NEVER generate a DESIGN.md until you understand the business. A beautiful design for the wrong business model is worse than no design at all.
|
|
17
|
+
|
|
18
|
+
## Phase 1: Gather Context (REQUIRED — cannot skip)
|
|
19
|
+
|
|
20
|
+
Before ANY research or generation, establish these fundamentals:
|
|
21
|
+
|
|
22
|
+
1. **What the business IS**:
|
|
23
|
+
- If only a company name is given, ask: "What does [company] do? What products or services do they offer?"
|
|
24
|
+
- If unclear whether physical or digital: "Do they sell online, in physical stores, or both?"
|
|
25
|
+
|
|
26
|
+
2. **Who the customers are**:
|
|
27
|
+
- "Who are their primary customers? (families, developers, enterprises, etc.)"
|
|
28
|
+
|
|
29
|
+
3. **What the website should achieve**:
|
|
30
|
+
- "What is the main goal of this website? (drive store visits, sell online, generate leads, inform)"
|
|
31
|
+
- This is CRITICAL — it determines the entire page structure
|
|
32
|
+
|
|
33
|
+
4. **Current web presence**:
|
|
34
|
+
- "Do they have a current website? What URL?"
|
|
35
|
+
|
|
36
|
+
If the user provides a detailed brief, extract answers from it. But if any critical info is missing (especially #1 and #3), ASK before proceeding. Do NOT assume.
|
|
37
|
+
|
|
38
|
+
## Phase 2: Research (autonomous)
|
|
39
|
+
|
|
40
|
+
Once you have the basics, research to validate and enrich:
|
|
41
|
+
|
|
42
|
+
5. **Search for the business**: Use WebSearch for "[company name]" and "[company name] business model"
|
|
43
|
+
- Determine: Is this physical retail? E-commerce? SaaS? Service?
|
|
44
|
+
- Find: Store count, locations, revenue model, market position
|
|
45
|
+
- Find: Slogan, tagline, brand messaging
|
|
46
|
+
|
|
47
|
+
6. **Analyze current website** (if URL available): Use WebFetch on the homepage
|
|
48
|
+
- Look at navigation items — what do they tell you about the business?
|
|
49
|
+
- "Sucursales/Stores/Locations" → physical retail
|
|
50
|
+
- "Cart/Checkout/Shop" → e-commerce
|
|
51
|
+
- "Login/Dashboard/API" → SaaS
|
|
52
|
+
- "Contact/Book/Schedule" → service
|
|
53
|
+
- Extract current brand colors from CSS
|
|
54
|
+
- Identify current fonts
|
|
55
|
+
- Note CTAs — what action does the site want visitors to take?
|
|
56
|
+
|
|
57
|
+
7. **Research competitors**: Use WebSearch for "[company name] competitors" or "[industry] [market] companies"
|
|
58
|
+
- Analyze 1-2 competitor websites via WebFetch
|
|
59
|
+
- Note their color schemes, fonts, and layout patterns
|
|
60
|
+
- Identify what to differentiate FROM
|
|
61
|
+
|
|
62
|
+
## Confidence Check (MUST pass before generating)
|
|
63
|
+
|
|
64
|
+
Rate your confidence on each dimension (0-100):
|
|
65
|
+
|
|
66
|
+
| Dimension | Minimum Required | What It Means |
|
|
67
|
+
|-----------|-----------------|---------------|
|
|
68
|
+
| Business model | >= 80 | You know what they do and how they make money |
|
|
69
|
+
| Website purpose | >= 80 | You know what the site should achieve |
|
|
70
|
+
| Audience | >= 60 | You know who the customers are |
|
|
71
|
+
| Visual identity | >= 40 | You have colors/fonts (can use presets if needed) |
|
|
72
|
+
| Competitive | >= 30 | You know at least who competitors are |
|
|
73
|
+
|
|
74
|
+
**Weighted average must be >= 70 to proceed.**
|
|
75
|
+
|
|
76
|
+
If below threshold:
|
|
77
|
+
- Ask the user for missing information
|
|
78
|
+
- Do more research
|
|
79
|
+
- DO NOT proceed until confident
|
|
80
|
+
|
|
81
|
+
Report your confidence: "My understanding confidence: [X]%. Business model: [type]. Proceeding to generate."
|
|
82
|
+
|
|
83
|
+
## Phase 3: Generate DESIGN.md
|
|
84
|
+
|
|
85
|
+
8. Generate DESIGN.md with **9 effective sections** (Section 1 expanded):
|
|
86
|
+
|
|
87
|
+
### Section 1: Visual Theme & Business Context
|
|
88
|
+
|
|
89
|
+
This section is the most important — Stitch reads it on every generation.
|
|
90
|
+
|
|
91
|
+
Include:
|
|
92
|
+
- 2-3 sentences describing the visual direction
|
|
93
|
+
- **Business Model**: What the company IS (e.g., "Physical retail grocery chain with 3,300+ stores")
|
|
94
|
+
- **Website Purpose**: What the site should DO (e.g., "Drive foot traffic to stores. NOT an e-commerce site.")
|
|
95
|
+
- **Primary User Goals**: Numbered list of what visitors want to accomplish
|
|
96
|
+
- **Key Page Elements**: What the site MUST have (e.g., "Store locator, weekly deals, category browse")
|
|
97
|
+
- **Avoid**: What the site must NOT have (e.g., "Shopping cart, checkout, add-to-cart buttons")
|
|
98
|
+
|
|
99
|
+
### Sections 2-7: Standard design tokens
|
|
100
|
+
Colors, typography, spacing, components, iconography, imagery — as before.
|
|
101
|
+
|
|
102
|
+
### Section 8: Do's and Don'ts
|
|
103
|
+
Standard anti-slop rules PLUS business-model-specific rules:
|
|
104
|
+
- Physical retail: "Do make store locator the primary CTA", "Don't add shopping cart"
|
|
105
|
+
- SaaS: "Do show product screenshots", "Don't use generic feature icons"
|
|
106
|
+
- Service: "Do make booking/contact primary", "Don't hide contact info"
|
|
107
|
+
|
|
108
|
+
## Phase 4: Validate & Present
|
|
109
|
+
|
|
110
|
+
9. Before writing, self-check:
|
|
111
|
+
- Does Section 1 include business model context? (REQUIRED)
|
|
112
|
+
- Does it explicitly state what the site is NOT? (REQUIRED for physical retail)
|
|
113
|
+
- Are Do's/Don'ts business-specific, not just visual? (REQUIRED)
|
|
114
|
+
- Are all colors hex values? (REQUIRED)
|
|
115
|
+
- Is it under 3000 tokens? (REQUIRED)
|
|
116
|
+
- Does it reference the actual audience? (REQUIRED)
|
|
117
|
+
|
|
118
|
+
10. Present findings to user:
|
|
119
|
+
- "Business type: [type]"
|
|
120
|
+
- "Website purpose: [purpose]"
|
|
121
|
+
- "Brand colors found: [colors]"
|
|
122
|
+
- "Competitor differentiation: [approach]"
|
|
123
|
+
- "Confidence: [X]%"
|
|
124
|
+
|
|
125
|
+
11. Write DESIGN.md and save research to `.forge-research/`.
|
|
126
|
+
|
|
127
|
+
12. Suggest first screen prompt that ALIGNS with the business model:
|
|
128
|
+
- Physical retail: "A landing page with hero, store locator as primary CTA, weekly deals section, and category browse"
|
|
129
|
+
- SaaS: "A landing page with product demo hero, feature section, pricing tiers, and signup CTA"
|
|
130
|
+
- Service: "A landing page with service overview, booking CTA, testimonials, and team section"
|
|
131
|
+
|
|
132
|
+
## Guardrails
|
|
133
|
+
|
|
134
|
+
- NEVER generate before understanding the business model
|
|
135
|
+
- NEVER assume e-commerce — most businesses in the world are NOT online stores
|
|
136
|
+
- ALWAYS include business context in Section 1 of DESIGN.md
|
|
137
|
+
- ALWAYS include what the site should NOT have (notFeatures)
|
|
138
|
+
- If unsure about the business model, ASK the user
|
|
139
|
+
- The DESIGN.md is not just a style guide — it's the business context that prevents wrong designs
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge-generate
|
|
3
|
+
description: >
|
|
4
|
+
Generate a screen in Google Stitch from a text description. Use when
|
|
5
|
+
the user wants to create a new web page, landing page, dashboard,
|
|
6
|
+
pricing page, about page, or any UI design. Also use when the user
|
|
7
|
+
says "design a page", "create a screen", or "build a webpage".
|
|
8
|
+
Uses DESIGN.md if available for visual consistency.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
Generate a screen in Google Stitch from a description.
|
|
12
|
+
|
|
13
|
+
## Guardrails (MUST follow)
|
|
14
|
+
|
|
15
|
+
Before sending any prompt to Stitch:
|
|
16
|
+
1. Verify prompt is under 5000 characters
|
|
17
|
+
2. Verify prompt targets ONE screen only (not multiple pages)
|
|
18
|
+
3. For refinements: verify ONE change only (not compound changes)
|
|
19
|
+
4. Reject vague requests ("make it better", "improve it") — ask for specifics
|
|
20
|
+
5. Check quota before generating: read `.forgerc.json` to see current usage
|
|
21
|
+
6. If DESIGN.md exists, reference it for visual consistency
|
|
22
|
+
7. Flag generic terms ("modern", "clean", "professional") and suggest specific UI/UX vocabulary replacements (e.g., "asymmetric hero layout", "bento grid", "sticky nav with CTA")
|
|
23
|
+
|
|
24
|
+
## Instructions
|
|
25
|
+
|
|
26
|
+
1. **Read DESIGN.md** if it exists at the project root. Use it as context for visual consistency.
|
|
27
|
+
|
|
28
|
+
2. **Guide the user** through building a good prompt using the zoom-out-zoom-in framework:
|
|
29
|
+
|
|
30
|
+
**Zoom out (context ~30%):**
|
|
31
|
+
- Product name and what it does
|
|
32
|
+
- Target user/audience
|
|
33
|
+
- Overall aesthetic direction
|
|
34
|
+
|
|
35
|
+
**Zoom in (specifics ~70%):**
|
|
36
|
+
- Page type (landing page, dashboard, pricing, about, contact, etc.)
|
|
37
|
+
- Goal of this screen
|
|
38
|
+
- Each section with specific descriptions
|
|
39
|
+
- UI patterns: "bento grid", "sticky header", "card layout"
|
|
40
|
+
- Specific numbers: "3 pricing tiers", "4 testimonials"
|
|
41
|
+
|
|
42
|
+
3. **Build the prompt** following this structure:
|
|
43
|
+
```
|
|
44
|
+
A [adjective] [page type] for "[Product Name]," a [product description].
|
|
45
|
+
Designed for [target user]. [Visual tone].
|
|
46
|
+
|
|
47
|
+
Include these sections:
|
|
48
|
+
1. [Section with brief description]
|
|
49
|
+
2. [Section with brief description]
|
|
50
|
+
...
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
4. **Generate the screen** by calling `mcp__stitch__generate_screen_from_text` with the prompt.
|
|
54
|
+
|
|
55
|
+
5. **After generation**, retrieve the screen code and save the HTML to `screens/[screen-name].html`.
|
|
56
|
+
|
|
57
|
+
6. **Preview the screen** after saving:
|
|
58
|
+
- Call `mcp__stitch__get_screen_image` with the project ID and screen ID to get a base64 PNG.
|
|
59
|
+
- Display the image inline so the user can see the result immediately.
|
|
60
|
+
|
|
61
|
+
7. For **refinements**, use this structure (one change at a time):
|
|
62
|
+
```
|
|
63
|
+
On the [specific section] of [screen name], [specific change]:
|
|
64
|
+
- [Detail 1]
|
|
65
|
+
- [Detail 2]
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
8. If generating multiple screens for a project, prefix subsequent prompts with:
|
|
69
|
+
"Following the same design language as the homepage..."
|
|
70
|
+
|
|
71
|
+
9. For **variants**, offer to call `mcp__stitch__generate_variants` to produce 2-3 alternative designs the user can compare before committing to one direction.
|
|
72
|
+
|
|
73
|
+
10. For **inline edits** to an existing screen, use `mcp__stitch__edit_screens` instead of regenerating from scratch.
|
|
74
|
+
|
|
75
|
+
11. **Next step**: Suggest "Preview with `/forge-preview` or generate another screen with `/forge-generate`"
|
|
76
|
+
|
|
77
|
+
Reference: See `docs/prompting-guide.md` for examples and strategies.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge-preview
|
|
3
|
+
description: >
|
|
4
|
+
Preview generated Stitch screens. Use when the user says "show me the
|
|
5
|
+
page", "what does it look like", or wants to see a screenshot of a
|
|
6
|
+
screen they generated. Displays screen images inline or opens HTML
|
|
7
|
+
files in the browser.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
Preview generated Stitch screens.
|
|
11
|
+
|
|
12
|
+
## Instructions
|
|
13
|
+
|
|
14
|
+
1. **Check for screens** in the `screens/` directory. If none exist, tell the user to run `/forge-generate` first.
|
|
15
|
+
|
|
16
|
+
2. **If a screen name was provided as argument**, find the matching `.html` file in `screens/`.
|
|
17
|
+
|
|
18
|
+
3. **If no argument**, list available screens and ask the user which one to preview.
|
|
19
|
+
|
|
20
|
+
4. **Get the screen image** by calling `mcp__stitch__get_screen_image` with the project ID and screen ID from `.forgerc.json`. This returns a base64-encoded PNG.
|
|
21
|
+
|
|
22
|
+
5. **Display the image inline** so the user can see the screen preview directly in the conversation.
|
|
23
|
+
|
|
24
|
+
6. **Also mention** that the user can open the HTML file in their browser: "You can also open `screens/{name}.html` in your browser for a full interactive preview."
|
|
25
|
+
|
|
26
|
+
7. **Next step**: "Refine with `/forge-generate` or build with `/forge-build`"
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge-research
|
|
3
|
+
description: >
|
|
4
|
+
Check for Google Stitch updates and refresh the local knowledge base.
|
|
5
|
+
Use when the user asks "what's new with Stitch", "are there any updates",
|
|
6
|
+
or wants to know about current Stitch capabilities, models, or quotas.
|
|
7
|
+
Searches official docs, blogs, and forums.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
Check for Google Stitch updates and refresh the local knowledge base.
|
|
11
|
+
|
|
12
|
+
## Instructions
|
|
13
|
+
|
|
14
|
+
1. **Search for recent Stitch updates** from these sources:
|
|
15
|
+
- Google Stitch documentation (stitch.withgoogle.com)
|
|
16
|
+
- Google AI blog posts about Stitch
|
|
17
|
+
- Google AI developer forums discussing Stitch
|
|
18
|
+
|
|
19
|
+
2. **Compare findings** against the current known state in `src/research/known-state.json`. Check for:
|
|
20
|
+
- New or changed AI models (names, quotas)
|
|
21
|
+
- New export options
|
|
22
|
+
- New or removed MCP tools
|
|
23
|
+
- Changed limitations
|
|
24
|
+
- New features or capabilities
|
|
25
|
+
|
|
26
|
+
3. **Report changes** with severity:
|
|
27
|
+
- **Breaking**: Changes that affect existing workflows (model removed, tool renamed)
|
|
28
|
+
- **Warning**: Changes that may affect usage (quota changes, new limitations)
|
|
29
|
+
- **Info**: New features, improvements, blog posts
|
|
30
|
+
|
|
31
|
+
4. **If changes found**, update:
|
|
32
|
+
- `src/research/known-state.json` with new data and current timestamp
|
|
33
|
+
- `docs/known-state.md` with human-readable version
|
|
34
|
+
|
|
35
|
+
5. **If no changes**, report "Knowledge base is current" with the last update date.
|
|
36
|
+
|
|
37
|
+
6. **Always show** the current known state summary:
|
|
38
|
+
- Available models and their monthly quotas
|
|
39
|
+
- Available MCP tools
|
|
40
|
+
- Known limitations
|
|
41
|
+
|
|
42
|
+
7. **Next step**: "Check if any changes affect your current project."
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge-sync
|
|
3
|
+
description: >
|
|
4
|
+
Sync local files with a Google Stitch project. Downloads all screens
|
|
5
|
+
and updates local config. Use when the user has made changes in
|
|
6
|
+
Stitch's web UI and wants to pull them into their local project.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
Sync local files with a Google Stitch project.
|
|
10
|
+
|
|
11
|
+
## Instructions
|
|
12
|
+
|
|
13
|
+
1. **Find the project** to sync from:
|
|
14
|
+
- If a project ID was provided as argument, use it
|
|
15
|
+
- Otherwise, call `mcp__stitch__list_projects` and show available projects
|
|
16
|
+
- Let the user pick which project to sync
|
|
17
|
+
|
|
18
|
+
2. **List all screens** in the project using `mcp__stitch__list_screens`.
|
|
19
|
+
|
|
20
|
+
3. **Show what will be synced**:
|
|
21
|
+
```
|
|
22
|
+
Project: [name] ([id])
|
|
23
|
+
Screens to sync: [count]
|
|
24
|
+
- Screen Name 1
|
|
25
|
+
- Screen Name 2
|
|
26
|
+
...
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
4. **Confirm** with the user before downloading.
|
|
30
|
+
|
|
31
|
+
5. **Download each screen** using `mcp__stitch__get_screen_code` and save the HTML to `screens/[screen-name].html`.
|
|
32
|
+
|
|
33
|
+
6. **Update `.forgerc.json`** with:
|
|
34
|
+
- `projectId`: the synced project ID
|
|
35
|
+
- `screens`: array of synced screen records (id, name, lastSynced timestamp)
|
|
36
|
+
- `lastSync`: current timestamp
|
|
37
|
+
|
|
38
|
+
7. **Report results**:
|
|
39
|
+
- How many screens were synced
|
|
40
|
+
- Which files were created/updated in `screens/`
|
|
41
|
+
- Any screens that failed to download
|
|
42
|
+
|
|
43
|
+
8. **Check for design system** using `mcp__stitch__list_design_systems`. If one exists and no local DESIGN.md is found, suggest running `/forge-design` to create one.
|
|
44
|
+
|
|
45
|
+
9. **Next step**: "Run `/forge-preview` to see synced screens."
|
package/DESIGN.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Stitch Forge — Design System
|
|
2
|
+
|
|
3
|
+
## 1. Visual Theme & Business Context
|
|
4
|
+
|
|
5
|
+
Dark futuristic terminal aesthetic with neon accents — inspired by IDE color schemes and cyberpunk UI. The design feels like a premium developer tool: precise, technical, confident. Glassmorphism cards with subtle backdrop blur create depth against the dark canvas. The visual language says "this is built by developers, for developers" while remaining approachable enough for designers exploring AI-powered workflows.
|
|
6
|
+
|
|
7
|
+
**Business Model**: Open source CLI framework — free to use, community-driven, MIT licensed.
|
|
8
|
+
**Website Purpose**: Drive tool adoption (npm install / GitHub clone) and grow the open source community (GitHub stars, contributions, discussions). NOT a SaaS product — no pricing, no signup, no user accounts.
|
|
9
|
+
**Primary User Goals**:
|
|
10
|
+
1. Understand what Stitch Forge does in under 30 seconds
|
|
11
|
+
2. See the workflow in action (design → generate → build)
|
|
12
|
+
3. Install and start using the CLI
|
|
13
|
+
4. Explore Claude Code slash commands
|
|
14
|
+
5. Star the repo or contribute
|
|
15
|
+
|
|
16
|
+
**Key Page Elements**: Hero with clear value proposition, workflow visualization, feature highlights, Claude Code integration showcase, installation command, GitHub CTA.
|
|
17
|
+
**Avoid on this site**: Pricing pages, login/signup flows, user dashboards, enterprise contact forms, SaaS trial CTAs, testimonial carousels with fake headshots.
|
|
18
|
+
|
|
19
|
+
## 2. Color Palette & Roles
|
|
20
|
+
|
|
21
|
+
| Role | Name | Hex | Usage |
|
|
22
|
+
|------|------|-----|-------|
|
|
23
|
+
| Primary | Forge Purple | #6C5CE7 | CTAs, active states, key highlights, command prefixes |
|
|
24
|
+
| Secondary | Neon Cyan | #00CEC9 | Accent links, code syntax, secondary emphasis |
|
|
25
|
+
| Tertiary | Hot Pink | #FD79A8 | Badges, notifications, warning highlights |
|
|
26
|
+
| Surface | Void Black | #0F0F1A | Page background, card backgrounds |
|
|
27
|
+
| On-Surface | Cloud White | #E8E8F0 | Body text, descriptions |
|
|
28
|
+
| Heading | Pure White | #FFFFFF | H1, H2, nav links, strong emphasis |
|
|
29
|
+
| Muted | Smoke | #2D2D3F | Borders, disabled states, code block backgrounds |
|
|
30
|
+
| Glass | Glass White | rgba(255,255,255,0.05) | Card surfaces, glassmorphism overlays |
|
|
31
|
+
|
|
32
|
+
## 3. Typography
|
|
33
|
+
|
|
34
|
+
- **Heading**: "Space Grotesk", sans-serif
|
|
35
|
+
- **Body**: "DM Sans", sans-serif
|
|
36
|
+
- **Mono**: "JetBrains Mono", monospace (for code blocks, terminal output, commands)
|
|
37
|
+
|
|
38
|
+
| Element | Size | Weight | Line Height |
|
|
39
|
+
|---------|------|--------|-------------|
|
|
40
|
+
| H1 | 3.5rem | 700 | 1.1 |
|
|
41
|
+
| H2 | 2.25rem | 700 | 1.15 |
|
|
42
|
+
| H3 | 1.5rem | 600 | 1.3 |
|
|
43
|
+
| Body | 1rem | 400 | 1.7 |
|
|
44
|
+
| Small | 0.875rem | 400 | 1.5 |
|
|
45
|
+
| Code | 0.9rem | 400 | 1.6 |
|
|
46
|
+
| Command | 1.125rem | 500 | 1.4 |
|
|
47
|
+
|
|
48
|
+
## 4. Spacing & Layout
|
|
49
|
+
|
|
50
|
+
- **Base unit**: 4px
|
|
51
|
+
- **Scale**: 4, 8, 12, 16, 24, 32, 48, 64, 96, 128
|
|
52
|
+
- **Max content width**: 1140px
|
|
53
|
+
- **Grid**: 12-column, 24px gutter
|
|
54
|
+
- **Breakpoints**: 640px (sm), 768px (md), 1024px (lg), 1280px (xl)
|
|
55
|
+
- **Section vertical padding**: 80px desktop, 48px mobile
|
|
56
|
+
|
|
57
|
+
## 5. Component Patterns
|
|
58
|
+
|
|
59
|
+
### Buttons
|
|
60
|
+
- Primary: Forge Purple fill, white text, 8px radius, 14px 28px padding, subtle glow on hover
|
|
61
|
+
- Secondary: transparent with 1px Forge Purple border, Forge Purple text, fill on hover
|
|
62
|
+
- Ghost: transparent, Cloud White text, Muted background on hover
|
|
63
|
+
- Install CTA: Mono font, Muted background, Neon Cyan text, copy-to-clipboard icon
|
|
64
|
+
|
|
65
|
+
### Glass Cards
|
|
66
|
+
- Glass White background with `backdrop-filter: blur(12px)`, 1px border Muted, 12px radius, 24px padding
|
|
67
|
+
- Hover: border shifts to Forge Purple at 30% opacity
|
|
68
|
+
- Used for features, workflow steps, command showcases
|
|
69
|
+
|
|
70
|
+
### Code Blocks
|
|
71
|
+
- Muted background (#1E1E2E), JetBrains Mono font, 8px radius, 16px padding
|
|
72
|
+
- Syntax highlighting: strings in Neon Cyan, keywords in Forge Purple, comments in #636381
|
|
73
|
+
- Copy button top-right, Ghost style
|
|
74
|
+
|
|
75
|
+
### Terminal Mockup
|
|
76
|
+
- Muted background with fake window chrome (three dots: #FF5F57, #FEBC2E, #28C840)
|
|
77
|
+
- Content in JetBrains Mono with realistic command output
|
|
78
|
+
- Used in hero to show the forge workflow
|
|
79
|
+
|
|
80
|
+
## 6. Iconography
|
|
81
|
+
|
|
82
|
+
Lucide icons, 24px default, 1.5px stroke, outline style. Forge Purple for interactive icons, Cloud White for decorative. Use terminal-related icons: Terminal, Code, Palette, Layers, Zap, GitBranch, Package, Eye.
|
|
83
|
+
|
|
84
|
+
## 7. Imagery Guidelines
|
|
85
|
+
|
|
86
|
+
No photography — this is a developer tool. Use: terminal mockups showing real CLI output, code editor screenshots with syntax highlighting, abstract geometric patterns (low-poly mesh, grid lines, particle effects) as section backgrounds. Animated gradient orbs (purple-to-cyan) as decorative elements. All imagery should reinforce the "built in the terminal" identity.
|
|
87
|
+
|
|
88
|
+
Avoid: stock photos of people at computers, generic SaaS dashboard screenshots, AI-generated robot/brain imagery, clipart-style illustrations.
|
|
89
|
+
|
|
90
|
+
## 8. Do's and Don'ts
|
|
91
|
+
|
|
92
|
+
### Do
|
|
93
|
+
- Use the terminal mockup as the hero centerpiece — show the actual workflow
|
|
94
|
+
- Display real CLI commands with copy-to-clipboard functionality
|
|
95
|
+
- Show the slash commands (`/forge-design`, `/forge-generate`, etc.) as interactive elements
|
|
96
|
+
- Use glassmorphism cards consistently for content sections
|
|
97
|
+
- Keep the dark background throughout — no light sections
|
|
98
|
+
- Use Neon Cyan for links and interactive code elements
|
|
99
|
+
- Include the GitHub star count and npm install command prominently
|
|
100
|
+
- Use monospace font for any command, path, or technical term
|
|
101
|
+
- Add subtle glow effects on interactive elements (buttons, cards on hover)
|
|
102
|
+
|
|
103
|
+
### Don't
|
|
104
|
+
- Don't use Inter, Poppins, or system sans-serif as the primary font
|
|
105
|
+
- Don't use purple-to-blue gradients (use purple-to-cyan instead for brand consistency)
|
|
106
|
+
- Don't add pricing, signup, or login elements — this is free open source software
|
|
107
|
+
- Don't use light backgrounds for any main content section
|
|
108
|
+
- Don't use photography or realistic illustrations
|
|
109
|
+
- Don't use uniform border-radius (>16px) on all elements
|
|
110
|
+
- Don't use standard three-column icon grids as the second page section
|
|
111
|
+
- Don't include testimonials with stock headshots
|
|
112
|
+
- Don't use generic SaaS language ("revolutionize your workflow", "seamless integration")
|
|
113
|
+
- Don't use a hamburger menu on desktop — keep nav items visible
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Fernando Rodriguez Memije
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|