From a5f2db1dff4a1491c33c4a6e3bcab3a58ed9639c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Feb 2026 01:56:04 +0000 Subject: [PATCH 1/2] Initial plan From e8eef13e6d92ea51d97e03bee7252a257fafcd62 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Feb 2026 02:07:20 +0000 Subject: [PATCH 2/2] Clarify Vercel production-readiness audit scope: web-app vs API/CLI Co-authored-by: Krosebrook <214532761+Krosebrook@users.noreply.github.com> --- package-lock.json | 45 ++++++++++++++++------- scripts/generate-prd.js | 40 +++++++++++++++++++-- src/test/generate-prd.test.js | 67 +++++++++++++++++++++++++++++++++++ 3 files changed, 137 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index 124ae1dd..2e3557a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -215,6 +215,7 @@ "integrity": "sha512-2BCOP7TN8M+gVDj7/ht3hsaO/B/n5oDbiAyyvnRlNOs+u1o+JWNYTQrmpuNp1/Wq2gcFrI01JAW+paEKDMx/CA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.3", @@ -572,6 +573,7 @@ "integrity": "sha512-EXZfxkL6GFJS2cb7TIBR7RiHA5iz6ufDcl1VmUpI2pga3lJ5Ck2+iqbx7N+osL3XYem9ad4XCidJEMm64DX6UQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.1.0" } @@ -664,6 +666,7 @@ } ], "license": "MIT", + "peer": true, "engines": { "node": ">=18" }, @@ -707,6 +710,7 @@ } ], "license": "MIT", + "peer": true, "engines": { "node": ">=18" } @@ -3662,8 +3666,7 @@ "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@types/babel__core": { "version": "7.20.5", @@ -3890,6 +3893,7 @@ "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.24.tgz", "integrity": "sha512-0dLEBsA1kI3OezMBF8nSsb7Nk19ZnsyE1LLhB8r27KbgU5H4pvuqZLdtE+aUkJVoXgTVuA+iLIwmZ0TuK4tx6A==", "license": "MIT", + "peer": true, "dependencies": { "@types/prop-types": "*", "csstype": "^3.0.2" @@ -3901,6 +3905,7 @@ "integrity": "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==", "devOptional": true, "license": "MIT", + "peer": true, "peerDependencies": { "@types/react": "^18.0.0" } @@ -4109,6 +4114,7 @@ "integrity": "sha512-hRDjg6dlDz7JlZAvjbiCdAJ3SDG+NH8tjZe21vjxfvT2ssYAn72SRXMge3dKKABm3bIJ3C+3wdunIdur8PHEAw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@vitest/utils": "4.0.17", "fflate": "^0.8.2", @@ -4155,6 +4161,7 @@ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -4692,6 +4699,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.3", "caniuse-lite": "^1.0.30001741", @@ -5208,7 +5216,8 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/d3-array": { "version": "3.2.4", @@ -5414,6 +5423,7 @@ "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.6.0.tgz", "integrity": "sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww==", "license": "MIT", + "peer": true, "funding": { "type": "github", "url": "https://github.com/sponsors/kossnocorp" @@ -5582,8 +5592,7 @@ "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/dom-helpers": { "version": "5.2.1", @@ -5649,7 +5658,8 @@ "version": "8.6.0", "resolved": "https://registry.npmjs.org/embla-carousel/-/embla-carousel-8.6.0.tgz", "integrity": "sha512-SjWyZBHJPbqxHOzckOfo8lHisEaJWmwd23XppYFYVh10bU66/Pn5tkVkbkCMZVdbUE5eTCI2nD8OyIP4Z+uwkA==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/embla-carousel-react": { "version": "8.6.0", @@ -5992,6 +6002,7 @@ "integrity": "sha512-hB4FIzXovouYzwzECDcUkJ4OcfOEkXTv2zRY6B9bkwjx/cprAq0uvm1nl7zvQ0/TsUk0zQiN4uPfJpB9m+rPMQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -7761,6 +7772,7 @@ "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.7.tgz", "integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==", "license": "MIT", + "peer": true, "bin": { "jiti": "bin/jiti.js" } @@ -8102,7 +8114,6 @@ "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", "dev": true, "license": "MIT", - "peer": true, "bin": { "lz-string": "bin/bin.js" } @@ -9425,6 +9436,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", @@ -9591,7 +9603,6 @@ "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "ansi-regex": "^5.0.1", "ansi-styles": "^5.0.0", @@ -9607,7 +9618,6 @@ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=8" } @@ -9618,7 +9628,6 @@ "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=10" }, @@ -9631,8 +9640,7 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/prompts": { "version": "2.4.2", @@ -9735,6 +9743,7 @@ "resolved": "https://registry.npmjs.org/quill-delta/-/quill-delta-5.1.0.tgz", "integrity": "sha512-X74oCeRI4/p0ucjb5Ma8adTXd9Scumz367kkMK5V/IatcX6A0vlgLgKbzXWy5nZmCGeNJm2oQX0d2Eqj+ZIlCA==", "license": "MIT", + "peer": true, "dependencies": { "fast-diff": "^1.3.0", "lodash.clonedeep": "^4.5.0", @@ -9771,6 +9780,7 @@ "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", "license": "MIT", + "peer": true, "dependencies": { "loose-envify": "^1.1.0" }, @@ -9797,6 +9807,7 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", "license": "MIT", + "peer": true, "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.2" @@ -9810,6 +9821,7 @@ "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.63.0.tgz", "integrity": "sha512-ZwueDMvUeucovM2VjkCf7zIHcs1aAlDimZu2Hvel5C5907gUzMpm4xCrQXtRzCvsBqFjonB4m3x4LzCFI1ZKWA==", "license": "MIT", + "peer": true, "engines": { "node": ">=18.0.0" }, @@ -10173,7 +10185,8 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz", "integrity": "sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/reflect.getprototypeof": { "version": "1.0.10", @@ -10414,6 +10427,7 @@ "integrity": "sha512-+IuescNkTJQgX7AkIDtITipZdIGcWF0pnVvZTWStiazUmcGA2ag8dfg0urest2XlXUi9kuhfQ+qmdc5Stc3z7g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@types/estree": "1.0.8" }, @@ -11327,6 +11341,7 @@ "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.17.tgz", "integrity": "sha512-w33E2aCvSDP0tW9RZuNXadXlkHXqFzSkQew/aIa2i/Sj8fThxwovwlXHSPXTbAHwEIhBFXAedUhP2tueAKP8Og==", "license": "MIT", + "peer": true, "dependencies": { "@alloc/quick-lru": "^5.2.0", "arg": "^5.0.2", @@ -11525,6 +11540,7 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -12089,6 +12105,7 @@ "integrity": "sha512-+Oxm7q9hDoLMyJOYfUYBuHQo+dkAloi33apOPP56pzj+vsdJDzr+j1NISE5pyaAuKL4A3UD34qd0lx5+kfKp2g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.4", @@ -12182,6 +12199,7 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -12195,6 +12213,7 @@ "integrity": "sha512-FQMeF0DJdWY0iOnbv466n/0BudNdKj1l5jYgl5JVTwjSsZSlqyXFt/9+1sEyhR6CLowbZpV7O1sCHrzBhucKKg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@vitest/expect": "4.0.17", "@vitest/mocker": "4.0.17", diff --git a/scripts/generate-prd.js b/scripts/generate-prd.js index d0db3f89..a7f7a2ad 100755 --- a/scripts/generate-prd.js +++ b/scripts/generate-prd.js @@ -56,7 +56,8 @@ function parseArgs() { context: {}, model: 'claude', interactive: false, - help: false + help: false, + projectType: 'web-app' }; for (let i = 0; i < args.length; i++) { @@ -99,6 +100,11 @@ function parseArgs() { options.model = next; i++; break; + case '--project-type': + case '-t': + options.projectType = next; + i++; + break; case '--interactive': case '-I': options.interactive = true; @@ -132,6 +138,7 @@ ${colors.bright}Options:${colors.reset} --output, -o Output file path (default: PRD-{timestamp}.md) --context, -c Additional context (JSON string or file) --model, -m AI model to use (claude|gpt4|gemini, default: claude) + --project-type, -t Project type: web-app|api|cli (default: web-app) --help, -h Show this help message ${colors.bright}Context JSON Format:${colors.reset} @@ -176,6 +183,7 @@ async function interactiveMode() { console.log(`\n${colors.dim}Optional context (press Enter to skip):${colors.reset}`); + const projectTypeInput = await question(`${colors.yellow}Project type (web-app/api/cli, default: web-app):${colors.reset} `); const targetAudience = await question(`${colors.yellow}Target Audience:${colors.reset} `); const businessGoals = await question(`${colors.yellow}Business Goals:${colors.reset} `); const technicalConstraints = await question(`${colors.yellow}Technical Constraints:${colors.reset} `); @@ -187,6 +195,7 @@ async function interactiveMode() { rl.close(); const context = {}; + context.projectType = projectTypeInput || 'web-app'; if (targetAudience) context.targetAudience = targetAudience; if (businessGoals) context.businessGoals = businessGoals; if (technicalConstraints) context.technicalConstraints = technicalConstraints; @@ -200,10 +209,30 @@ async function interactiveMode() { }; } +// Generate Vercel production-readiness section based on project type +function generateVercelSection(projectType) { + const isNonWebApp = projectType === 'api' || projectType === 'cli'; + if (isNonWebApp) { + const kind = projectType === 'api' ? 'backend API' : 'CLI'; + return `> **N/A** \u2014 This is a ${kind} project and is not applicable for Vercel web deployment. Vercel hosts web apps (e.g., Next.js, Vite); ${projectType === 'api' ? 'API' : 'CLI'} projects should be deployed to their own appropriate runtime (e.g., Base44 serverless functions, Docker, cloud run).`; + } + return [ + '- [ ] `vercel.json` present and configured (framework, buildCommand, outputDirectory)', + '- [ ] Environment variables defined in Vercel dashboard (not hard-coded)', + '- [ ] Preview deployments enabled for pull requests', + '- [ ] Production domain configured with valid SSL certificate', + '- [ ] Security headers set (X-Content-Type-Options, X-Frame-Options, Referrer-Policy)', + '- [ ] `rewrites` / `redirects` configured for SPA routing (e.g., `/api/:path*`)', + '- [ ] Edge network region(s) selected appropriate for target audience', + '- [ ] Build passes locally with `npm run build` (output to `dist/` or configured `outputDirectory`)', + '- [ ] No secrets committed to source; all sensitive values use Vercel environment variable references', + ].join('\n'); +} + // Generate PRD using local AI template (fallback without API) function generatePRDTemplate(featureIdea, context = {}) { const timestamp = new Date().toISOString().split('T')[0]; - + const vercelSection = generateVercelSection(context.projectType || 'web-app'); return `# Product Requirements Document (PRD) **Feature:** ${featureIdea} @@ -576,6 +605,10 @@ ${context.existingIntegrations ? `- ${context.existingIntegrations.split(',').jo 5. Investigate root cause 6. Fix and redeploy +### 12.5 Vercel Production-Readiness + +${vercelSection} + --- ## 13. Assumptions, Risks & Open Questions @@ -670,6 +703,9 @@ async function main() { } context = options.context; + if (!context.projectType) { + context.projectType = options.projectType; + } outputFile = options.output; } diff --git a/src/test/generate-prd.test.js b/src/test/generate-prd.test.js index c68039f3..f69fc7cf 100644 --- a/src/test/generate-prd.test.js +++ b/src/test/generate-prd.test.js @@ -292,4 +292,71 @@ describe('PRD Generator Script', () => { expect(testingTools).toContain('Playwright'); }); }); + + describe('Vercel Production-Readiness Scope', () => { + // Inline implementation of generateVercelSection for isolated unit tests + function generateVercelSection(projectType) { + const isNonWebApp = projectType === 'api' || projectType === 'cli'; + if (isNonWebApp) { + const kind = projectType === 'api' ? 'backend API' : 'CLI'; + return `> **N/A** \u2014 This is a ${kind} project and is not applicable for Vercel web deployment. Vercel hosts web apps (e.g., Next.js, Vite); ${projectType === 'api' ? 'API' : 'CLI'} projects should be deployed to their own appropriate runtime (e.g., Base44 serverless functions, Docker, cloud run).`; + } + return [ + '- [ ] `vercel.json` present and configured (framework, buildCommand, outputDirectory)', + '- [ ] Environment variables defined in Vercel dashboard (not hard-coded)', + '- [ ] Preview deployments enabled for pull requests', + '- [ ] Production domain configured with valid SSL certificate', + '- [ ] Security headers set (X-Content-Type-Options, X-Frame-Options, Referrer-Policy)', + '- [ ] `rewrites` / `redirects` configured for SPA routing (e.g., `/api/:path*`)', + '- [ ] Edge network region(s) selected appropriate for target audience', + '- [ ] Build passes locally with `npm run build` (output to `dist/` or configured `outputDirectory`)', + '- [ ] No secrets committed to source; all sensitive values use Vercel environment variable references', + ].join('\n'); + } + + it('should include full Vercel checklist for web-app project type', () => { + const section = generateVercelSection('web-app'); + + expect(section).toContain('vercel.json'); + expect(section).toContain('Environment variables'); + expect(section).toContain('Preview deployments'); + expect(section).toContain('Security headers'); + expect(section).not.toContain('N/A'); + }); + + it('should mark Vercel section as N/A for api project type', () => { + const section = generateVercelSection('api'); + + expect(section).toContain('N/A'); + expect(section).toContain('backend API'); + expect(section).toContain('not applicable for Vercel web deployment'); + expect(section).not.toContain('vercel.json'); + }); + + it('should mark Vercel section as N/A for cli project type', () => { + const section = generateVercelSection('cli'); + + expect(section).toContain('N/A'); + expect(section).toContain('CLI'); + expect(section).toContain('not applicable for Vercel web deployment'); + expect(section).not.toContain('vercel.json'); + }); + + it('should default to web-app when projectType is not set', () => { + const section = generateVercelSection('web-app'); + + expect(section).toContain('vercel.json'); + expect(section).not.toContain('N/A'); + }); + + it('should distinguish api N/A message from cli N/A message', () => { + const apiSection = generateVercelSection('api'); + const cliSection = generateVercelSection('cli'); + + expect(apiSection).toContain('backend API'); + expect(cliSection).toContain('CLI'); + expect(apiSection).not.toContain('CLI project'); + expect(cliSection).not.toContain('backend API'); + }); + }); });