popeye-cli 1.4.7 → 1.6.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.
- package/CHANGELOG.md +54 -0
- package/README.md +264 -63
- package/dist/adapters/gemini.d.ts +1 -0
- package/dist/adapters/gemini.d.ts.map +1 -1
- package/dist/adapters/gemini.js +9 -4
- package/dist/adapters/gemini.js.map +1 -1
- package/dist/adapters/grok.d.ts +1 -0
- package/dist/adapters/grok.d.ts.map +1 -1
- package/dist/adapters/grok.js +9 -4
- package/dist/adapters/grok.js.map +1 -1
- package/dist/adapters/openai.d.ts +1 -1
- package/dist/adapters/openai.d.ts.map +1 -1
- package/dist/adapters/openai.js +35 -9
- package/dist/adapters/openai.js.map +1 -1
- package/dist/cli/commands/create.d.ts.map +1 -1
- package/dist/cli/commands/create.js +54 -4
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/interactive.d.ts +29 -0
- package/dist/cli/interactive.d.ts.map +1 -1
- package/dist/cli/interactive.js +132 -7
- package/dist/cli/interactive.js.map +1 -1
- package/dist/generators/all.d.ts +8 -2
- package/dist/generators/all.d.ts.map +1 -1
- package/dist/generators/all.js +37 -316
- package/dist/generators/all.js.map +1 -1
- package/dist/generators/doc-parser.d.ts +64 -0
- package/dist/generators/doc-parser.d.ts.map +1 -0
- package/dist/generators/doc-parser.js +407 -0
- package/dist/generators/doc-parser.js.map +1 -0
- package/dist/generators/frontend-design-analyzer.d.ts +30 -0
- package/dist/generators/frontend-design-analyzer.d.ts.map +1 -0
- package/dist/generators/frontend-design-analyzer.js +208 -0
- package/dist/generators/frontend-design-analyzer.js.map +1 -0
- package/dist/generators/shared-packages.d.ts +45 -0
- package/dist/generators/shared-packages.d.ts.map +1 -0
- package/dist/generators/shared-packages.js +456 -0
- package/dist/generators/shared-packages.js.map +1 -0
- package/dist/generators/templates/index.d.ts +8 -0
- package/dist/generators/templates/index.d.ts.map +1 -1
- package/dist/generators/templates/index.js +8 -0
- package/dist/generators/templates/index.js.map +1 -1
- package/dist/generators/templates/website-components.d.ts +33 -0
- package/dist/generators/templates/website-components.d.ts.map +1 -0
- package/dist/generators/templates/website-components.js +303 -0
- package/dist/generators/templates/website-components.js.map +1 -0
- package/dist/generators/templates/website-config.d.ts +55 -0
- package/dist/generators/templates/website-config.d.ts.map +1 -0
- package/dist/generators/templates/website-config.js +425 -0
- package/dist/generators/templates/website-config.js.map +1 -0
- package/dist/generators/templates/website-conversion.d.ts +27 -0
- package/dist/generators/templates/website-conversion.d.ts.map +1 -0
- package/dist/generators/templates/website-conversion.js +326 -0
- package/dist/generators/templates/website-conversion.js.map +1 -0
- package/dist/generators/templates/website-landing.d.ts +24 -0
- package/dist/generators/templates/website-landing.d.ts.map +1 -0
- package/dist/generators/templates/website-landing.js +276 -0
- package/dist/generators/templates/website-landing.js.map +1 -0
- package/dist/generators/templates/website-layout.d.ts +42 -0
- package/dist/generators/templates/website-layout.d.ts.map +1 -0
- package/dist/generators/templates/website-layout.js +408 -0
- package/dist/generators/templates/website-layout.js.map +1 -0
- package/dist/generators/templates/website-pricing.d.ts +11 -0
- package/dist/generators/templates/website-pricing.d.ts.map +1 -0
- package/dist/generators/templates/website-pricing.js +313 -0
- package/dist/generators/templates/website-pricing.js.map +1 -0
- package/dist/generators/templates/website-sections.d.ts +102 -0
- package/dist/generators/templates/website-sections.d.ts.map +1 -0
- package/dist/generators/templates/website-sections.js +444 -0
- package/dist/generators/templates/website-sections.js.map +1 -0
- package/dist/generators/templates/website-seo.d.ts +76 -0
- package/dist/generators/templates/website-seo.d.ts.map +1 -0
- package/dist/generators/templates/website-seo.js +326 -0
- package/dist/generators/templates/website-seo.js.map +1 -0
- package/dist/generators/templates/website.d.ts +10 -83
- package/dist/generators/templates/website.d.ts.map +1 -1
- package/dist/generators/templates/website.js +12 -875
- package/dist/generators/templates/website.js.map +1 -1
- package/dist/generators/website-content-scanner.d.ts +37 -0
- package/dist/generators/website-content-scanner.d.ts.map +1 -0
- package/dist/generators/website-content-scanner.js +165 -0
- package/dist/generators/website-content-scanner.js.map +1 -0
- package/dist/generators/website-context.d.ts +119 -0
- package/dist/generators/website-context.d.ts.map +1 -0
- package/dist/generators/website-context.js +350 -0
- package/dist/generators/website-context.js.map +1 -0
- package/dist/generators/website-debug.d.ts +68 -0
- package/dist/generators/website-debug.d.ts.map +1 -0
- package/dist/generators/website-debug.js +93 -0
- package/dist/generators/website-debug.js.map +1 -0
- package/dist/generators/website.d.ts +5 -0
- package/dist/generators/website.d.ts.map +1 -1
- package/dist/generators/website.js +136 -11
- package/dist/generators/website.js.map +1 -1
- package/dist/generators/workspace-root.d.ts +27 -0
- package/dist/generators/workspace-root.d.ts.map +1 -0
- package/dist/generators/workspace-root.js +100 -0
- package/dist/generators/workspace-root.js.map +1 -0
- package/dist/state/index.d.ts +35 -0
- package/dist/state/index.d.ts.map +1 -1
- package/dist/state/index.js +40 -0
- package/dist/state/index.js.map +1 -1
- package/dist/types/consensus.d.ts +3 -0
- package/dist/types/consensus.d.ts.map +1 -1
- package/dist/types/consensus.js +1 -0
- package/dist/types/consensus.js.map +1 -1
- package/dist/types/website-strategy.d.ts +263 -0
- package/dist/types/website-strategy.d.ts.map +1 -0
- package/dist/types/website-strategy.js +105 -0
- package/dist/types/website-strategy.js.map +1 -0
- package/dist/types/workflow.d.ts +21 -0
- package/dist/types/workflow.d.ts.map +1 -1
- package/dist/types/workflow.js +8 -0
- package/dist/types/workflow.js.map +1 -1
- package/dist/upgrade/handlers.d.ts +15 -0
- package/dist/upgrade/handlers.d.ts.map +1 -1
- package/dist/upgrade/handlers.js +52 -0
- package/dist/upgrade/handlers.js.map +1 -1
- package/dist/workflow/auto-fix-bundler.d.ts +37 -0
- package/dist/workflow/auto-fix-bundler.d.ts.map +1 -0
- package/dist/workflow/auto-fix-bundler.js +320 -0
- package/dist/workflow/auto-fix-bundler.js.map +1 -0
- package/dist/workflow/auto-fix.d.ts.map +1 -1
- package/dist/workflow/auto-fix.js +10 -3
- package/dist/workflow/auto-fix.js.map +1 -1
- package/dist/workflow/consensus.d.ts.map +1 -1
- package/dist/workflow/consensus.js +2 -0
- package/dist/workflow/consensus.js.map +1 -1
- package/dist/workflow/execution-mode.d.ts.map +1 -1
- package/dist/workflow/execution-mode.js +18 -0
- package/dist/workflow/execution-mode.js.map +1 -1
- package/dist/workflow/index.d.ts +4 -0
- package/dist/workflow/index.d.ts.map +1 -1
- package/dist/workflow/index.js +37 -0
- package/dist/workflow/index.js.map +1 -1
- package/dist/workflow/overview.d.ts +89 -0
- package/dist/workflow/overview.d.ts.map +1 -0
- package/dist/workflow/overview.js +358 -0
- package/dist/workflow/overview.js.map +1 -0
- package/dist/workflow/plan-mode.d.ts +6 -4
- package/dist/workflow/plan-mode.d.ts.map +1 -1
- package/dist/workflow/plan-mode.js +148 -6
- package/dist/workflow/plan-mode.js.map +1 -1
- package/dist/workflow/website-strategy.d.ts +79 -0
- package/dist/workflow/website-strategy.d.ts.map +1 -0
- package/dist/workflow/website-strategy.js +310 -0
- package/dist/workflow/website-strategy.js.map +1 -0
- package/dist/workflow/website-updater.d.ts +17 -0
- package/dist/workflow/website-updater.d.ts.map +1 -0
- package/dist/workflow/website-updater.js +116 -0
- package/dist/workflow/website-updater.js.map +1 -0
- package/dist/workflow/workflow-logger.d.ts +1 -1
- package/dist/workflow/workflow-logger.d.ts.map +1 -1
- package/dist/workflow/workflow-logger.js.map +1 -1
- package/package.json +1 -1
- package/src/adapters/gemini.ts +10 -4
- package/src/adapters/grok.ts +10 -4
- package/src/adapters/openai.ts +38 -6
- package/src/cli/commands/create.ts +58 -4
- package/src/cli/interactive.ts +143 -7
- package/src/generators/all.ts +49 -332
- package/src/generators/doc-parser.ts +449 -0
- package/src/generators/frontend-design-analyzer.ts +261 -0
- package/src/generators/shared-packages.ts +500 -0
- package/src/generators/templates/index.ts +8 -0
- package/src/generators/templates/website-components.ts +330 -0
- package/src/generators/templates/website-config.ts +444 -0
- package/src/generators/templates/website-conversion.ts +341 -0
- package/src/generators/templates/website-landing.ts +331 -0
- package/src/generators/templates/website-layout.ts +443 -0
- package/src/generators/templates/website-pricing.ts +330 -0
- package/src/generators/templates/website-sections.ts +541 -0
- package/src/generators/templates/website-seo.ts +370 -0
- package/src/generators/templates/website.ts +38 -905
- package/src/generators/website-content-scanner.ts +208 -0
- package/src/generators/website-context.ts +493 -0
- package/src/generators/website-debug.ts +130 -0
- package/src/generators/website.ts +178 -20
- package/src/generators/workspace-root.ts +113 -0
- package/src/state/index.ts +56 -0
- package/src/types/consensus.ts +3 -0
- package/src/types/website-strategy.ts +243 -0
- package/src/types/workflow.ts +21 -0
- package/src/upgrade/handlers.ts +65 -0
- package/src/workflow/auto-fix-bundler.ts +392 -0
- package/src/workflow/auto-fix.ts +11 -3
- package/src/workflow/consensus.ts +2 -0
- package/src/workflow/execution-mode.ts +21 -0
- package/src/workflow/index.ts +37 -0
- package/src/workflow/overview.ts +475 -0
- package/src/workflow/plan-mode.ts +193 -8
- package/src/workflow/website-strategy.ts +379 -0
- package/src/workflow/website-updater.ts +142 -0
- package/src/workflow/workflow-logger.ts +1 -0
- package/tests/adapters/persona-switching.test.ts +63 -0
- package/tests/cli/project-naming.test.ts +136 -0
- package/tests/generators/doc-parser.test.ts +121 -0
- package/tests/generators/frontend-design-analyzer.test.ts +90 -0
- package/tests/generators/quality-gate.test.ts +183 -0
- package/tests/generators/shared-packages.test.ts +83 -0
- package/tests/generators/website-components.test.ts +159 -0
- package/tests/generators/website-config.test.ts +84 -0
- package/tests/generators/website-content-scanner.test.ts +181 -0
- package/tests/generators/website-context.test.ts +331 -0
- package/tests/generators/website-debug.test.ts +77 -0
- package/tests/generators/website-landing.test.ts +188 -0
- package/tests/generators/website-pricing.test.ts +98 -0
- package/tests/generators/website-sections.test.ts +245 -0
- package/tests/generators/website-seo-quality.test.ts +246 -0
- package/tests/generators/workspace-root.test.ts +105 -0
- package/tests/upgrade/handlers.test.ts +162 -0
- package/tests/workflow/auto-fix-bundler.test.ts +242 -0
- package/tests/workflow/overview.test.ts +392 -0
- package/tests/workflow/plan-mode.test.ts +111 -1
- package/tests/workflow/website-strategy.test.ts +246 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,60 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to Popeye CLI are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.6.0] - 2026-02-17
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **Dual-Mode Website Validation** - `validateWebsiteContext()` (soft/non-throwing) and `validateWebsiteContextOrThrow()` (hard). All 4 website entry points now validate context quality (was 1 of 4). Returns `ValidationResult` with `passed`, `issues`, `warnings`, and `contentScore` (0-100).
|
|
9
|
+
- **Post-Generation Content Scanner** - `scanGeneratedContent()` scans generated `.tsx`/`.ts` files for placeholder fingerprints: TODO comments, default taglines, generic descriptions, default pricing tiers ($29/mo, Starter/Pro/Enterprise), default "How It Works" steps, lorem ipsum. Integrated into website generator (non-blocking warnings).
|
|
10
|
+
- **Workspace Root Detection** - `workspace-root.ts` detects monorepo roots via `.popeye/`, `package.json` workspaces, `pnpm-workspace.yaml`, `turbo.json`. Doc discovery and brand asset scanning now traverse workspace boundaries.
|
|
11
|
+
- **Shared Packages Module** - Extracted `generateDesignTokensPackage()` and `generateUiPackage()` from `all.ts` into `shared-packages.ts`. Brand-specific color scale generation (hex to HSL to 10-stop scale).
|
|
12
|
+
- **Frontend Design Analyzer** - `analyzeFrontendDesign()` extracts colors, fonts, and component library info from `apps/frontend/` CSS vars, Tailwind config, and package.json.
|
|
13
|
+
- **Bundler Error Auto-Fix** - `auto-fix-bundler.ts` handles CSS/PostCSS/Tailwind/webpack errors that the TypeScript-only parser misses. Discovers related config files, sends to Claude for fix.
|
|
14
|
+
- **CWD-Aware Project Naming** - `generateProjectName()` now checks docs first, then CWD basename, then idea text. Skips generic dir names (Projects, Desktop, tmp).
|
|
15
|
+
- **Project Brief Generation** - `generateProjectBrief()` creates `PROJECT_BRIEF.md` in `.popeye/` with product name, tagline, color, and source doc paths.
|
|
16
|
+
- **`[WEB]` App Tag Support** - Plan parser recognizes `[WEB]` tags on tasks, maps to `website` app target, counted in `webTasks` stat.
|
|
17
|
+
- **Website Debug Tracing** - `POPEYE_DEBUG_WEBSITE=1` env var enables detailed pipeline trace showing doc discovery, brand assets, template values, and validation results.
|
|
18
|
+
- **Strategy Context Packing** - `packProductContext()` with priority-based doc packing (spec > pricing > brand > features) and 16K budget.
|
|
19
|
+
- `skipValidation` option on `WebsiteGeneratorOptions` as escape hatch for scaffold-only use.
|
|
20
|
+
- `sourceDocPaths` field on `ProjectState` for doc awareness across sessions.
|
|
21
|
+
- `strategyError` field on `ProjectState` for strategy failure visibility.
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
- **Critical**: Website generation pipeline produced generic/broken output (TODO placeholders, wrong product names, default $29/mo pricing). Root cause: validation existed but was bypassed by 3 of 4 entry points. Now all entry points validate.
|
|
25
|
+
- **Critical**: Upgrade pipeline (`/upgrade fullstack -> all`) generated website with TODO placeholders. `buildUpgradeContentContext()` now builds full content context from user docs, brand assets, and strategy.
|
|
26
|
+
- **Critical**: `extractProductName()` returned directory names instead of product names. Now uses 5-step priority chain (docs heading > spec heading > spec label > package.json > undefined).
|
|
27
|
+
- **Critical**: `extractPricing()` matched design doc sections ("Plan-Based Color Usage") as pricing tiers. Now uses strict price validation and `Pricing` keyword only.
|
|
28
|
+
- `readProjectDocs` maxLength increased from 6K to 25K with per-file 8K cap. Brand/color docs sorted first to prevent truncation.
|
|
29
|
+
- `extractFeatures()` removed `enforce` keyword (matched "Enforcement Colors" in design docs), tightened `feature` to require plural or prefix.
|
|
30
|
+
- `extractTagline()` now prefers tagline from heading matching product name exactly (avoids wrong doc in multi-doc concatenation).
|
|
31
|
+
- `extractDescription()` prefers "What Is [Product]?" over generic "What is a [thing]?" sections.
|
|
32
|
+
- Logo copy path mismatch: `public/logo{ext}` corrected to `public/brand/logo{ext}` per `BrandAssetsContract`.
|
|
33
|
+
- Logo path in Header component: strips `public/` prefix for Next.js serving.
|
|
34
|
+
- Auto-fix false success: first attempt with zero parsed errors now returns `success: false` instead of `success: true`.
|
|
35
|
+
- `parseTypeScriptErrors` now supports both tsc and bundler output formats, strips ANSI codes, deduplicates.
|
|
36
|
+
- Plan parser: `[FE]`/`[BE]`/`[WEB]`/`[INT]` tags no longer block task name extraction by `isActionableTask()`.
|
|
37
|
+
- Tailwind config: brand color scale generated from hex instead of defaulting to sky-blue.
|
|
38
|
+
|
|
39
|
+
### Changed
|
|
40
|
+
- `validateWebsiteContextOrThrow()` now delegates to `validateWebsiteContext()` internally.
|
|
41
|
+
- `all.ts` website context building: validates with soft mode, logs warnings without blocking.
|
|
42
|
+
- `website-updater.ts`: reports quality issues via `onProgress` callback.
|
|
43
|
+
- `upgrade/handlers.ts`: `buildUpgradeContentContext()` includes validation warnings in return value.
|
|
44
|
+
- Website template files split into focused modules: `website-landing.ts`, `website-pricing.ts`, `website-layout.ts`, `website-sections.ts`.
|
|
45
|
+
|
|
46
|
+
## [1.5.0] - 2026-02-13
|
|
47
|
+
|
|
48
|
+
### Added
|
|
49
|
+
- **Strategy-First Website Generation** - AI-powered marketing strategy generation with ICP analysis, positioning, messaging, SEO strategy, site architecture, conversion strategy, and competitive context.
|
|
50
|
+
- **Reviewer Persona Switching** - `reviewerPersona` field in ConsensusConfig for marketing-specific consensus review.
|
|
51
|
+
- **Website Components** - Header (logo/text fallback, nav, CTA, mobile menu), Footer (multi-column, brand), Navigation config.
|
|
52
|
+
- **SEO Infrastructure** - JsonLd component, enhanced sitemap/robots, 404/500 error pages, web manifest, meta helper.
|
|
53
|
+
- **Lead Capture System** - API route with webhook/resend/postmark support, contact form, env examples.
|
|
54
|
+
- **Brand Assets Contract** - `BrandAssetsContract` interface and `resolveBrandAssets()` for deterministic logo/favicon placement.
|
|
55
|
+
- **Website Strategy Caching** - SHA-256 hash-based staleness detection, store/load with metadata.
|
|
56
|
+
- `'website-strategy'` workflow stage.
|
|
57
|
+
- `websiteStrategy` and `storeWebsiteStrategyPath()` in project state.
|
|
58
|
+
|
|
5
59
|
## [1.4.0] - 2026-02-08
|
|
6
60
|
|
|
7
61
|
### Added
|
package/README.md
CHANGED
|
@@ -17,59 +17,87 @@ Popeye is an autonomous software development agent that takes a simple project i
|
|
|
17
17
|
|
|
18
18
|
1. **Understands** your idea and expands it into a detailed specification
|
|
19
19
|
2. **Designs** the UI automatically based on the project context
|
|
20
|
-
3. **
|
|
21
|
-
4. **Validates**
|
|
22
|
-
5. **
|
|
23
|
-
6. **
|
|
24
|
-
7. **
|
|
25
|
-
8. **
|
|
20
|
+
3. **Strategizes** (website projects) by generating a marketing strategy with ICP, positioning, SEO, and conversion goals
|
|
21
|
+
4. **Validates context** (website projects) by checking content quality before generation and warning about missing docs, default pricing, or placeholder content
|
|
22
|
+
5. **Plans** a complete development roadmap with milestones and tasks
|
|
23
|
+
6. **Validates** the plan through AI consensus (multiple AI systems must agree)
|
|
24
|
+
7. **Implements** each task autonomously, writing production-quality code
|
|
25
|
+
8. **Scans** generated website files for placeholder fingerprints (TODO comments, lorem ipsum, default tiers) and reports quality warnings
|
|
26
|
+
9. **Styles** the application with a professional design system and component library
|
|
27
|
+
10. **Tests** the implementation and fixes issues automatically
|
|
28
|
+
11. **Delivers** a complete, working project with polished UI
|
|
26
29
|
|
|
27
30
|
## How It Works
|
|
28
31
|
|
|
29
32
|
```
|
|
30
|
-
|
|
31
|
-
│
|
|
32
|
-
|
|
33
|
-
│
|
|
34
|
-
│
|
|
35
|
-
│
|
|
36
|
-
│
|
|
37
|
-
│
|
|
38
|
-
│
|
|
39
|
-
│
|
|
40
|
-
│
|
|
41
|
-
│
|
|
42
|
-
│
|
|
43
|
-
│
|
|
44
|
-
│
|
|
45
|
-
│
|
|
46
|
-
│
|
|
47
|
-
│
|
|
48
|
-
│
|
|
49
|
-
│
|
|
50
|
-
│
|
|
51
|
-
│
|
|
52
|
-
│
|
|
53
|
-
│
|
|
54
|
-
│
|
|
55
|
-
│
|
|
56
|
-
│
|
|
57
|
-
│
|
|
58
|
-
│
|
|
59
|
-
│
|
|
60
|
-
│
|
|
61
|
-
│
|
|
62
|
-
│
|
|
63
|
-
│
|
|
64
|
-
│
|
|
65
|
-
│
|
|
66
|
-
│
|
|
67
|
-
│
|
|
68
|
-
│
|
|
69
|
-
│
|
|
70
|
-
|
|
33
|
+
┌──────────────────────────────────────────────────────────────────────────┐
|
|
34
|
+
│ POPEYE WORKFLOW │
|
|
35
|
+
├──────────────────────────────────────────────────────────────────────────┤
|
|
36
|
+
│ │
|
|
37
|
+
│ [Your Idea] ──► [Specification] ──► [UI Design] ──► [Dev Plan] │
|
|
38
|
+
│ ▲ │ │ │
|
|
39
|
+
│ │ │ ▼ │
|
|
40
|
+
│ OpenAI expands Auto-design Claude creates │
|
|
41
|
+
│ theme/style │
|
|
42
|
+
│ │ │
|
|
43
|
+
│ ▼ │
|
|
44
|
+
│ ┌────────────────────────────────────────────┐ │
|
|
45
|
+
│ │ WEBSITE STRATEGY (website/all projects) │ │
|
|
46
|
+
│ │ - AI generates WebsiteStrategyDocument │ │
|
|
47
|
+
│ │ - ICP, positioning, messaging, SEO │ │
|
|
48
|
+
│ │ - Site architecture, conversion goals │ │
|
|
49
|
+
│ │ - Cached via SHA-256 hash │ │
|
|
50
|
+
│ └────────────────────────────────────────────┘ │
|
|
51
|
+
│ │ │
|
|
52
|
+
│ ▼ │
|
|
53
|
+
│ ┌────────────────────────────────────────────┐ │
|
|
54
|
+
│ │ CONSENSUS LOOP (95%+) │ │
|
|
55
|
+
│ │ ┌─────────┐ ┌─────────┐ │ │
|
|
56
|
+
│ │ │ OpenAI │◄───►│ Claude │ │ │
|
|
57
|
+
│ │ │ Reviews │ │ Revises │ │ │
|
|
58
|
+
│ │ └─────────┘ └─────────┘ │ │
|
|
59
|
+
│ │ (Marketing persona for website projects) │ │
|
|
60
|
+
│ └────────────────────────────────────────────┘ │
|
|
61
|
+
│ │ │
|
|
62
|
+
│ ▼ │
|
|
63
|
+
│ ┌────────────────────────────────────────────┐ │
|
|
64
|
+
│ │ EXECUTION MODE │ │
|
|
65
|
+
│ │ For each task: │ │
|
|
66
|
+
│ │ 1. Claude implements │ │
|
|
67
|
+
│ │ 2. Tests run automatically │ │
|
|
68
|
+
│ │ 3. Fix issues (up to 3 retries) │ │
|
|
69
|
+
│ │ 4. Mark complete │ │
|
|
70
|
+
│ └────────────────────────────────────────────┘ │
|
|
71
|
+
│ │ │
|
|
72
|
+
│ ▼ │
|
|
73
|
+
│ ┌────────────────────────────────────────────┐ │
|
|
74
|
+
│ │ UI SETUP & STYLING │ │
|
|
75
|
+
│ │ - Install Tailwind CSS │ │
|
|
76
|
+
│ │ - Configure shadcn/ui components │ │
|
|
77
|
+
│ │ - Apply selected theme │ │
|
|
78
|
+
│ └────────────────────────────────────────────┘ │
|
|
79
|
+
│ │ │
|
|
80
|
+
│ ▼ │
|
|
81
|
+
│ [Complete Project with Polished UI] │
|
|
82
|
+
│ │
|
|
83
|
+
└──────────────────────────────────────────────────────────────────────────┘
|
|
71
84
|
```
|
|
72
85
|
|
|
86
|
+
### Strategy-First Website Generation
|
|
87
|
+
|
|
88
|
+
For website and ALL projects, Popeye now includes a **strategy-first pipeline** that generates a complete marketing strategy document before any code is written:
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
[Product Docs] --> [AI Strategy Generation] --> [WebsiteStrategyDocument]
|
|
92
|
+
|
|
|
93
|
+
+-----------+-----------+-----------+
|
|
94
|
+
| | | |
|
|
95
|
+
Landing Pricing SEO/Meta Lead Capture
|
|
96
|
+
Page Page Components System
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
The strategy document drives all downstream code generation, ensuring consistent messaging, SEO keywords, navigation structure, and conversion goals across every page.
|
|
100
|
+
|
|
73
101
|
### Multi-AI Consensus System
|
|
74
102
|
|
|
75
103
|
Popeye uses multiple AI systems that must agree before implementation begins:
|
|
@@ -330,7 +358,13 @@ Popeye provides real-time feedback:
|
|
|
330
358
|
[UI Design] UI Intent: modern style for consumer audience
|
|
331
359
|
[UI Design] Selected theme: Modern Blue
|
|
332
360
|
[UI Design] UI design complete: Modern Blue theme with 12 components
|
|
333
|
-
[
|
|
361
|
+
[Website Strategy] Analyzing product context for strategy...
|
|
362
|
+
[Website Strategy] Generating website strategy via AI...
|
|
363
|
+
[Website Strategy] Validating strategy schema...
|
|
364
|
+
[Website Strategy] Strategy cached to .popeye/website-strategy.json
|
|
365
|
+
[Validation] Website context score: 85/100
|
|
366
|
+
[Validation] Warning: No tagline extracted from docs. Footer and meta tags will use generic defaults.
|
|
367
|
+
[Consensus] Review round 1: 78% agreement (Marketing Strategist persona)
|
|
334
368
|
[Consensus] Addressing concerns...
|
|
335
369
|
[Consensus] Review round 2: 92% agreement
|
|
336
370
|
[Consensus] Review round 3: 97% agreement - APPROVED
|
|
@@ -343,9 +377,13 @@ Popeye provides real-time feedback:
|
|
|
343
377
|
[UI Setup] Installing UI component dependencies...
|
|
344
378
|
[UI Setup] Setting up theme and styles...
|
|
345
379
|
[UI Setup] UI setup complete: 5 components installed
|
|
380
|
+
[Content Scan] Scanned 14 files, score: 95/100
|
|
381
|
+
[Content Scan] Warning: src/app/pricing/page.tsx - Default pricing amount ($29/mo)
|
|
346
382
|
[Complete] Project built successfully!
|
|
347
383
|
```
|
|
348
384
|
|
|
385
|
+
**Note:** The `[Website Strategy]`, `[Validation]`, and `[Content Scan]` steps appear only for `website` and `all` project types. The marketing strategist persona for consensus review is also specific to website projects. Validation warnings are informational and do not block generation (except in direct `website.ts` generation, where blocking issues cause an error).
|
|
386
|
+
|
|
349
387
|
## Features
|
|
350
388
|
|
|
351
389
|
### Core Features
|
|
@@ -386,6 +424,104 @@ Popeye automatically handles all UI/UX decisions, eliminating the need for manua
|
|
|
386
424
|
|
|
387
425
|
The UI design specification is saved to `.popeye/ui-spec.json` and is used to guide all code generation, ensuring consistent styling throughout the project.
|
|
388
426
|
|
|
427
|
+
### Production Marketing Website Generation
|
|
428
|
+
|
|
429
|
+
Popeye generates production-quality marketing websites through a strategy-first approach. Instead of generating generic templates, the system first creates a comprehensive marketing strategy document, then uses it to drive every aspect of the generated website.
|
|
430
|
+
|
|
431
|
+
#### Website Strategy Document
|
|
432
|
+
|
|
433
|
+
When you create a `website` or `all` project, Popeye generates a `WebsiteStrategyDocument` containing:
|
|
434
|
+
|
|
435
|
+
| Section | Contents |
|
|
436
|
+
|---------|----------|
|
|
437
|
+
| **ICP (Ideal Customer Profile)** | Primary persona, pain points, goals, objections |
|
|
438
|
+
| **Positioning** | Category, differentiators, value proposition, proof points |
|
|
439
|
+
| **Messaging** | Headline, subheadline, elevator pitch, long description |
|
|
440
|
+
| **SEO Strategy** | Primary/secondary/long-tail keywords, title templates, meta descriptions |
|
|
441
|
+
| **Site Architecture** | Pages with types, sections, SEO keywords, conversion goals, navigation, footer |
|
|
442
|
+
| **Conversion Strategy** | Primary/secondary CTAs, trust signals, social proof, lead capture provider |
|
|
443
|
+
| **Competitive Context** | Category, competitors (user-supplied only), differentiators |
|
|
444
|
+
|
|
445
|
+
The strategy is cached in `.popeye/website-strategy.json` with a SHA-256 hash of the inputs. It is only regenerated when inputs change (product docs, specification, or brand assets).
|
|
446
|
+
|
|
447
|
+
#### Generated Website Components
|
|
448
|
+
|
|
449
|
+
The strategy drives generation of the following production components:
|
|
450
|
+
|
|
451
|
+
- **Header** (`Header.tsx`): Logo with image/text fallback, strategy-driven navigation, primary CTA button, mobile hamburger menu with `aria-label` and `aria-expanded`
|
|
452
|
+
- **Footer** (`Footer.tsx`): Multi-column link sections from strategy, brand column with tagline, copyright
|
|
453
|
+
- **Navigation** (`nav.ts`): Exportable navigation config supporting nested items
|
|
454
|
+
- **Landing Page**: Strategy-driven hero headline, trust signals, social proof sections, dual CTAs
|
|
455
|
+
- **Pricing Page**: Strategy-aware with enterprise CTA variant
|
|
456
|
+
- **JSON-LD** (`JsonLd.tsx`): Reusable structured data component (Organization + SoftwareApplication schemas)
|
|
457
|
+
- **Sitemap** (`sitemap.ts`): Strategy-aware with per-page-type priority and change frequency
|
|
458
|
+
- **Robots.txt** (`robots.ts`): Standard configuration with sitemap reference
|
|
459
|
+
- **404 Page** (`not-found.tsx`): Branded error page with back-to-home CTA
|
|
460
|
+
- **500 Page** (`error.tsx`): Client error boundary with retry button
|
|
461
|
+
- **Web Manifest** (`manifest.webmanifest`): PWA manifest with brand colors and icons
|
|
462
|
+
- **Meta Helper** (`meta.ts`): Utility for building page-level metadata with OpenGraph and Twitter cards
|
|
463
|
+
- **Contact Form** (`ContactForm.tsx`): Lead capture form with loading/success/error states
|
|
464
|
+
- **Lead Capture API** (`api/lead/route.ts`): Server-side handler supporting webhook, Resend, or Postmark providers
|
|
465
|
+
|
|
466
|
+
#### Lead Capture System
|
|
467
|
+
|
|
468
|
+
The lead capture system supports three provider configurations:
|
|
469
|
+
|
|
470
|
+
| Provider | Environment Variables | Description |
|
|
471
|
+
|----------|----------------------|-------------|
|
|
472
|
+
| **webhook** | `LEAD_WEBHOOK_URL` | Sends lead data to any HTTP endpoint |
|
|
473
|
+
| **resend** | `RESEND_API_KEY`, `RESEND_FROM_EMAIL`, `LEAD_NOTIFICATION_EMAIL` | Sends email notifications via Resend |
|
|
474
|
+
| **postmark** | `POSTMARK_API_KEY`, `POSTMARK_FROM_EMAIL`, `LEAD_NOTIFICATION_EMAIL` | Sends email notifications via Postmark |
|
|
475
|
+
|
|
476
|
+
The provider is selected by the AI strategy based on project context, and the corresponding `.env.example` entries are generated automatically.
|
|
477
|
+
|
|
478
|
+
#### Brand Assets Contract
|
|
479
|
+
|
|
480
|
+
Popeye automatically discovers brand assets (logos, favicons, color schemes) from your project documentation directory and maps them to deterministic output paths:
|
|
481
|
+
|
|
482
|
+
- Logo files are copied to `public/brand/logo.{ext}`
|
|
483
|
+
- Primary brand color is extracted from design docs or CSS variables
|
|
484
|
+
- The `BrandAssetsContract` interface ensures consistent logo placement across Header, manifest, and metadata
|
|
485
|
+
|
|
486
|
+
#### Dual-Mode Website Context Validation
|
|
487
|
+
|
|
488
|
+
Website generation includes a two-layer quality system that prevents generic, placeholder-filled websites:
|
|
489
|
+
|
|
490
|
+
**Pre-Generation Validation** checks the content context before any code is written. It operates in two modes:
|
|
491
|
+
|
|
492
|
+
| Mode | Function | Behavior | Used By |
|
|
493
|
+
|------|----------|----------|---------|
|
|
494
|
+
| **Hard (throwing)** | `validateWebsiteContextOrThrow()` | Throws an error and blocks generation | `website.ts` (direct generation) |
|
|
495
|
+
| **Soft (non-throwing)** | `validateWebsiteContext()` | Returns `ValidationResult` with issues/warnings, logs but does not block | `all.ts`, `website-updater.ts`, `upgrade/handlers.ts` |
|
|
496
|
+
|
|
497
|
+
The `ValidationResult` includes:
|
|
498
|
+
- `passed` -- whether the context has no blocking issues
|
|
499
|
+
- `issues` -- blocking problems (suspicious product name, missing docs, no features, missing strategy)
|
|
500
|
+
- `warnings` -- non-blocking concerns (default pricing tiers, missing tagline/description/brand color)
|
|
501
|
+
- `contentScore` -- 0-100 quality score, deducted for each default or missing piece
|
|
502
|
+
|
|
503
|
+
Checks include: suspicious product name detection (e.g., `my-app`), missing documentation, zero features extracted, missing strategy, brand/color doc parsing failures, default pricing fingerprint detection (Starter/Pro/Enterprise at $0/$29/Custom), and missing tagline/description/brand color.
|
|
504
|
+
|
|
505
|
+
**Post-Generation Content Scanner** (`website-content-scanner.ts`) scans the generated `.tsx`/`.ts` files for known placeholder fingerprints after code has been written:
|
|
506
|
+
|
|
507
|
+
| Pattern | Severity | Description |
|
|
508
|
+
|---------|----------|-------------|
|
|
509
|
+
| TODO comments | error | `// TODO`, `/* TODO */`, `{/* TODO */}` |
|
|
510
|
+
| Lorem ipsum | error | Placeholder text left in templates |
|
|
511
|
+
| Default tagline | warning | "Build something amazing" |
|
|
512
|
+
| Generic description | warning | "Your modern web application" |
|
|
513
|
+
| Default pricing | warning | `$29/mo` amounts in generated files |
|
|
514
|
+
| Default pricing tiers | warning | Starter/Pro/Enterprise tier names together |
|
|
515
|
+
| Default How It Works | warning | Sign Up/Configure/Deploy steps together |
|
|
516
|
+
|
|
517
|
+
The scanner returns a `ScanResult` with all issues, the number of files scanned, and a 0-100 quality score. Issues are logged as warnings so developers can review and fix placeholder content.
|
|
518
|
+
|
|
519
|
+
Both layers work together: pre-generation validation catches missing inputs, while post-generation scanning catches placeholder content that slipped through into the generated code. The `skipValidation` option in `generateWebsiteProject()` provides an escape hatch for edge cases.
|
|
520
|
+
|
|
521
|
+
#### Reviewer Persona Switching
|
|
522
|
+
|
|
523
|
+
For website projects, the consensus reviewer automatically switches to a **Senior Product Marketing Strategist** persona instead of the default technical reviewer. This ensures the plan is evaluated for marketing effectiveness, conversion optimization, and SEO quality rather than purely technical criteria. The `reviewerPersona` field in `ConsensusConfig` controls this behavior and is threaded through all adapter implementations (OpenAI, Gemini, Grok).
|
|
524
|
+
|
|
389
525
|
### Fullstack Project Support
|
|
390
526
|
|
|
391
527
|
Popeye supports generating complete fullstack applications with coordinated frontend and backend development:
|
|
@@ -987,18 +1123,40 @@ my-project/
|
|
|
987
1123
|
├── apps/
|
|
988
1124
|
│ ├── frontend/ # React application
|
|
989
1125
|
│ ├── backend/ # FastAPI backend
|
|
990
|
-
│ └── website/ # Marketing/landing site
|
|
1126
|
+
│ └── website/ # Marketing/landing site (Next.js)
|
|
991
1127
|
│ ├── src/
|
|
992
|
-
│ │ ├──
|
|
1128
|
+
│ │ ├── app/
|
|
1129
|
+
│ │ │ ├── layout.tsx # Root layout with metadataBase
|
|
1130
|
+
│ │ │ ├── page.tsx # Strategy-driven landing page
|
|
1131
|
+
│ │ │ ├── pricing/page.tsx # Pricing with enterprise CTA
|
|
1132
|
+
│ │ │ ├── not-found.tsx # Branded 404 page
|
|
1133
|
+
│ │ │ ├── error.tsx # Error boundary (500)
|
|
1134
|
+
│ │ │ ├── sitemap.ts # Strategy-aware sitemap
|
|
1135
|
+
│ │ │ ├── robots.ts # Robots.txt config
|
|
1136
|
+
│ │ │ └── api/
|
|
1137
|
+
│ │ │ └── lead/route.ts # Lead capture endpoint
|
|
993
1138
|
│ │ ├── components/
|
|
994
|
-
│ │
|
|
1139
|
+
│ │ │ ├── Header.tsx # Logo/nav/CTA/mobile menu
|
|
1140
|
+
│ │ │ ├── Footer.tsx # Multi-column footer
|
|
1141
|
+
│ │ │ ├── JsonLd.tsx # Structured data component
|
|
1142
|
+
│ │ │ └── ContactForm.tsx # Lead capture form
|
|
1143
|
+
│ │ └── lib/
|
|
1144
|
+
│ │ ├── nav.ts # Navigation config
|
|
1145
|
+
│ │ └── meta.ts # Metadata helper utility
|
|
995
1146
|
│ ├── public/
|
|
1147
|
+
│ │ ├── brand/ # Discovered brand assets
|
|
1148
|
+
│ │ │ └── logo.{ext}
|
|
1149
|
+
│ │ └── manifest.webmanifest # PWA manifest
|
|
996
1150
|
│ ├── package.json
|
|
997
|
-
│ └──
|
|
1151
|
+
│ └── next.config.js
|
|
998
1152
|
│
|
|
999
1153
|
├── docs/
|
|
1000
1154
|
│ └── plans/ # Includes website/ directories
|
|
1001
1155
|
│ └── ...
|
|
1156
|
+
├── .popeye/
|
|
1157
|
+
│ ├── state.json
|
|
1158
|
+
│ ├── ui-spec.json
|
|
1159
|
+
│ └── website-strategy.json # Cached strategy (SHA-256 hash)
|
|
1002
1160
|
└── ...
|
|
1003
1161
|
```
|
|
1004
1162
|
|
|
@@ -1055,6 +1213,31 @@ The UI specification is stored in `.popeye/ui-spec.json` and contains:
|
|
|
1055
1213
|
}
|
|
1056
1214
|
```
|
|
1057
1215
|
|
|
1216
|
+
### Website Strategy Cache
|
|
1217
|
+
|
|
1218
|
+
For website and ALL projects, the marketing strategy is stored in `.popeye/website-strategy.json`:
|
|
1219
|
+
|
|
1220
|
+
```json
|
|
1221
|
+
{
|
|
1222
|
+
"strategy": {
|
|
1223
|
+
"icp": { "primaryPersona": "...", "painPoints": [...] },
|
|
1224
|
+
"positioning": { "valueProposition": "..." },
|
|
1225
|
+
"messaging": { "headline": "...", "subheadline": "..." },
|
|
1226
|
+
"seoStrategy": { "primaryKeywords": [...], "titleTemplates": {...} },
|
|
1227
|
+
"siteArchitecture": { "pages": [...], "navigation": [...] },
|
|
1228
|
+
"conversionStrategy": { "primaryCta": {...}, "leadCapture": "webhook" },
|
|
1229
|
+
"competitiveContext": { "differentiators": [...] }
|
|
1230
|
+
},
|
|
1231
|
+
"metadata": {
|
|
1232
|
+
"inputHash": "sha256-of-product-context-and-brand-assets",
|
|
1233
|
+
"generatedAt": "2026-02-13T...",
|
|
1234
|
+
"version": 1
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
```
|
|
1238
|
+
|
|
1239
|
+
The `inputHash` enables automatic staleness detection -- when product docs or brand assets change, the strategy is regenerated.
|
|
1240
|
+
|
|
1058
1241
|
### Design Context in Code Generation
|
|
1059
1242
|
|
|
1060
1243
|
The UI specification is automatically injected into Claude's context when generating code, ensuring consistent styling. The design system prompt includes:
|
|
@@ -1142,13 +1325,13 @@ src/
|
|
|
1142
1325
|
├── cli/ # CLI interface
|
|
1143
1326
|
│ ├── index.ts # Command setup
|
|
1144
1327
|
│ ├── output.ts # Output formatting
|
|
1145
|
-
│ ├── interactive.ts # REPL mode (with /model, /upgrade commands)
|
|
1328
|
+
│ ├── interactive.ts # REPL mode (with /model, /upgrade, /overview commands)
|
|
1146
1329
|
│ └── commands/ # Individual commands
|
|
1147
1330
|
├── adapters/ # AI service adapters
|
|
1148
1331
|
│ ├── claude.ts # Claude Agent SDK (with rate limiting)
|
|
1149
|
-
│ ├── openai.ts # OpenAI API (default reviewer)
|
|
1150
|
-
│ ├── gemini.ts # Google Gemini API (reviewer/arbitrator)
|
|
1151
|
-
│ └── grok.ts # xAI Grok API (reviewer/arbitrator)
|
|
1332
|
+
│ ├── openai.ts # OpenAI API (default reviewer, marketing persona for websites)
|
|
1333
|
+
│ ├── gemini.ts # Google Gemini API (reviewer/arbitrator, persona support)
|
|
1334
|
+
│ └── grok.ts # xAI Grok API (reviewer/arbitrator, persona support)
|
|
1152
1335
|
├── auth/ # Authentication
|
|
1153
1336
|
│ ├── keychain.ts # Credential storage
|
|
1154
1337
|
│ └── server.ts # OAuth callback server
|
|
@@ -1160,9 +1343,21 @@ src/
|
|
|
1160
1343
|
│ ├── python.ts # Python scaffolding
|
|
1161
1344
|
│ ├── typescript.ts # TypeScript scaffolding
|
|
1162
1345
|
│ ├── fullstack.ts # Fullstack scaffolding (React + FastAPI)
|
|
1163
|
-
│ ├── website.ts # Website scaffolding (Next.js)
|
|
1346
|
+
│ ├── website.ts # Website scaffolding (Next.js, strategy-aware)
|
|
1347
|
+
│ ├── website-context.ts # Doc discovery, brand assets, content context, dual-mode validation
|
|
1348
|
+
│ ├── website-content-scanner.ts # Post-generation placeholder fingerprint scanner
|
|
1349
|
+
│ ├── doc-parser.ts # Product doc parsing (name, tagline, features, pricing, color)
|
|
1164
1350
|
│ ├── all.ts # ALL project scaffolding (exports 5 generator functions)
|
|
1165
1351
|
│ └── templates/ # File templates
|
|
1352
|
+
│ ├── python.ts
|
|
1353
|
+
│ ├── typescript.ts
|
|
1354
|
+
│ ├── fullstack.ts
|
|
1355
|
+
│ ├── website.ts # Strategy-aware landing + pricing pages
|
|
1356
|
+
│ ├── website-config.ts # Non-content config templates
|
|
1357
|
+
│ ├── website-components.ts # Header, Footer, Navigation components
|
|
1358
|
+
│ ├── website-seo.ts # JSON-LD, sitemap, robots, 404, 500, manifest, meta
|
|
1359
|
+
│ ├── website-conversion.ts # Lead capture route, contact form, env examples
|
|
1360
|
+
│ └── index.ts # Template module exports
|
|
1166
1361
|
├── state/ # State management
|
|
1167
1362
|
│ ├── persistence.ts # File operations
|
|
1168
1363
|
│ └── index.ts # State API + verification
|
|
@@ -1172,24 +1367,30 @@ src/
|
|
|
1172
1367
|
│ ├── index.ts # Transactional orchestrator with backup/rollback
|
|
1173
1368
|
│ └── context.ts # Builds rich context for post-upgrade planning
|
|
1174
1369
|
├── workflow/ # Workflow engine
|
|
1175
|
-
│ ├── consensus.ts # Consensus loop
|
|
1176
|
-
│ ├── plan-mode.ts # Planning phase (monorepo-aware
|
|
1370
|
+
│ ├── consensus.ts # Consensus loop (reviewerPersona threading)
|
|
1371
|
+
│ ├── plan-mode.ts # Planning phase (strategy generation, monorepo-aware)
|
|
1177
1372
|
│ ├── execution-mode.ts # Execution phase
|
|
1178
1373
|
│ ├── milestone-workflow.ts
|
|
1179
1374
|
│ ├── task-workflow.ts # Uses isWorkspace() for multi-app checks
|
|
1180
1375
|
│ ├── test-runner.ts # Test execution
|
|
1181
|
-
│ ├── workflow-logger.ts # Persistent logging
|
|
1376
|
+
│ ├── workflow-logger.ts # Persistent logging (website-strategy stage)
|
|
1182
1377
|
│ ├── plan-storage.ts # Consensus docs storage (per-app feedback)
|
|
1183
1378
|
│ ├── workspace-manager.ts # Multi-app workspace management
|
|
1379
|
+
│ ├── website-strategy.ts # AI strategy generation, caching, staleness detection
|
|
1380
|
+
│ ├── website-updater.ts # Post-plan content refresh with strategy context
|
|
1381
|
+
│ ├── overview.ts # Project overview with progress and analysis
|
|
1184
1382
|
│ ├── ui-designer.ts # AI-powered UI design generation
|
|
1185
1383
|
│ ├── ui-setup.ts # Tailwind/shadcn setup automation
|
|
1186
1384
|
│ ├── ui-verification.ts # UI setup verification
|
|
1187
1385
|
│ ├── project-verification.ts # Project quality checks
|
|
1188
|
-
│
|
|
1386
|
+
│ ├── project-structure.ts # Project directory scanner
|
|
1387
|
+
│ ├── remediation.ts # Consensus-driven failure recovery
|
|
1388
|
+
│ └── auto-fix.ts # Automatic error fixing (enhanced ENOENT tracking)
|
|
1189
1389
|
└── types/ # TypeScript types
|
|
1190
1390
|
├── project.ts # OutputLanguage, isWorkspace(), flexible OpenAIModelSchema
|
|
1191
|
-
├── workflow.ts # ProjectStateSchema (
|
|
1192
|
-
|
|
1391
|
+
├── workflow.ts # ProjectStateSchema (websiteStrategy field)
|
|
1392
|
+
├── consensus.ts # GeminiModelSchema, GrokModelSchema, reviewerPersona
|
|
1393
|
+
└── website-strategy.ts # WebsiteStrategyDocument, BrandAssetsContract, DesignTokens
|
|
1193
1394
|
```
|
|
1194
1395
|
|
|
1195
1396
|
## Development
|
|
@@ -32,6 +32,7 @@ export declare function requestConsensus(plan: string, context: string, config?:
|
|
|
32
32
|
model?: GeminiModel;
|
|
33
33
|
temperature?: number;
|
|
34
34
|
maxTokens?: number;
|
|
35
|
+
reviewerPersona?: string;
|
|
35
36
|
}): Promise<ConsensusResult>;
|
|
36
37
|
/**
|
|
37
38
|
* Request arbitration from Gemini when consensus is stuck
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gemini.d.ts","sourceRoot":"","sources":["../../src/adapters/gemini.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAGhF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC;;GAEG;AACH,eAAO,MAAM,qBAAqB;WACH,WAAW;;;CAGzC,CAAC;AAEF;;GAEG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAQhE;AAED;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,MAAM,GAAE;IAAE,KAAK,CAAC,EAAE,WAAW,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,
|
|
1
|
+
{"version":3,"file":"gemini.d.ts","sourceRoot":"","sources":["../../src/adapters/gemini.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAGhF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC;;GAEG;AACH,eAAO,MAAM,qBAAqB;WACH,WAAW;;;CAGzC,CAAC;AAEF;;GAEG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAQhE;AAED;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,MAAM,GAAE;IAAE,KAAK,CAAC,EAAE,WAAW,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,CAAA;CAAO,GACvG,OAAO,CAAC,eAAe,CAAC,CA4B1B;AAED;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,gBAAgB,EAAE,MAAM,EACxB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EAAE,GACf,OAAO,CAAC,iBAAiB,CAAC,CAqB5B;AAkHD;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,CAsCxE;AAgGD;;GAEG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CASvD"}
|
package/dist/adapters/gemini.js
CHANGED
|
@@ -31,10 +31,10 @@ export async function createClient() {
|
|
|
31
31
|
* @returns Consensus result
|
|
32
32
|
*/
|
|
33
33
|
export async function requestConsensus(plan, context, config = {}) {
|
|
34
|
-
const { model = DEFAULT_GEMINI_CONFIG.model, temperature = DEFAULT_GEMINI_CONFIG.temperature, maxTokens = DEFAULT_GEMINI_CONFIG.maxTokens, } = config;
|
|
34
|
+
const { model = DEFAULT_GEMINI_CONFIG.model, temperature = DEFAULT_GEMINI_CONFIG.temperature, maxTokens = DEFAULT_GEMINI_CONFIG.maxTokens, reviewerPersona, } = config;
|
|
35
35
|
const client = await createClient();
|
|
36
36
|
const generativeModel = client.getGenerativeModel({ model });
|
|
37
|
-
const prompt = buildConsensusPrompt(plan, context);
|
|
37
|
+
const prompt = buildConsensusPrompt(plan, context, reviewerPersona);
|
|
38
38
|
try {
|
|
39
39
|
const result = await generativeModel.generateContent({
|
|
40
40
|
contents: [{ role: 'user', parts: [{ text: prompt }] }],
|
|
@@ -83,9 +83,14 @@ export async function requestArbitration(plan, reviewerFeedback, claudeFeedback,
|
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
85
85
|
* Build the consensus review prompt
|
|
86
|
+
*
|
|
87
|
+
* @param plan - The plan to review
|
|
88
|
+
* @param context - Project context
|
|
89
|
+
* @param persona - Optional custom reviewer persona
|
|
86
90
|
*/
|
|
87
|
-
function buildConsensusPrompt(plan, context) {
|
|
88
|
-
|
|
91
|
+
function buildConsensusPrompt(plan, context, persona) {
|
|
92
|
+
const reviewerRole = persona || 'a senior software architect';
|
|
93
|
+
return `You are ${reviewerRole} reviewing a development plan.
|
|
89
94
|
Analyze the following plan for completeness, correctness, and feasibility.
|
|
90
95
|
|
|
91
96
|
PROJECT CONTEXT:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gemini.js","sourceRoot":"","sources":["../../src/adapters/gemini.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAOlD;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,KAAK,EAAE,kBAAiC;IACxC,WAAW,EAAE,GAAG;IAChB,SAAS,EAAE,IAAI;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,MAAM,MAAM,GAAG,MAAM,cAAc,EAAE,CAAC;IAEtC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,C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gBAC/E,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACtB,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,YAAY,EAAE,CAAC;QACpC,MAAM,KAAK,GAAG,MAAM,CAAC,kBAAkB,CAAC,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC,CAAC;QACvE,MAAM,KAAK,CAAC,eAAe,CAAC,8BAA8B,CAAC,CAAC;QAC5D,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/dist/adapters/grok.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export declare function requestConsensus(plan: string, context: string, config?:
|
|
|
31
31
|
model?: string;
|
|
32
32
|
temperature?: number;
|
|
33
33
|
maxTokens?: number;
|
|
34
|
+
reviewerPersona?: string;
|
|
34
35
|
}): Promise<ConsensusResult>;
|
|
35
36
|
/**
|
|
36
37
|
* Request arbitration from Grok when consensus is stuck
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grok.d.ts","sourceRoot":"","sources":["../../src/adapters/grok.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1D;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;CAI/B,CAAC;AAEF;;GAEG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAWpD;AAED;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE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CAAC,MAAM,EAAE,CAAC,CAa7D;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,CAwCjB;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CA+BxF"}
|
package/dist/adapters/grok.js
CHANGED
|
@@ -37,9 +37,9 @@ export async function createClient() {
|
|
|
37
37
|
* @returns Consensus result
|
|
38
38
|
*/
|
|
39
39
|
export async function requestConsensus(plan, context, config = {}) {
|
|
40
|
-
const { model = DEFAULT_GROK_CONFIG.model, temperature = DEFAULT_GROK_CONFIG.temperature, maxTokens = DEFAULT_GROK_CONFIG.maxTokens, } = config;
|
|
40
|
+
const { model = DEFAULT_GROK_CONFIG.model, temperature = DEFAULT_GROK_CONFIG.temperature, maxTokens = DEFAULT_GROK_CONFIG.maxTokens, reviewerPersona, } = config;
|
|
41
41
|
const client = await createClient();
|
|
42
|
-
const prompt = buildConsensusPrompt(plan, context);
|
|
42
|
+
const prompt = buildConsensusPrompt(plan, context, reviewerPersona);
|
|
43
43
|
try {
|
|
44
44
|
const completion = await client.chat.completions.create({
|
|
45
45
|
model,
|
|
@@ -89,9 +89,14 @@ export async function requestArbitration(plan, reviewerFeedback, claudeFeedback,
|
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
91
|
* Build the consensus review prompt
|
|
92
|
+
*
|
|
93
|
+
* @param plan - The plan to review
|
|
94
|
+
* @param context - Project context
|
|
95
|
+
* @param persona - Optional custom reviewer persona
|
|
92
96
|
*/
|
|
93
|
-
function buildConsensusPrompt(plan, context) {
|
|
94
|
-
|
|
97
|
+
function buildConsensusPrompt(plan, context, persona) {
|
|
98
|
+
const reviewerRole = persona || 'a senior software architect';
|
|
99
|
+
return `You are ${reviewerRole} reviewing a development plan.
|
|
95
100
|
Analyze the following plan for completeness, correctness, and feasibility.
|
|
96
101
|
|
|
97
102
|
PROJECT CONTEXT:
|