AI Sales Script Generator
Run ID: 69cbe5a161b1021a29a8d4cc2026-03-31Business
PantheraHive BOS
BOS Dashboard

Generate conversion-optimized sales scripts for cold calls, demos, follow-ups, and objection handling with industry-specific language.

Comprehensive Marketing Strategy: AI Sales Script Generator

This document outlines a comprehensive marketing strategy designed to launch and grow the "AI Sales Script Generator." It covers target audience analysis, recommended marketing channels, a core messaging framework, and key performance indicators (KPIs) to measure success.


1. Target Audience Analysis

Understanding who benefits most from an AI Sales Script Generator is crucial for effective marketing. Our primary focus will be on decision-makers and influencers within sales organizations.

1.1. Primary Target Audience: Sales Leadership & Management

  • Demographics:

* Roles: VPs of Sales, Sales Directors, Sales Managers, Heads of Sales, Business Owners (especially SMBs with sales teams), Sales Enablement Managers.

* Company Size: Small to Mid-Market (10-500 employees) initially, expanding to Enterprise.

* Industry: SaaS, Technology, Financial Services, Real Estate, Consulting, B2B Services, Healthcare (specific B2B sales divisions), Logistics. Any industry with a significant outbound sales component or a need for standardized, high-performing sales communication.

* Geographic: Global, with initial focus on North America and Western Europe due to higher adoption rates of sales tech.

  • Psychographics & Motivations:

* Goals: Increase sales efficiency, improve conversion rates, shorten sales cycles, reduce ramp-up time for new reps, standardize messaging, scale sales operations, reduce sales rep turnover.

* Pain Points: Inconsistent sales messaging, low cold call/email conversion rates, difficulty handling complex objections, time-consuming script creation, lack of personalization at scale, high cost of sales training, reliance on individual rep performance.

* Needs: A scalable solution for script generation, AI-driven insights for optimization, tools to empower their sales teams, measurable ROI on sales enablement investments, competitive advantage.

* Technographic: Likely already using CRMs (Salesforce, HubSpot), Sales Engagement Platforms (Outreach, Salesloft), and other sales productivity tools. Open to integrating new technologies that demonstrate clear value.

1.2. Secondary Target Audience: Individual Sales Professionals

  • Demographics:

* Roles: Business Development Representatives (BDRs), Sales Development Representatives (SDRs), Account Executives (AEs).

* Experience Level: New reps needing guidance, experienced reps looking for efficiency and optimization.

  • Psychographics & Motivations:

* Goals: Improve personal performance, hit quotas faster, reduce prep time, overcome sales anxiety, enhance confidence in calls/demos.

* Pain Points: Writer's block for outreach, fear of objection handling, feeling unprepared, lack of personalized scripts, inconsistent messaging, missing key talking points.

* Needs: Easy-to-use tool for generating scripts quickly, personalized talking points, dynamic objection handling suggestions, tips for better engagement.


2. Channel Recommendations

To effectively reach our target audiences, a multi-channel approach focusing on digital and strategic partnerships will be most effective.

2.1. Digital Marketing Channels

  • Content Marketing (SEO-driven):

* Strategy: Create high-value, educational content that addresses the pain points and needs of sales leaders and reps. Focus on problem/solution content.

* Formats: Blog posts ("How AI is Revolutionizing Cold Calls," "Boost Your Sales Demo Conversion Rates with Smart Scripts," "The Ultimate Guide to AI-Powered Objection Handling"), whitepapers, case studies, e-books, templates (e.g., "5 AI-Generated Cold Call Script Templates"), webinars, video tutorials.

* Keywords: Target long-tail keywords like "AI sales script generator," "cold call script automation," "sales demo script builder," "objection handling AI tool," "sales enablement AI," "personalized sales scripts."

  • Search Engine Marketing (SEM - Google Ads):

* Strategy: Bid on high-intent keywords where prospects are actively searching for solutions.

* Keywords: "AI sales script software," "best sales script generator," "buy sales script tool," "sales script automation platform."

* Ad Copy: Highlight key benefits like time savings, increased conversions, and personalization.

  • Social Media Marketing:

LinkedIn: Primary channel.* Share thought leadership, product updates, customer success stories, run targeted ad campaigns to sales leadership roles. Engage in relevant sales groups.

* Twitter: Share quick tips, industry news, interact with sales influencers and thought leaders.

* Facebook/Instagram: Primarily for retargeting website visitors and nurturing leads through engaging video content or testimonials.

  • Email Marketing:

* Strategy: Nurture leads generated through content downloads, webinar registrations, and demo requests.

* Campaigns: Welcome series, educational drip campaigns, product feature highlights, case studies, free trial promotions, personalized outreach.

* Segmentation: Segment by role (leadership vs. rep), industry, and engagement level.

  • Webinars & Virtual Events:

* Strategy: Host educational webinars (e.g., "Mastering Sales Outreach with AI," "The Future of Sales Enablement") featuring product demos and expert insights. Participate in relevant industry virtual summits.

2.2. Strategic Partnerships & Integrations

  • CRM & Sales Engagement Platforms: Partner with leading CRMs (Salesforce, HubSpot) and Sales Engagement Platforms (Outreach, Salesloft) for seamless integration. Co-marketing efforts, app marketplace listings, and joint webinars can drive significant adoption.
  • Sales Coaching & Training Platforms: Collaborate with platforms that offer sales training to provide an advanced tool for their users.
  • Industry Associations: Partner with sales leadership associations for exclusive offers or content features.

2.3. Public Relations (PR) & Influencer Marketing

  • Strategy: Secure features in leading tech and sales publications. Collaborate with prominent sales influencers (consultants, authors, podcasters) for reviews, endorsements, and content creation.
  • Outreach: Target publications like Sales Hacker, The Sales Blog, Forbes Technology Council, TechCrunch (for product launch).

3. Messaging Framework

Our messaging will be designed to resonate with the pain points of our target audience, clearly articulating the value proposition and unique selling points (USPs) of the AI Sales Script Generator.

3.1. Core Value Proposition

"Empower your sales team with AI-driven, conversion-optimized scripts for every interaction, enabling unparalleled personalization, efficiency, and measurable sales growth."

3.2. Key Benefits

  • For Sales Leadership:

* Boost Conversions: AI-optimized scripts lead to higher close rates across cold calls, emails, and demos.

* Scale Efficiency: Generate high-quality scripts in minutes, not hours, dramatically reducing prep time for your team.

* Ensure Consistency: Standardize winning messaging across your entire sales organization, guaranteeing brand alignment and quality.

* Accelerate Onboarding: Drastically reduce ramp-up time for new reps with instant access to proven, personalized scripts.

* Data-Driven Optimization: Gain insights to continuously refine and improve your sales messaging based on performance.

  • For Individual Sales Professionals:

* Eliminate Writer's Block: Instantly generate compelling scripts tailored to your prospect and situation.

* Handle Objections Confidently: Receive real-time, AI-powered suggestions for effective objection handling.

* Personalize at Scale: Craft unique messages for each prospect, making every interaction feel custom and relevant.

* Increase Confidence: Approach every call, demo, or follow-up with a proven, data-backed script.

3.3. Unique Selling Points (USPs)

  • Industry-Specific Language Integration: AI trained on vast datasets of industry-specific sales conversations ensures highly relevant and effective scripts.
  • Advanced AI for Nuanced Objection Handling: Go beyond basic responses with sophisticated AI that understands context and provides dynamic, persuasive counters.
  • Multi-Channel Script Generation: Generate optimized scripts for cold calls, voicemails, emails, LinkedIn messages, demos, and follow-ups from a single platform.
  • Seamless CRM & Sales Engagement Platform Integration: Syncs effortlessly with your existing tech stack for a streamlined workflow and data-driven insights.
  • Continuous Learning & Optimization: The AI constantly learns from successful interactions, providing iterative improvements and recommendations for script refinement.

3.4. Tone of Voice

  • Professional & Authoritative: Position ourselves as experts in sales enablement and AI.
  • Innovative & Forward-Thinking: Highlight the cutting-edge nature of the technology.
  • Results-Oriented & Empowering: Focus on the tangible benefits and how the tool empowers users to achieve more.
  • Clear & Concise: Direct language that gets straight to the point of value.

3.5. Call to Action (CTAs) Examples

  • "Request a Personalized Demo"
  • "Start Your Free 14-Day Trial"
  • "Download Our AI Sales Script Playbook"
  • "See How [Your Company] Boosts Sales Conversions"
  • "Generate Your First AI Script Now"

4. Key Performance Indicators (KPIs)

Measuring the success of our marketing efforts is critical. KPIs will be tracked across the entire marketing funnel.

4.1. Awareness & Reach

  • Website Traffic: Unique visitors, page views, traffic sources (organic, paid, referral).
  • Social Media Reach & Engagement: Impressions, follower growth, likes, shares, comments on LinkedIn, Twitter.
  • Brand Mentions: Mentions across social media, forums, and publications.
  • PR Coverage: Number of articles, estimated reach, media impressions.

4.2. Lead Generation & Acquisition

  • Lead Volume: Number of Marketing Qualified Leads (MQLs) and Sales Qualified Leads (SQLs).
  • Lead Conversion Rates: Website visitor to lead, MQL to SQL.
  • Demo Requests: Number of scheduled and completed product demonstrations.
  • Free Trial Sign-ups: Number of users initiating a free trial.
  • Customer Acquisition Cost (CAC): Total marketing and sales expenses divided by new customers acquired.
  • Cost Per Lead (CPL): Total marketing spend divided by total leads generated.

4.3. Activation & Engagement

  • Free Trial Conversion Rate: Percentage of free trials converting to paid subscriptions.
  • Feature Adoption Rate: Percentage of users utilizing key features (e.g., script generation, objection handling module).
  • Script Generation Frequency: Average number of scripts generated per active user/team per week/month.
  • Integration Adoption: Number of users connecting with CRMs/SEPs.

4.4. Revenue & Growth

  • Monthly Recurring Revenue (MRR) / Annual Recurring Revenue (ARR): Total predictable revenue.
  • Average Revenue Per User (ARPU): Revenue generated per active user.
  • Sales Cycle Length: Time from initial contact to closed-won.
  • Pipeline Value & Velocity: Health and speed of the sales pipeline.

4.5. Retention & Advocacy

  • Customer Churn Rate: Percentage of customers who cancel their subscription over a given period.
  • Net Promoter Score (NPS): Customer loyalty and satisfaction.
  • Customer Lifetime Value (CLTV): Predicted revenue a customer will generate over their relationship with the product.
  • Referral Rate: Number of new customers acquired through referrals.

gemini Output

AI Sales Script Generator: Conversion-Optimized Sales Scripts

Welcome to your comprehensive output for the AI Sales Script Generator! This document provides detailed, professional frameworks and examples for crafting high-converting sales scripts tailored to various stages of your sales cycle. Our focus is on maximizing engagement, driving progression, and utilizing industry-specific language to resonate deeply with your target audience.


1. Overview & Key Benefits

Our AI Sales Script Generator is designed to empower your sales team with effective, professionally crafted communication tools.

Key Benefits:

  • Conversion Optimization: Scripts are strategically designed to move prospects efficiently through the sales funnel.
  • Multi-Scenario Coverage: Comprehensive support for cold outreach, detailed demonstrations, strategic follow-ups, and robust objection handling.
  • Industry-Specific Language: Integration of relevant terminology and pain points to build immediate rapport and credibility.
  • Customizable & Actionable: Templates and examples are built for easy adaptation to your unique product/service offerings and target markets.
  • Time Efficiency: Rapid generation of high-quality scripts, freeing up your team to focus on selling.

2. Core Sales Script Categories & Examples

Below are detailed frameworks and example scripts for the most critical stages of your sales process.

2.1. Cold Call Script Template: Pique Interest & Qualify

Goal: To quickly establish relevance, identify a potential need, and secure a commitment for a next step (e.g., a discovery call or demo).

Structure:

  1. Permission-Based/Value-Driven Opener: Respect their time, state your purpose.
  2. Context & Problem Statement: Briefly mention the industry/role and a common challenge.
  3. Solution & Value Proposition: How you help similar companies.
  4. Quick Qualification Question: Determine if the challenge resonates.
  5. Clear Call to Action (CTA): Propose a small, easy next step.

Example Script:

> "Hi [Prospect Name], this is [Your Name] from [Your Company]. I know you're busy, so I'll be brief.

>

> We specialize in helping companies in [Prospect's Industry, e.g., 'B2B SaaS'] like yours overcome [Specific Pain Point, e.g., 'the challenge of inconsistent lead qualification and follow-up'].

>

> Many of our clients were struggling with [Elaborate on Pain Point/Consequence, e.g., 'wasting valuable sales team time on unqualified leads'] before using [Your Product/Service, e.g., 'our AI-powered lead scoring and nurturing platform']. Our solution helps them [Key Benefit 1, e.g., 'prioritize high-intent prospects'] and [Key Benefit 2, e.g., 'automate personalized follow-up sequences'], leading to [Quantifiable Result, e.g., 'a 30% increase in qualified meeting bookings'].

>

> Does [Specific Pain Point] resonate with any challenges you're currently facing at [Prospect's Company]?

>

> If so, would you be open to a quick 15-minute chat next [Day, e.g., 'Tuesday'] to explore how we could potentially help?"


2.2. Demo Script Framework: Showcase Value & Drive Engagement

Goal: To effectively demonstrate your solution, directly address the prospect's needs, and reinforce its value proposition, leading to a clear next step.

Phases:

  1. Discovery & Needs Confirmation (5-10 mins):

* Reiterate your understanding of their challenges and goals.

* "Before we dive in, let's confirm: my understanding is that you're looking to address [Pain Point 1] and improve [Goal 1]. Is that still accurate, and are there any other key priorities for this session?"

  1. Set Agenda & Expectations (2 mins):

* Outline what you'll show and what outcomes they can expect.

* "Today, I'll walk you through [Key Features] and show you how they directly impact [Their Specific Challenges]. My goal is for you to leave with a clear understanding of how [Your Product/Service] can benefit [Prospect's Company]."

  1. Tailored Presentation (Problem-Solution Focus) (20-30 mins):

* Show, Don't Just Tell: Demonstrate features in action.

* Connect to Benefits: For each feature, explicitly link it back to a prospect's pain point or goal. Use phrases like: "This feature, [Feature Name], directly addresses [Prospect's Pain Point] by allowing you to [Action], which means you'll achieve [Benefit/Outcome]."

* Industry Examples: Use case studies or scenarios relevant to their industry.

* Encourage Interaction: Ask open-ended questions throughout: "How do you see this impacting your team's workflow?" or "Does this align with how you envision solving [Challenge]?"

  1. Value Proposition Reinforcement & Summary (5 mins):

* Recap the key benefits discussed, emphasizing the ROI or strategic advantage.

* "So, to summarize, by leveraging [Your Product/Service], you can expect to [Key Benefit 1], [Key Benefit 2], and ultimately achieve [Overarching Goal]."

  1. Q&A & Objection Handling (5-10 mins):

* Address any questions or concerns proactively. (Refer to Section 2.4).

  1. Next Steps & Clear CTA (2-3 mins):

* Propose a specific, actionable next step.

* "Based on what we've seen today, the logical next step would be to [e.g., 'schedule a follow-up with your team lead to discuss integration possibilities,' or 'send you a tailored proposal next week']. What works best for you?"


2.3. Follow-Up Script Examples: Maintain Engagement & Add Value

Goal: To keep the conversation moving forward, provide additional value, and secure the next commitment.

2.3.1. Post-Call/Demo Follow-Up (Email)

> Subject: Following Up: [Your Company] & [Prospect's Company] Discussion

>

> Hi [Prospect Name],

>

> Great speaking with/meeting you today! I really enjoyed our conversation about [Specific Topic/Challenge discussed, e.g., 'your challenges with scaling customer support efficiently'].

>

> As promised, I've attached/linked [Relevant Resource, e.g., 'a brief summary of how our solution addresses those challenges' or 'a case study from a similar company in the [Prospect's Industry] sector'].

>

> To continue our conversation and explore how [Your Product/Service] can specifically integrate with your existing workflows, would you be open to a quick 15-minute call next [Day] at [Time]?

>

> Best regards,

> [Your Name]

2.3.2. Value-Add Follow-Up (Email - Mid-Nurture)

> Subject: Thought of you: [Relevant Industry Article/Insight]

>

> Hi [Prospect Name],

>

> Hope you're having a productive week!

>

> I came across this article/report on [Relevant Industry Topic, e.g., 'the latest trends in AI-driven marketing automation'] that reminded me of our earlier conversation about [Prospect's Challenge/Goal, e.g., 'optimizing your marketing spend']. Thought you might find it insightful: [Link to Article].

>

> On a related note, I'm still keen to discuss how [Your Solution] could help with [Specific Challenge] more deeply. Are you free next [Day] for a quick chat to explore this further?

>

> Best,

> [Your Name]

2.3.3. "Breakup" Email (Last Attempt)

> Subject: Closing the Loop on [Your Company] & [Prospect's Company]

>

> Hi [Prospect Name],

>

> I've tried to reach out a few times over the past weeks regarding how [Your Product/Service] could potentially help [Prospect's Company] with [Key Benefit/Problem Solved].

>

> It seems like now might not be the right time for us to connect, and that's perfectly fine. I'll close your file for now.

>

> If anything changes, or if you'd like to revisit this conversation in the future, please don't hesitate to reach out. I wish you and [Prospect's Company] all the best with [Relevant Goal/Project].

>

> Sincerely,

> [Your Name]


2.4. Objection Handling Framework & Examples: Overcome Barriers

Goal: To effectively address prospect concerns, build trust, and re-frame objections into opportunities to reinforce value.

General Framework (LAER):

  1. **Listen Actively
gemini Output

AI Sales Script Generator: Your Path to Enhanced Sales Performance

Welcome to your refined and formatted sales script package! This deliverable leverages advanced AI to generate highly effective, conversion-optimized sales scripts tailored specifically for your business needs. Our goal is to equip your sales team with professional, consistent, and persuasive language for every critical stage of the sales cycle, ensuring maximum impact and efficiency.


1. Service Overview

The AI Sales Script Generator is designed to eliminate guesswork and standardize excellence in your sales communications. By combining cutting-edge AI with proven sales methodologies, we produce detailed, actionable scripts that resonate with your target audience and drive desired outcomes. This final output is meticulously refined and formatted for immediate use by your sales professionals.


2. Key Deliverables & Features

Your comprehensive sales script package includes the following core components, each optimized for specific sales scenarios:

  • Conversion-Optimized Scripts: Each script is built with a focus on psychological triggers, clear value propositions, and compelling calls to action (CTAs) to maximize conversion rates. We integrate best practices from successful sales methodologies to ensure persuasive communication.
  • Industry-Specific Language: Scripts are customized with terminology, pain points, and benefits relevant to your specific industry and target market. This ensures authenticity and immediate relatability with your prospects.
  • Comprehensive Script Coverage: We provide tailored scripts for the most critical sales interactions:

* Cold Call Scripts: Designed to capture attention, qualify prospects quickly, and secure initial interest or a follow-up meeting. Includes openers, discovery questions, and value propositions.

* Demo Presentation Scripts: Structured outlines and key talking points to guide your product demonstrations, highlighting features as solutions to specific customer problems and driving engagement.

* Follow-Up Scripts: Crafted for various post-interaction scenarios (e.g., post-call, post-demo, post-proposal). These scripts aim to maintain momentum, reiterate value, address potential concerns, and move the deal forward.

* Objection Handling Frameworks: Proactive and reactive responses to common sales objections (e.g., price, timing, need, competition). These frameworks provide clear, empathetic, and persuasive strategies to overcome resistance.


3. The Refinement & Formatting Process

This deliverable represents the final stage of our script generation workflow. The refine_and_format step ensures:

  • Clarity and Conciseness: Scripts are edited for brevity and impact, removing jargon and unnecessary words to ensure messages are direct and easy to understand.
  • Logical Flow and Structure: Each script is organized with a clear beginning, middle, and end, guiding the sales representative seamlessly through the conversation.
  • Actionable Cues: We include suggested pauses, questions, and specific actions within the scripts to empower your sales team to engage dynamically rather than just reading.
  • Professional Presentation: Scripts are formatted for optimal readability and usability, often including sections for "Purpose," "Key Messages," "Discovery Questions," and "Call to Action."
  • Tone Consistency: The language and tone are adjusted to align with your brand voice and the professional standards expected in your industry.

4. Benefits for Your Sales Team

Implementing these AI-generated sales scripts will provide tangible advantages:

  • Increased Confidence: Equip your reps with proven language, reducing anxiety and improving delivery.
  • Enhanced Consistency: Ensure a unified and professional message across your entire sales organization.
  • Improved Conversion Rates: Leverage scientifically-backed persuasive techniques to close more deals.
  • Faster Onboarding: New sales hires can quickly get up to speed with effective communication strategies.
  • Time Savings: Eliminate the need for reps to craft scripts from scratch, allowing them to focus on selling.
  • Data-Driven Iteration: Provides a standardized baseline for A/B testing and continuous improvement of your sales messaging.

5. How to Leverage Your Generated Scripts

To maximize the impact of this deliverable, we recommend the following:

  • Training & Role-Playing: Conduct internal training sessions where sales reps can practice using the scripts in mock scenarios.
  • Integration: Incorporate these scripts into your CRM, sales enablement platforms, or internal knowledge base for easy access.
  • Personalization: Encourage reps to personalize specific sections with their unique style while adhering to the core messaging.
  • Feedback Loop: Establish a system for collecting feedback from your sales team on script effectiveness for future iterations.
  • A/B Testing: Experiment with different script variations for specific scenarios to identify the most effective approaches.

6. Example Script Structure (Illustrative Snippet)

Below is an illustrative example of the detailed structure you can expect for a segment of a script:


Script Type: Cold Call - Opener & Value Proposition

Target Audience: Mid-Market B2B SaaS Decision Makers

Objective: Secure a 15-minute discovery call


[REP NAME]: "Hi [PROSPECT NAME], this is [YOUR NAME] from [YOUR COMPANY]. I know I'm calling out of the blue, but based on your role at [PROSPECT COMPANY], I thought it might be worth a quick 30 seconds to see if we can help solve a common challenge we see in your industry."

  • *Pause for acknowledgement/permission.

[REP NAME]: "We specialize in helping companies like yours, specifically within the [PROSPECT INDUSTRY] sector, to significantly [KEY BENEFIT 1, e.g., reduce operational costs] and [KEY BENEFIT 2, e.g., accelerate time-to-market for new products] by [YOUR UNIQUE APPROACH/SOLUTION, e.g., streamlining their entire product development lifecycle with AI-powered automation].

"Many of our clients were struggling with [COMMON PAIN POINT 1, e.g., manual data entry errors] and [COMMON PAIN POINT 2, e.g., slow approval processes] before partnering with us. Does anything like that resonate with your current challenges?"

  • *Listen actively for response and pivot as needed.

7. Next Steps

We are confident that these carefully crafted sales scripts will become an invaluable asset for your sales organization. Please review the complete package, and feel free to reach out with any questions or requests for further refinement. We are committed to your sales success!

ai_sales_script_generator.md
Download as Markdown
Copy all content
Full output as text
Download ZIP
IDE-ready project ZIP
Copy share link
Permanent URL for this run
Get Embed Code
Embed this result on any website
Print / Save PDF
Use browser print dialog
\n\n\n"); var hasSrcMain=Object.keys(extracted).some(function(k){return k.indexOf("src/main")>=0;}); if(!hasSrcMain) zip.file(folder+"src/main."+ext,"import React from 'react'\nimport ReactDOM from 'react-dom/client'\nimport App from './App'\nimport './index.css'\n\nReactDOM.createRoot(document.getElementById('root')!).render(\n \n \n \n)\n"); var hasSrcApp=Object.keys(extracted).some(function(k){return k==="src/App."+ext||k==="App."+ext;}); if(!hasSrcApp) zip.file(folder+"src/App."+ext,"import React from 'react'\nimport './App.css'\n\nfunction App(){\n return(\n
\n
\n

"+slugTitle(pn)+"

\n

Built with PantheraHive BOS

\n
\n
\n )\n}\nexport default App\n"); zip.file(folder+"src/index.css","*{margin:0;padding:0;box-sizing:border-box}\nbody{font-family:system-ui,-apple-system,sans-serif;background:#f0f2f5;color:#1a1a2e}\n.app{min-height:100vh;display:flex;flex-direction:column}\n.app-header{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:40px}\nh1{font-size:2.5rem;font-weight:700}\n"); zip.file(folder+"src/App.css",""); zip.file(folder+"src/components/.gitkeep",""); zip.file(folder+"src/pages/.gitkeep",""); zip.file(folder+"src/hooks/.gitkeep",""); Object.keys(extracted).forEach(function(p){ var fp=p.startsWith("src/")?p:"src/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nnpm run dev\n\`\`\`\n\n## Build\n\`\`\`bash\nnpm run build\n\`\`\`\n\n## Open in IDE\nOpen the project folder in VS Code or WebStorm.\n"); zip.file(folder+".gitignore","node_modules/\ndist/\n.env\n.DS_Store\n*.local\n"); } /* --- Vue (Vite + Composition API + TypeScript) --- */ function buildVue(zip,folder,app,code,panelTxt){ var pn=pkgName(app); var C=cc(pn); var extracted=extractCode(panelTxt); zip.file(folder+"package.json",'{\n "name": "'+pn+'",\n "version": "0.0.0",\n "type": "module",\n "scripts": {\n "dev": "vite",\n "build": "vue-tsc -b && vite build",\n "preview": "vite preview"\n },\n "dependencies": {\n "vue": "^3.5.13",\n "vue-router": "^4.4.5",\n "pinia": "^2.3.0",\n "axios": "^1.7.9"\n },\n "devDependencies": {\n "@vitejs/plugin-vue": "^5.2.1",\n "typescript": "~5.7.3",\n "vite": "^6.0.5",\n "vue-tsc": "^2.2.0"\n }\n}\n'); zip.file(folder+"vite.config.ts","import { defineConfig } from 'vite'\nimport vue from '@vitejs/plugin-vue'\nimport { resolve } from 'path'\n\nexport default defineConfig({\n plugins: [vue()],\n resolve: { alias: { '@': resolve(__dirname,'src') } }\n})\n"); zip.file(folder+"tsconfig.json",'{"files":[],"references":[{"path":"./tsconfig.app.json"},{"path":"./tsconfig.node.json"}]}\n'); zip.file(folder+"tsconfig.app.json",'{\n "compilerOptions":{\n "target":"ES2020","useDefineForClassFields":true,"module":"ESNext","lib":["ES2020","DOM","DOM.Iterable"],\n "skipLibCheck":true,"moduleResolution":"bundler","allowImportingTsExtensions":true,\n "isolatedModules":true,"moduleDetection":"force","noEmit":true,"jsxImportSource":"vue",\n "strict":true,"paths":{"@/*":["./src/*"]}\n },\n "include":["src/**/*.ts","src/**/*.d.ts","src/**/*.tsx","src/**/*.vue"]\n}\n'); zip.file(folder+"env.d.ts","/// \n"); zip.file(folder+"index.html","\n\n\n \n \n "+slugTitle(pn)+"\n\n\n
\n \n\n\n"); var hasMain=Object.keys(extracted).some(function(k){return k==="src/main.ts"||k==="main.ts";}); if(!hasMain) zip.file(folder+"src/main.ts","import { createApp } from 'vue'\nimport { createPinia } from 'pinia'\nimport App from './App.vue'\nimport './assets/main.css'\n\nconst app = createApp(App)\napp.use(createPinia())\napp.mount('#app')\n"); var hasApp=Object.keys(extracted).some(function(k){return k.indexOf("App.vue")>=0;}); if(!hasApp) zip.file(folder+"src/App.vue","\n\n\n\n\n"); zip.file(folder+"src/assets/main.css","*{margin:0;padding:0;box-sizing:border-box}body{font-family:system-ui,sans-serif;background:#fff;color:#213547}\n"); zip.file(folder+"src/components/.gitkeep",""); zip.file(folder+"src/views/.gitkeep",""); zip.file(folder+"src/stores/.gitkeep",""); Object.keys(extracted).forEach(function(p){ var fp=p.startsWith("src/")?p:"src/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nnpm run dev\n\`\`\`\n\n## Build\n\`\`\`bash\nnpm run build\n\`\`\`\n\nOpen in VS Code or WebStorm.\n"); zip.file(folder+".gitignore","node_modules/\ndist/\n.env\n.DS_Store\n*.local\n"); } /* --- Angular (v19 standalone) --- */ function buildAngular(zip,folder,app,code,panelTxt){ var pn=pkgName(app); var C=cc(pn); var sel=pn.replace(/_/g,"-"); var extracted=extractCode(panelTxt); zip.file(folder+"package.json",'{\n "name": "'+pn+'",\n "version": "0.0.0",\n "scripts": {\n "ng": "ng",\n "start": "ng serve",\n "build": "ng build",\n "test": "ng test"\n },\n "dependencies": {\n "@angular/animations": "^19.0.0",\n "@angular/common": "^19.0.0",\n "@angular/compiler": "^19.0.0",\n "@angular/core": "^19.0.0",\n "@angular/forms": "^19.0.0",\n "@angular/platform-browser": "^19.0.0",\n "@angular/platform-browser-dynamic": "^19.0.0",\n "@angular/router": "^19.0.0",\n "rxjs": "~7.8.0",\n "tslib": "^2.3.0",\n "zone.js": "~0.15.0"\n },\n "devDependencies": {\n "@angular-devkit/build-angular": "^19.0.0",\n "@angular/cli": "^19.0.0",\n "@angular/compiler-cli": "^19.0.0",\n "typescript": "~5.6.0"\n }\n}\n'); zip.file(folder+"angular.json",'{\n "$schema": "./node_modules/@angular/cli/lib/config/schema.json",\n "version": 1,\n "newProjectRoot": "projects",\n "projects": {\n "'+pn+'": {\n "projectType": "application",\n "root": "",\n "sourceRoot": "src",\n "prefix": "app",\n "architect": {\n "build": {\n "builder": "@angular-devkit/build-angular:application",\n "options": {\n "outputPath": "dist/'+pn+'",\n "index": "src/index.html",\n "browser": "src/main.ts",\n "tsConfig": "tsconfig.app.json",\n "styles": ["src/styles.css"],\n "scripts": []\n }\n },\n "serve": {"builder":"@angular-devkit/build-angular:dev-server","configurations":{"production":{"buildTarget":"'+pn+':build:production"},"development":{"buildTarget":"'+pn+':build:development"}},"defaultConfiguration":"development"}\n }\n }\n }\n}\n'); zip.file(folder+"tsconfig.json",'{\n "compileOnSave": false,\n "compilerOptions": {"baseUrl":"./","outDir":"./dist/out-tsc","forceConsistentCasingInFileNames":true,"strict":true,"noImplicitOverride":true,"noPropertyAccessFromIndexSignature":true,"noImplicitReturns":true,"noFallthroughCasesInSwitch":true,"paths":{"@/*":["src/*"]},"skipLibCheck":true,"esModuleInterop":true,"sourceMap":true,"declaration":false,"experimentalDecorators":true,"moduleResolution":"bundler","importHelpers":true,"target":"ES2022","module":"ES2022","useDefineForClassFields":false,"lib":["ES2022","dom"]},\n "references":[{"path":"./tsconfig.app.json"}]\n}\n'); zip.file(folder+"tsconfig.app.json",'{\n "extends":"./tsconfig.json",\n "compilerOptions":{"outDir":"./dist/out-tsc","types":[]},\n "files":["src/main.ts"],\n "include":["src/**/*.d.ts"]\n}\n'); zip.file(folder+"src/index.html","\n\n\n \n "+slugTitle(pn)+"\n \n \n \n\n\n \n\n\n"); zip.file(folder+"src/main.ts","import { bootstrapApplication } from '@angular/platform-browser';\nimport { appConfig } from './app/app.config';\nimport { AppComponent } from './app/app.component';\n\nbootstrapApplication(AppComponent, appConfig)\n .catch(err => console.error(err));\n"); zip.file(folder+"src/styles.css","* { margin: 0; padding: 0; box-sizing: border-box; }\nbody { font-family: system-ui, -apple-system, sans-serif; background: #f9fafb; color: #111827; }\n"); var hasComp=Object.keys(extracted).some(function(k){return k.indexOf("app.component")>=0;}); if(!hasComp){ zip.file(folder+"src/app/app.component.ts","import { Component } from '@angular/core';\nimport { RouterOutlet } from '@angular/router';\n\n@Component({\n selector: 'app-root',\n standalone: true,\n imports: [RouterOutlet],\n templateUrl: './app.component.html',\n styleUrl: './app.component.css'\n})\nexport class AppComponent {\n title = '"+pn+"';\n}\n"); zip.file(folder+"src/app/app.component.html","
\n
\n

"+slugTitle(pn)+"

\n

Built with PantheraHive BOS

\n
\n \n
\n"); zip.file(folder+"src/app/app.component.css",".app-header{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:60vh;gap:16px}h1{font-size:2.5rem;font-weight:700;color:#6366f1}\n"); } zip.file(folder+"src/app/app.config.ts","import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';\nimport { provideRouter } from '@angular/router';\nimport { routes } from './app.routes';\n\nexport const appConfig: ApplicationConfig = {\n providers: [\n provideZoneChangeDetection({ eventCoalescing: true }),\n provideRouter(routes)\n ]\n};\n"); zip.file(folder+"src/app/app.routes.ts","import { Routes } from '@angular/router';\n\nexport const routes: Routes = [];\n"); Object.keys(extracted).forEach(function(p){ var fp=p.startsWith("src/")?p:"src/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nng serve\n# or: npm start\n\`\`\`\n\n## Build\n\`\`\`bash\nng build\n\`\`\`\n\nOpen in VS Code with Angular Language Service extension.\n"); zip.file(folder+".gitignore","node_modules/\ndist/\n.env\n.DS_Store\n*.local\n.angular/\n"); } /* --- Python --- */ function buildPython(zip,folder,app,code){ var title=slugTitle(app); var pn=pkgName(app); var src=code.replace(/^\`\`\`[\w]*\n?/m,"").replace(/\n?\`\`\`$/m,"").trim(); var reqMap={"numpy":"numpy","pandas":"pandas","sklearn":"scikit-learn","tensorflow":"tensorflow","torch":"torch","flask":"flask","fastapi":"fastapi","uvicorn":"uvicorn","requests":"requests","sqlalchemy":"sqlalchemy","pydantic":"pydantic","dotenv":"python-dotenv","PIL":"Pillow","cv2":"opencv-python","matplotlib":"matplotlib","seaborn":"seaborn","scipy":"scipy"}; var reqs=[]; Object.keys(reqMap).forEach(function(k){if(src.indexOf("import "+k)>=0||src.indexOf("from "+k)>=0)reqs.push(reqMap[k]);}); var reqsTxt=reqs.length?reqs.join("\n"):"# add dependencies here\n"; zip.file(folder+"main.py",src||"# "+title+"\n# Generated by PantheraHive BOS\n\nprint(title+\" loaded\")\n"); zip.file(folder+"requirements.txt",reqsTxt); zip.file(folder+".env.example","# Environment variables\n"); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\npython3 -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\n\`\`\`\n\n## Run\n\`\`\`bash\npython main.py\n\`\`\`\n"); zip.file(folder+".gitignore",".venv/\n__pycache__/\n*.pyc\n.env\n.DS_Store\n"); } /* --- Node.js --- */ function buildNode(zip,folder,app,code){ var title=slugTitle(app); var pn=pkgName(app); var src=code.replace(/^\`\`\`[\w]*\n?/m,"").replace(/\n?\`\`\`$/m,"").trim(); var depMap={"mongoose":"^8.0.0","dotenv":"^16.4.5","axios":"^1.7.9","cors":"^2.8.5","bcryptjs":"^2.4.3","jsonwebtoken":"^9.0.2","socket.io":"^4.7.4","uuid":"^9.0.1","zod":"^3.22.4","express":"^4.18.2"}; var deps={}; Object.keys(depMap).forEach(function(k){if(src.indexOf(k)>=0)deps[k]=depMap[k];}); if(!deps["express"])deps["express"]="^4.18.2"; var pkgJson=JSON.stringify({"name":pn,"version":"1.0.0","main":"src/index.js","scripts":{"start":"node src/index.js","dev":"nodemon src/index.js"},"dependencies":deps,"devDependencies":{"nodemon":"^3.0.3"}},null,2)+"\n"; zip.file(folder+"package.json",pkgJson); var fallback="const express=require(\"express\");\nconst app=express();\napp.use(express.json());\n\napp.get(\"/\",(req,res)=>{\n res.json({message:\""+title+" API\"});\n});\n\nconst PORT=process.env.PORT||3000;\napp.listen(PORT,()=>console.log(\"Server on port \"+PORT));\n"; zip.file(folder+"src/index.js",src||fallback); zip.file(folder+".env.example","PORT=3000\n"); zip.file(folder+".gitignore","node_modules/\n.env\n.DS_Store\n"); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\n\`\`\`\n\n## Run\n\`\`\`bash\nnpm run dev\n\`\`\`\n"); } /* --- Vanilla HTML --- */ function buildVanillaHtml(zip,folder,app,code){ var title=slugTitle(app); var isFullDoc=code.trim().toLowerCase().indexOf("=0||code.trim().toLowerCase().indexOf("=0; var indexHtml=isFullDoc?code:"\n\n\n\n\n"+title+"\n\n\n\n"+code+"\n\n\n\n"; zip.file(folder+"index.html",indexHtml); zip.file(folder+"style.css","/* "+title+" — styles */\n*{margin:0;padding:0;box-sizing:border-box}\nbody{font-family:system-ui,-apple-system,sans-serif;background:#fff;color:#1a1a2e}\n"); zip.file(folder+"script.js","/* "+title+" — scripts */\n"); zip.file(folder+"assets/.gitkeep",""); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\n## Open\nDouble-click \`index.html\` in your browser.\n\nOr serve locally:\n\`\`\`bash\nnpx serve .\n# or\npython3 -m http.server 3000\n\`\`\`\n"); zip.file(folder+".gitignore",".DS_Store\nnode_modules/\n.env\n"); } /* ===== MAIN ===== */ var sc=document.createElement("script"); sc.src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"; sc.onerror=function(){ if(lbl)lbl.textContent="Download ZIP"; alert("JSZip load failed — check connection."); }; sc.onload=function(){ var zip=new JSZip(); var base=(_phFname||"output").replace(/\.[^.]+$/,""); var app=base.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")||"my_app"; var folder=app+"/"; var vc=document.getElementById("panel-content"); var panelTxt=vc?(vc.innerText||vc.textContent||""):""; var lang=detectLang(_phCode,panelTxt); if(_phIsHtml){ buildVanillaHtml(zip,folder,app,_phCode); } else if(lang==="flutter"){ buildFlutter(zip,folder,app,_phCode,panelTxt); } else if(lang==="react-native"){ buildReactNative(zip,folder,app,_phCode,panelTxt); } else if(lang==="swift"){ buildSwift(zip,folder,app,_phCode,panelTxt); } else if(lang==="kotlin"){ buildKotlin(zip,folder,app,_phCode,panelTxt); } else if(lang==="react"){ buildReact(zip,folder,app,_phCode,panelTxt); } else if(lang==="vue"){ buildVue(zip,folder,app,_phCode,panelTxt); } else if(lang==="angular"){ buildAngular(zip,folder,app,_phCode,panelTxt); } else if(lang==="python"){ buildPython(zip,folder,app,_phCode); } else if(lang==="node"){ buildNode(zip,folder,app,_phCode); } else { /* Document/content workflow */ var title=app.replace(/_/g," "); var md=_phAll||_phCode||panelTxt||"No content"; zip.file(folder+app+".md",md); var h=""+title+""; h+="

"+title+"

"; var hc=md.replace(/&/g,"&").replace(//g,">"); hc=hc.replace(/^### (.+)$/gm,"

$1

"); hc=hc.replace(/^## (.+)$/gm,"

$1

"); hc=hc.replace(/^# (.+)$/gm,"

$1

"); hc=hc.replace(/\*\*(.+?)\*\*/g,"$1"); hc=hc.replace(/\n{2,}/g,"

"); h+="

"+hc+"

Generated by PantheraHive BOS
"; zip.file(folder+app+".html",h); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\nFiles:\n- "+app+".md (Markdown)\n- "+app+".html (styled HTML)\n"); } zip.generateAsync({type:"blob"}).then(function(blob){ var a=document.createElement("a"); a.href=URL.createObjectURL(blob); a.download=app+".zip"; a.click(); URL.revokeObjectURL(a.href); if(lbl)lbl.textContent="Download ZIP"; }); }; document.head.appendChild(sc); } function phShare(){navigator.clipboard.writeText(window.location.href).then(function(){var el=document.getElementById("ph-share-lbl");if(el){el.textContent="Link copied!";setTimeout(function(){el.textContent="Copy share link";},2500);}});}function phEmbed(){var runId=window.location.pathname.split("/").pop().replace(".html","");var embedUrl="https://pantherahive.com/embed/"+runId;var code='';navigator.clipboard.writeText(code).then(function(){var el=document.getElementById("ph-embed-lbl");if(el){el.textContent="Embed code copied!";setTimeout(function(){el.textContent="Get Embed Code";},2500);}});}