Modern TypeScript-First Static Site Generator with AI-Powered Extensibility
Build blazing-fast static sites with reusable TypeScript partials, Zod validation, and MCP integration
Issue #7 (Partial Registry & Discovery System) has been COMPLETED with comprehensive TDD implementation featuring:
- β 29 unit tests covering all functionality (100% pass rate)
- β
Automatic filesystem discovery of
.partial.ts
files - β Zod schema validation for type-safe props
- β Dependency resolution with circular dependency detection
- β Hot reload support for development workflow
- β Performance optimization with validation caching
- β Event-driven architecture for extensibility
- Use as GitHub Template - Create production-ready static sites in < 5 minutes
- Build TypeScript Partials - Create reusable components with full type safety
- Leverage Zod Validation - Runtime validation for all partial props
- Enjoy Hot Reload - See changes instantly during development
- Scale with Confidence - Production-ready architecture with comprehensive testing
- Markdown processing pipeline (Issue #11)
- Interactive CLI framework (Issue #15)
- Development server with live preview (Issue #16)
- MCP plugin architecture for AI-powered features
AgentStatic is built on a solid foundation of modern TypeScript practices:
// Example: Creating a TypeScript partial with Zod validation
import { z } from 'zod';
import type { AgentPartial } from '@/types/partial';
export const heroPartial: AgentPartial<{
title: string;
subtitle?: string;
ctaText: string;
ctaUrl: string;
}> = {
schema: z.object({
title: z.string(),
subtitle: z.string().optional(),
ctaText: z.string(),
ctaUrl: z.string().url(),
}),
template: (props, helpers) => `
<section class="hero">
<h1>${props.title}</h1>
${props.subtitle ? `<p class="subtitle">${props.subtitle}</p>` : ''}
<a href="${props.ctaUrl}" class="cta">${props.ctaText}</a>
</section>
`,
styles: `
.hero { padding: 4rem 2rem; text-align: center; }
.hero h1 { font-size: 3rem; margin-bottom: 1rem; }
.subtitle { font-size: 1.5rem; color: #666; }
.cta { display: inline-block; padding: 1rem 2rem; background: #007bff; color: white; text-decoration: none; border-radius: 4px; }
`,
metadata: {
description: 'Hero section with title, subtitle, and CTA',
category: 'layout',
keywords: ['hero', 'header', 'cta', 'landing'],
usageExamples: ['Landing pages', 'Marketing sites'],
},
};
Feature | Status | Details |
---|---|---|
GitHub Template Repository | β Production Ready | One-click setup with automatic configuration |
TypeScript Configuration | β Complete | Strict mode, ES modules, Node.js 24 support |
Testing Foundation | β Complete | Vitest with 48 passing tests |
Partial Registry System | β NEW! | Issue #7 complete with TDD implementation |
Zod Integration | β Complete | Runtime validation for all partials |
Hot Reload Foundation | β Complete | File watching with Chokidar |
Event System | β Complete | EventEmitter for extensibility |
Feature | Status | Issue | Target |
---|---|---|---|
Markdown Processing | π§ In Progress | #11 | Unified-based pipeline with frontmatter |
Interactive CLI | π§ In Progress | #15 | Command-line interface for site management |
Development Server | π§ In Progress | #16 | Live preview with hot reload |
Content Discovery | π Planned | #14 | Automatic content indexing |
- β TypeScript setup with strict mode
- β Testing infrastructure
- β Partial registry system
- β GitHub template functionality
- π§ Markdown processing (#11)
- π§ Content discovery (#14)
- π§ CLI framework (#15)
- π§ Development server (#16)
- π Build pipeline (#23)
- π Asset optimization (#24)
- π Deployment automation (#25)
- π MCP server foundation (#20)
- π AI layout composition (#21)
- π Natural language generation (#22)
- π Use This Template - Create your repository
- Enable GitHub Pages: Settings β Pages β Source: "GitHub Actions" β Save
- Push content to main branch β Your site auto-deploys!
# Clone the repository
git clone https://github.com/conorluddy/AgentStatic.git
cd AgentStatic
# Install dependencies
npm install
# Run tests
npm test
# Type checking
npm run type-check
# Build for production
npm run build
AgentStatic/
βββ src/
β βββ core/ # Core engine (PartialRegistry β
)
β β βββ partial-registry.ts
β β βββ index.ts
β βββ types/ # TypeScript interfaces
β β βββ partial.ts # AgentPartial interface
β β βββ content.ts # Content types
β β βββ template.ts # Template types
β βββ partials/ # Partial categories
β β βββ layout/ # Page structure partials
β β βββ content/ # Content display partials
β β βββ media/ # Media handling partials
β β βββ interactive/ # Interactive components
β βββ helpers/ # Utility functions
β βββ mcp/ # MCP integration (future)
βββ tests/ # Comprehensive test suite
β βββ unit/
β βββ core/ # Core system tests
β βββ types/ # Type system tests
β βββ config/ # Configuration tests
βββ content/ # User content (markdown)
βββ assets/ # Media files
βββ scripts/ # Build and deployment
The heart of AgentStatic is its TypeScript-first partial system with Zod validation:
Partials are reusable, self-contained components that include:
- Schema: Zod validation for type-safe props
- Template: HTML generation function
- Styles: Scoped CSS for the component
- Metadata: Discovery and documentation info
// src/partials/custom/my-card.partial.ts
import { z } from 'zod';
import type { AgentPartial } from '@/types/partial';
export const cardPartial: AgentPartial<{
title: string;
description: string;
imageUrl?: string;
link?: string;
}> = {
schema: z.object({
title: z.string().min(1),
description: z.string().max(200),
imageUrl: z.string().url().optional(),
link: z.string().url().optional(),
}),
template: props => `
<article class="card">
${props.imageUrl ? `<img src="${props.imageUrl}" alt="${props.title}">` : ''}
<h3>${props.title}</h3>
<p>${props.description}</p>
${props.link ? `<a href="${props.link}">Learn more β</a>` : ''}
</article>
`,
styles: `
.card {
border: 1px solid #e0e0e0;
border-radius: 8px;
padding: 1.5rem;
margin-bottom: 1rem;
}
.card img {
width: 100%;
height: 200px;
object-fit: cover;
border-radius: 4px;
margin-bottom: 1rem;
}
.card h3 {
margin: 0 0 0.5rem 0;
}
.card a {
color: #007bff;
text-decoration: none;
}
`,
metadata: {
description: 'Card component for displaying content previews',
category: 'content',
keywords: ['card', 'preview', 'component'],
usageExamples: ['Blog post previews', 'Product cards', 'Team member profiles'],
},
};
import { PartialRegistrySystem } from '@/core/partial-registry';
// Create registry instance
const registry = new PartialRegistrySystem();
// Register a partial
registry.register('my-card', cardPartial);
// Validate and use
const validatedProps = registry.validatePartialProps('my-card', {
title: 'Hello World',
description: 'This is a test card',
});
const partial = registry.get('my-card');
const html = partial.template(validatedProps, helpers);
// Enable filesystem discovery
await registry.discoverPartials('./src/partials');
// Enable hot reload for development
registry.enableHotReload('./src/partials');
// Listen to events
registry.on('discover', (name, partial) => {
console.log(`Discovered partial: ${name}`);
});
registry.on('reload', (name, partial) => {
console.log(`Reloaded partial: ${name}`);
});
AgentStatic uses comprehensive TDD (Test-Driven Development):
# Run all tests
npm test
# Watch mode for development
npm run test:watch
# Coverage report
npm run test:coverage
# UI test runner
npm run test:ui
- Unit Tests: Core functionality, type safety, validation
- Integration Tests: Partial discovery, hot reload, events
- Performance Tests: Registry scaling, validation caching
# TypeScript type checking
npm run type-check
# Linting
npm run lint
npm run lint:fix
# Code formatting
npm run format
npm run format:check
# Build
npm run build
npm run build:types
# Clean build artifacts
npm run clean
- TypeScript-First Partials: Full type safety with Zod validation
- Hot Reload Architecture: Instant updates during development
- Event-Driven System: Extensible plugin architecture
- Production-Ready Foundation: 48 tests, 100% pass rate
- AI-Ready Design: MCP integration planned for next phase
Feature | AgentStatic | Jekyll | Hugo | Gatsby |
---|---|---|---|---|
TypeScript Partials | β Native | β No | β No | π§ Limited |
Zod Validation | β Built-in | β No | β No | β No |
Hot Reload | β Native | π§ Plugin | β Yes | β Yes |
GitHub Template | β One-click | β Manual | β Manual | β Manual |
Test Coverage | β Comprehensive | π§ Basic | π§ Basic | β Good |
AI Integration | π§ Coming (MCP) | β No | β No | β No |
- Component Libraries: Build reusable UI components with validation
- Design Systems: Type-safe component development
- Static Sites: GitHub Pages deployment ready
- Documentation: Structured content with TypeScript
- Portfolio Sites: Advanced media handling and galleries
- Marketing Sites: SEO optimization and performance
- Developer Blogs: Code highlighting and technical features
- AI-Enhanced Content: MCP-powered content generation
AgentStatic welcomes contributions! We follow TDD practices and maintain high code quality standards.
- Check the Issues: Look for issues labeled
good first issue
orhelp wanted
- Fork & Branch: Create a feature branch from
main
- Write Tests First: Follow TDD - tests before implementation
- Submit PR: Include tests and update documentation
- TypeScript Strict Mode: No
any
types allowed - Test Coverage: Maintain >90% coverage
- Conventional Commits: Use semantic commit messages
- Documentation: Update README and inline docs
- Markdown Processing (Issue #11) - Unified pipeline implementation
- CLI Framework (Issue #15) - Interactive command interface
- Development Server (Issue #16) - Live preview functionality
- Documentation - Improve guides and examples
- TypeScript Coverage: 100% (strict mode)
- Test Coverage: 48 tests, 100% pass rate
- Dependencies: Modern, actively maintained
- Node.js: Requires 24+ for latest features
- Registry Operations: <1ms with caching
- Partial Discovery: Handles 1000+ partials
- Hot Reload: Instant file change detection
- Build Time: Sub-second builds (coming)
- β Partial Registry (COMPLETE)
- π§ Markdown Engine (In Progress)
- π§ CLI Tools (In Progress)
- π Dev Server (Next Up)
- π MCP Integration - AI-powered content
- π Plugin Marketplace - Community extensions
- π Advanced Media - Gallery components
- π Theme System - Swappable designs
- π Multi-language - i18n support
- π E-commerce - Shop components
- π Analytics - Privacy-first tracking
- π CDN Integration - Global deployment
- TypeScript 5.7 - Type-safe development
- Zod - Runtime validation
- Vitest - Modern testing framework
- Model Context Protocol - AI integration (coming)
MIT License - see LICENSE file for details.
AgentStatic is built on the shoulders of giants:
- The TypeScript team for an amazing type system
- The Zod team for elegant runtime validation
- The Vitest team for a delightful testing experience
- The open source community for inspiration and support
Special recognition to early contributors who helped shape the vision and architecture.
π Use This Template | β Star on GitHub | π¬ Join Discussion
AgentStatic - Modern Static Sites with TypeScript Partials & AI-Ready Architecture
Building the future of static site generation, one partial at a time β¨