Skip to content
Β 
Β 

Repository files navigation

AIGNE WebSmith

AIGNE WebSmith is a powerful, AI-driven website generation tool built on the AIGNE Framework. It automates the creation of professional, SEO-optimized websites with complete content, templates, and direct publishing to Pages Kit.

✨ Features

πŸ€– AI-Powered Website Generation

  • Intelligent Structure Planning: Automatically analyze requirements and generate optimal website architecture
  • Batch Content Generation: Generate detailed content for all pages with one command
  • Professional SEO Optimization: Built-in SEO best practices and optimization recommendations
  • Multi-language Support: Supports Chinese and English content generation and localization

🎨 Professional Template System

  • Pages Kit Integration: Direct generation of Pages Kit-compatible YAML templates
  • Component-based Design: Supports modern components like Hero, CTA, FAQ, Content Cards
  • Built-in Component Library: Integrated component library with validation and management
  • Responsive Layout: Automatic adaptation for mobile and desktop displays
  • Visual Editing: Generated templates support visual editing and adjustments

πŸ“Š Quality Assurance

  • Structure Evaluation System: Automatic assessment of website architecture and user experience
  • Content Quality Checks: Ensure accuracy and consistency of content
  • Complete Test Coverage: 32+ test cases covering core functionality
  • Code Quality Assurance: Code checking and formatting using Biome

πŸš€ One-Click Publishing

  • Direct Publishing: One-click publishing to Pages Kit platform
  • Batch Upload: Supports batch publishing of multi-page websites
  • Status Monitoring: Detailed publishing status and error reporting
  • Access Links: Get accessible website links immediately after successful publishing

πŸ—οΈ Architecture

WebSmith is built on the AIGNE framework using an Agent-based architecture:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Structure      β”‚    β”‚  Content        β”‚    β”‚  Template       β”‚
β”‚  Planning       │───▢│  Generation     │───▢│  Generation     β”‚
β”‚  Agent          β”‚    β”‚  Agent          β”‚    β”‚  Agent          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                       β”‚                       β”‚
         β–Ό                       β–Ό                       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Evaluation     β”‚    β”‚  Batch          β”‚    β”‚  Upload         β”‚
β”‚  Agent          β”‚    β”‚  Processing     β”‚    β”‚  Agent          β”‚
β”‚                 β”‚    β”‚  Agent          β”‚    β”‚                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Core Components

  • 🧠 Structure Planning: Intelligently analyze requirements and generate website architecture
  • πŸ“ Content Generation: Batch generate high-quality page content
  • 🎨 Template Generation: Create Pages Kit compatible templates
  • 🧩 Component Library: Built-in component library management and validation
  • πŸ“Š Quality Evaluation: Evaluate website quality and user experience
  • ⚑ Batch Processing: Efficient batch processing system
  • πŸš€ Pages Kit Upload: One-click publishing to Pages Kit

πŸš€ Quick Start

Installation

# Install AIGNE CLI
npm install -g @aigne/cli

# Or install locally
npm install @aigne/cli

Basic Usage

1. Generate a Website

# Generate pages
aigne web generate

2. Publish to Pages Kit

# Publish generated pages
aigne web publish

3. Additional Commands

# Translate existing pages to different language
aigne web translate

# Update existing website content
aigne web update

# Pull components
aigne web component --url "https://your-pages-kit/api/projects/your-project-id/components/pull?secret=your-secret&hash=your-hash"

Example Input

Create an input file my-website.yaml:

rules: |
  Create a modern SaaS product website that includes:
  1. Product introduction and core features
  2. Pricing plan comparison
  3. Customer success stories
  4. Technical documentation portal
  5. Contact and support pages

  Requirements:
  - Professional business style
  - Highlight product advantages and differentiation
  - Include clear CTA to guide users to trial

targetAudience: SMB owners and technical decision makers
locale: en
websiteStyle: business

Then run:

aigne web generate --input @my-website.yaml

πŸ“ Project Structure

aigne-web-smith/
β”œβ”€β”€ agents/                 # Core AI agents
β”‚   β”œβ”€β”€ chat/              # Interactive chat interface
β”‚   β”œβ”€β”€ generate/          # Website generation workflows
β”‚   β”‚   β”œβ”€β”€ component-library/  # Component library management
β”‚   β”‚   β”œβ”€β”€ page-detail/        # Page content generation
β”‚   β”‚   └── page-data/          # Page data composition
β”‚   β”œβ”€β”€ plan/              # Website structure planning
β”‚   β”œβ”€β”€ publish/           # Pages Kit publishing
β”‚   β”œβ”€β”€ translate/         # Multi-language support
β”‚   β”œβ”€β”€ update/            # Content update workflows
β”‚   └── utils/             # Utility functions and helpers
β”œβ”€β”€ prompts/               # AI prompts and templates
β”‚   β”œβ”€β”€ chat/, generate/, plan/, translate/
β”œβ”€β”€ utils/                 # Core utility functions
β”‚   β”œβ”€β”€ constants.mjs          # Component definitions and constants
β”‚   β”œβ”€β”€ generate-helper.mjs    # Website generation utilities
β”‚   β”œβ”€β”€ auth-utils.mjs         # Authentication handling
β”‚   β”œβ”€β”€ pages-finder-utils.mjs # Page discovery and management
β”‚   └── upload-files.mjs       # File upload utilities
β”œβ”€β”€ pages-mcp/             # MCP server implementation
β”‚   β”œβ”€β”€ get-pages-structure.mjs
β”‚   └── get-page-detail.mjs
└── aigne.yaml            # Main CLI configuration

πŸ§ͺ Testing

WebSmith includes comprehensive test coverage:

# Run all tests
bun test

# Run with coverage
bun test --coverage --coverage-reporter=lcov --coverage-reporter=text

# Run with verbose output
bun test --verbose

Test coverage includes:

  • βœ… Utility function tests
  • βœ… Pages Kit integration tests
  • βœ… Website structure tests
  • βœ… File system and error handling tests
  • βœ… Component library validation tests

πŸ”§ Development

Setup Development Environment

# Install dependencies
pnpm install

# Run code quality checks
npm run lint

# Auto-fix formatting issues
npm run lint:fix

# Watch mode for tests
bun test --watch

Adding New Components

  1. Create Agent: Add new .yaml agent in appropriate agents/ subdirectory
  2. Add Prompt: Create corresponding prompt in prompts/
  3. Update Config: Add agent to aigne.yaml
  4. Write Tests: Add tests using Bun test framework
  5. Update Docs: Document the new functionality

Code Quality

  • Linting: Uses Biome for code quality and formatting
  • Testing: Bun test runner with comprehensive coverage
  • Type Safety: JSDoc annotations for better development experience
  • Git Hooks: Pre-commit hooks ensure code quality

πŸ“š API Reference

Main Commands

chat

Interactive chat interface for website generation.

generate (aliases: gen, g)

Generate a complete website from user requirements.

Parameters:

  • rules (required): Website requirements description
  • targetAudience: Target audience description
  • locale: Website language (default: "zh")
  • websiteStyle: Website style (default: "business")
  • projectId: Pages Kit project ID for publishing

publish

Publish generated website to Pages Kit.

Parameters:

  • projectId (required): Pages Kit project ID
  • locale: Website language
  • dryRun: Preview without publishing
  • overwrite: Overwrite existing pages

translate

Translate existing website content to different languages.

update

Update existing website content with new requirements.

MCP Server

WebSmith provides MCP server endpoints for integration:

  • get-pages-structure: Retrieve current website structure
  • get-page-detail: Get detailed content for specific page
  • pages-search: Search within website content

Start MCP server:

aigne web serve-mcp

πŸ“Š Performance

WebSmith is optimized for production use:

  • Fast Generation: Parallel agent processing
  • Efficient Templates: Optimized Pages Kit integration
  • Memory Management: Streaming content processing
  • Error Recovery: Robust error handling and recovery

Typical performance metrics:

  • 5-page website: ~2-3 minutes
  • 15-page website: ~5-8 minutes
  • Template generation: ~10-20 seconds per page

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Process

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes with tests
  4. Run quality checks: npm run lint
  5. Submit a pull request

πŸ“„ License

This project is licensed under the Elastic License 2.0 - see the LICENSE file for details.

πŸ”— Links


Built with ❀️ using the AIGNE Framework

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages