Skip to content

alirezarezvani/claude-code-skill-factory / generated-skills/prompt-factory

prompt-factory

Verified

World-class prompt powerhouse that generates production-ready mega-prompts for any role, industry, and task through intelligent 7-question flow, 69 comprehensive presets across 15 professional domains (technical, business, creative, legal, finance, HR, design, customer, executive, manufacturing, R&D, regulatory, specialized-technical, research, creative-media), multiple output formats (XML/Claude/ChatGPT/Gemini), quality validation gates, and contextual best practices from OpenAI/Anthropic/Google. Supports both core and advanced modes with testing scenarios and prompt variations.

FileKindSize
CHANGELOG.mdmarkdown13.2 KB
HOW_TO_USE.mdmarkdown29.0 KB
README.mdmarkdown9.3 KB
SKILL.mdskill md36.2 KB
examples/example-1-fullstack-api.mdmarkdown13.7 KB
examples/example-2-marketing-strategy.mdmarkdown12.4 KB
examples/example-3-product-prd.mdmarkdown13.7 KB
examples/example-4-devops-infrastructure.mdmarkdown19.6 KB
examples/example-5-content-calendar.mdmarkdown17.7 KB
outputs/.gitkeepother0 B
references/best-practices-reference.mdmarkdown14.2 KB
requirements.txtmanifest249 B
scripts/batch_generator.pyscript9.2 KB
scripts/generate_prompt.pyscript29.0 KB
scripts/optimizer.pyscript22.2 KB
scripts/validator.pyscript18.9 KB
templates/presets/business/business-analyst.mdmarkdown8.4 KB
templates/presets/business/marketing-manager.mdmarkdown6.3 KB
templates/presets/business/marketing-strategist.mdmarkdown3.7 KB
templates/presets/business/operations-manager.mdmarkdown7.6 KB
templates/presets/business/product-engineer.mdmarkdown7.4 KB
templates/presets/business/product-manager.mdmarkdown4.3 KB
templates/presets/business/product-owner.mdmarkdown7.7 KB
templates/presets/business/project-manager.mdmarkdown7.2 KB
templates/presets/business/sales-business-manager.mdmarkdown7.7 KB
templates/presets/creative-media/copywriter.mdmarkdown10.9 KB
templates/presets/creative-media/seo-specialist.mdmarkdown14.4 KB
templates/presets/creative-media/social-media-manager.mdmarkdown13.3 KB
templates/presets/creative-media/video-producer.mdmarkdown15.0 KB
templates/presets/creative/content-strategist.mdmarkdown5.0 KB
templates/presets/creative/ux-researcher.mdmarkdown7.7 KB
templates/presets/customer/account-manager.mdmarkdown14.6 KB
templates/presets/customer/customer-experience-manager.mdmarkdown15.3 KB
templates/presets/customer/customer-success-manager.mdmarkdown13.8 KB
templates/presets/customer/support-engineer.mdmarkdown13.7 KB
templates/presets/design/brand-designer.mdmarkdown11.3 KB
templates/presets/design/graphic-designer.mdmarkdown9.9 KB
templates/presets/design/product-designer.mdmarkdown10.8 KB
templates/presets/design/ui-ux-designer.mdmarkdown9.9 KB
templates/presets/executive/ceo-founder.mdmarkdown13.5 KB
templates/presets/executive/chief-marketing-officer.mdmarkdown14.9 KB
templates/presets/executive/chief-operations-officer.mdmarkdown15.3 KB
templates/presets/executive/chief-product-officer.mdmarkdown14.6 KB
templates/presets/executive/chief-strategy-officer.mdmarkdown14.4 KB
templates/presets/executive/cto-vp-engineering.mdmarkdown14.2 KB
templates/presets/executive/general-manager.mdmarkdown13.8 KB
templates/presets/finance/accountant-tax.mdmarkdown12.8 KB
templates/presets/finance/cfo-controller.mdmarkdown13.0 KB
templates/presets/finance/financial-analyst.mdmarkdown12.5 KB
templates/presets/finance/investment-analyst.mdmarkdown13.3 KB
templates/presets/hr/compensation-analyst.mdmarkdown15.3 KB
templates/presets/hr/hr-manager.mdmarkdown14.2 KB
templates/presets/hr/learning-development.mdmarkdown15.9 KB
templates/presets/hr/talent-acquisition.mdmarkdown14.4 KB
templates/presets/legal/compliance-officer.mdmarkdown10.9 KB
templates/presets/legal/contract-manager.mdmarkdown11.2 KB
templates/presets/legal/legal-counsel.mdmarkdown10.0 KB
templates/presets/legal/regulatory-affairs.mdmarkdown12.8 KB
templates/presets/manufacturing/industrial-designer.mdmarkdown16.4 KB
templates/presets/manufacturing/manufacturing-engineer.mdmarkdown13.7 KB
templates/presets/manufacturing/quality-engineer.mdmarkdown15.5 KB
templates/presets/manufacturing/supply-chain-manager.mdmarkdown15.0 KB
templates/presets/rd/ai-rd-expert.mdmarkdown19.7 KB
templates/presets/rd/clinical-specialist.mdmarkdown18.2 KB
templates/presets/regulatory/quality-management-responsible.mdmarkdown16.0 KB
templates/presets/research/market-researcher.mdmarkdown15.9 KB
templates/presets/research/quantitative-analyst.mdmarkdown14.9 KB
templates/presets/research/research-scientist.mdmarkdown14.8 KB
templates/presets/specialized-technical/blockchain-developer.mdmarkdown10.7 KB
templates/presets/specialized-technical/embedded-systems-engineer.mdmarkdown11.0 KB
templates/presets/specialized-technical/game-developer.mdmarkdown11.4 KB
templates/presets/specialized-technical/ml-engineer.mdmarkdown10.4 KB
templates/presets/specialized-technical/network-engineer.mdmarkdown11.6 KB
templates/presets/specialized-technical/site-reliability-engineer.mdmarkdown12.0 KB
templates/presets/specialized/aeo-specialist.mdmarkdown16.1 KB
templates/presets/specialized/sales-engineer.mdmarkdown5.9 KB
templates/presets/specialized/technical-writer.mdmarkdown4.6 KB
templates/presets/technical/cloud-architect.mdmarkdown8.0 KB
templates/presets/technical/data-scientist.mdmarkdown7.5 KB
templates/presets/technical/database-engineer.mdmarkdown8.2 KB
templates/presets/technical/devops-engineer.mdmarkdown4.7 KB
templates/presets/technical/fullstack-engineer.mdmarkdown3.3 KB
templates/presets/technical/mobile-engineer.mdmarkdown7.5 KB
templates/presets/technical/qa-engineer.mdmarkdown8.2 KB
templates/presets/technical/security-engineer.mdmarkdown8.5 KB

scripts/batch_generator.py

View on GitHub
#!/usr/bin/env python3
"""
Prompt Suite - Batch Generator

Generate multiple prompts from CSV or JSON batch configuration.
Perfect for team-wide rollouts and standardization.

Usage:
    python batch_generator.py --input team-prompts.csv --format xml --mode core --output-dir ./prompts/
    python batch_generator.py --input batch-config.json --format all --parallel 5 --output-dir ./output/
"""

import csv
import json
import argparse
import concurrent.futures
from pathlib import Path
from typing import List, Dict, Any
from datetime import datetime
from generate_prompt import PromptGenerator, create_markdown_document


class BatchGenerator:
    """Generate multiple prompts in batch mode."""

    def __init__(self, parallel_workers: int = 3):
        self.parallel_workers = parallel_workers
        self.generator = PromptGenerator()
        self.results = []

    def load_csv_batch(self, filepath: str) -> List[Dict[str, Any]]:
        """Load batch configuration from CSV file."""
        configs = []
        with open(filepath, 'r') as f:
            reader = csv.DictReader(f)
            for row in reader:
                configs.append(dict(row))
        return configs

    def load_json_batch(self, filepath: str) -> List[Dict[str, Any]]:
        """Load batch configuration from JSON file."""
        with open(filepath, 'r') as f:
            data = json.load(f)

        # Support both array of configs or object with configs key
        if isinstance(data, list):
            return data
        elif 'prompts' in data:
            return data['prompts']
        else:
            raise ValueError("JSON must be array of configs or object with 'prompts' key")

    def generate_single(self, config: Dict[str, Any], format_type: str, mode: str,
                       output_dir: Path) -> Dict[str, Any]:
        """Generate a single prompt from configuration."""
        try:
            # Extract metadata
            name = config.get('name', f"prompt-{datetime.now().timestamp()}")

            print(f"šŸ“ Generating: {name}")

            # Generate prompt
            result = self.generator.generate(config, format_type, mode)

            # Create output filename
            role_slug = config.get('role', 'assistant').lower().replace(' ', '-')
            output_file = output_dir / f"{name}-{role_slug}.md"

            # Create markdown document
            markdown_doc = create_markdown_document(result, mode)

            # Write to file
            output_file.write_text(markdown_doc)

            # Validation summary
            validation_summary = {
                fmt: val['passed']
                for fmt, val in result['validation'].items()
            }

            return {
                'name': name,
                'status': 'success',
                'output_file': str(output_file),
                'validation': validation_summary
            }

        except Exception as e:
            return {
                'name': config.get('name', 'unknown'),
                'status': 'error',
                'error': str(e)
            }

    def generate_batch(self, configs: List[Dict[str, Any]], format_type: str,
                      mode: str, output_dir: Path) -> Dict[str, Any]:
        """Generate multiple prompts in parallel."""
        print(f"\nšŸš€ Starting batch generation:")
        print(f"   Prompts: {len(configs)}")
        print(f"   Format: {format_type}")
        print(f"   Mode: {mode}")
        print(f"   Workers: {self.parallel_workers}")
        print(f"   Output: {output_dir}")
        print()

        # Ensure output directory exists
        output_dir.mkdir(parents=True, exist_ok=True)

        # Generate prompts in parallel
        with concurrent.futures.ThreadPoolExecutor(max_workers=self.parallel_workers) as executor:
            futures = {
                executor.submit(self.generate_single, config, format_type, mode, output_dir): config
                for config in configs
            }

            results = []
            for future in concurrent.futures.as_completed(futures):
                result = future.result()
                results.append(result)

                # Print progress
                status_emoji = "āœ…" if result['status'] == 'success' else "āŒ"
                print(f"{status_emoji} {result['name']}: {result['status']}")

        # Generate summary
        successful = sum(1 for r in results if r['status'] == 'success')
        failed = len(results) - successful

        summary = {
            'total': len(configs),
            'successful': successful,
            'failed': failed,
            'output_dir': str(output_dir),
            'generated_at': datetime.now().isoformat(),
            'results': results
        }

        return summary


def create_summary_report(summary: Dict[str, Any], output_dir: Path):
    """Create a summary report of batch generation."""
    report = f"""# Batch Generation Report

**Generated:** {summary['generated_at']}
**Output Directory:** {summary['output_dir']}

## Summary

- **Total Prompts:** {summary['total']}
- **Successful:** {summary['successful']} āœ…
- **Failed:** {summary['failed']} āŒ
- **Success Rate:** {(summary['successful'] / summary['total'] * 100):.1f}%

## Details

"""

    # Add details for each prompt
    for result in summary['results']:
        if result['status'] == 'success':
            report += f"\n### āœ… {result['name']}\n"
            report += f"- **File:** `{Path(result['output_file']).name}`\n"
            report += f"- **Validation:**\n"
            for fmt, passed in result['validation'].items():
                status = "āœ… Passed" if passed else "āš ļø Review"
                report += f"  - {fmt.upper()}: {status}\n"
        else:
            report += f"\n### āŒ {result['name']}\n"
            report += f"- **Error:** {result['error']}\n"

    report += f"\n---\n\n*Generated by Prompt Suite Batch Generator v1.0*\n"

    # Write report
    report_file = output_dir / 'batch-generation-report.md'
    report_file.write_text(report)

    return report_file


def main():
    """Main CLI entry point."""
    parser = argparse.ArgumentParser(
        description='Generate multiple prompts in batch mode',
        formatter_class=argparse.RawDescriptionHelpFormatter,
        epilog="""
CSV Format Example:
  name,role,domain,goal,output_type,tech_stack
  backend-api,Senior Backend Engineer,FinTech,Build secure APIs,code,"Python,FastAPI"
  frontend-ui,Frontend Engineer,FinTech,Build UIs,code,"React,TypeScript"

JSON Format Example:
  {
    "prompts": [
      {"name": "backend-api", "role": "Senior Backend Engineer", ...},
      {"name": "frontend-ui", "role": "Frontend Engineer", ...}
    ]
  }

Examples:
  # From CSV
  python batch_generator.py --input team.csv --format xml --mode core --output-dir ./prompts/

  # From JSON with parallel processing
  python batch_generator.py --input batch.json --format all --parallel 10 --output-dir ./output/
"""
    )

    parser.add_argument('--input', required=True,
                       help='Input CSV or JSON file with batch configuration')
    parser.add_argument('--format', required=True,
                       choices=['xml', 'claude', 'chatgpt', 'gemini', 'all'],
                       help='Output format for all prompts')
    parser.add_argument('--mode', default='core', choices=['core', 'advanced'],
                       help='Generation mode (default: core)')
    parser.add_argument('--output-dir', required=True,
                       help='Output directory for generated prompts')
    parser.add_argument('--parallel', type=int, default=3,
                       help='Number of parallel workers (default: 3)')
    parser.add_argument('--report', action='store_true',
                       help='Generate summary report (default: True)')

    args = parser.parse_args()

    # Determine input format
    input_path = Path(args.input)
    if not input_path.exists():
        parser.error(f"Input file not found: {args.input}")

    # Load configurations
    batch_gen = BatchGenerator(parallel_workers=args.parallel)

    if input_path.suffix == '.csv':
        print(f"šŸ“„ Loading CSV batch configuration...")
        configs = batch_gen.load_csv_batch(args.input)
    elif input_path.suffix == '.json':
        print(f"šŸ“„ Loading JSON batch configuration...")
        configs = batch_gen.load_json_batch(args.input)
    else:
        parser.error(f"Unsupported file format: {input_path.suffix} (use .csv or .json)")

    print(f"āœ“ Loaded {len(configs)} prompt configurations")

    # Generate batch
    output_dir = Path(args.output_dir)
    summary = batch_gen.generate_batch(configs, args.format, args.mode, output_dir)

    # Print summary
    print(f"\n{'=' * 60}")
    print(f"šŸ“Š Batch Generation Complete!")
    print(f"{'=' * 60}")
    print(f"Total: {summary['total']}")
    print(f"āœ… Successful: {summary['successful']}")
    print(f"āŒ Failed: {summary['failed']}")
    print(f"šŸ“ Output: {summary['output_dir']}")

    # Generate report
    if args.report or summary['failed'] > 0:
        report_file = create_summary_report(summary, output_dir)
        print(f"šŸ“‹ Report: {report_file}")

    # Exit with error code if any failed
    if summary['failed'] > 0:
        exit(1)
    else:
        print(f"\nāœ… All prompts generated successfully!")
        exit(0)


if __name__ == "__main__":
    main()
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall