๐ค AI Tools Platform - Project Plan
> Personal AI tools collection for content creation across multiple platforms
๐ค AI Tools Platform - Project Plan
Personal AI tools collection for content creation across multiple platforms
๐ Overview
A modular AI-powered content creation platform built with Next.js, designed to leverage multiple LLM models via OpenRouter. Each tool operates independently with its own system instructions, model configurations, and output formats.
๐ฏ Project Goals
Phase 1: MVP (Current)
- Core architecture setup
- OpenRouter integration
- 2-3 initial tools (Story Creator, Social Media Post Generator)
- Simple UI for tool selection and content generation
- Deploy to Netlify for testing
Phase 2: Enhancement
- Add more tools
- Template/prompt library
- History/saved generations
- Export options (copy, download)
Phase 3: Production Ready
- Authentication (NextAuth/Clerk)
- Rate limiting
- Queue system for heavy operations
- Usage analytics
- Database integration
๐๏ธ Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Frontend โ
โ Next.js App Router + React + TailwindCSS + shadcn/ui โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ API Layer โ
โ Next.js API Routes (Route Handlers) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Services Layer โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โ OpenRouter โ โ Tools โ โ Prompts โ โ
โ โ Service โ โ Registry โ โ Manager โ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Configuration โ
โ Tools Config โ Models Config โ System Instructions โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Project Structure
ai-tools/
โโโ src/
โ โโโ app/ # Next.js App Router
โ โ โโโ layout.tsx
โ โ โโโ page.tsx # Dashboard/Home
โ โ โโโ tools/
โ โ โ โโโ page.tsx # Tools listing
โ โ โ โโโ [toolId]/
โ โ โ โโโ page.tsx # Individual tool page
โ โ โโโ api/
โ โ โโโ generate/
โ โ โ โโโ route.ts # Main generation endpoint
โ โ โโโ tools/
โ โ โโโ route.ts # Get available tools
โ โ
โ โโโ components/
โ โ โโโ ui/ # shadcn/ui components
โ โ โโโ layout/
โ โ โ โโโ header.tsx
โ โ โ โโโ sidebar.tsx
โ โ โ โโโ footer.tsx
โ โ โโโ tools/
โ โ โ โโโ tool-card.tsx
โ โ โ โโโ tool-form.tsx
โ โ โ โโโ tool-output.tsx
โ โ โโโ common/
โ โ โโโ loading.tsx
โ โ โโโ error-boundary.tsx
โ โ
โ โโโ lib/
โ โ โโโ openrouter/
โ โ โ โโโ client.ts # OpenRouter API client
โ โ โ โโโ models.ts # Available models config
โ โ โ โโโ types.ts
โ โ โโโ tools/
โ โ โ โโโ registry.ts # Tool registration system
โ โ โ โโโ types.ts # Tool type definitions
โ โ โ โโโ executor.ts # Tool execution logic
โ โ โโโ utils/
โ โ โโโ cn.ts # classnames utility
โ โ โโโ format.ts
โ โ
โ โโโ config/
โ โ โโโ tools/ # Tool configurations
โ โ โ โโโ index.ts # Export all tools
โ โ โ โโโ story-creator.ts
โ โ โ โโโ social-media-post.ts
โ โ โ โโโ image-prompt.ts
โ โ โ โโโ ...
โ โ โโโ models.ts # OpenRouter models config
โ โ โโโ site.ts # Site configuration
โ โ
โ โโโ prompts/ # System instructions
โ โ โโโ story/
โ โ โ โโโ reels.md
โ โ โ โโโ short-form.md
โ โ โ โโโ long-form.md
โ โ โโโ social/
โ โ โ โโโ vk.md
โ โ โ โโโ dzen.md
โ โ โ โโโ facebook.md
โ โ โ โโโ general.md
โ โ โโโ image/
โ โ โโโ midjourney-style.md
โ โ โโโ dalle-style.md
โ โ
โ โโโ hooks/
โ โ โโโ use-generation.ts # Generation hook
โ โ โโโ use-tools.ts # Tools fetching
โ โ โโโ use-copy.ts # Copy to clipboard
โ โ
โ โโโ types/
โ โโโ tool.ts
โ โโโ generation.ts
โ โโโ api.ts
โ
โโโ public/
โ โโโ icons/ # Tool icons
โ
โโโ .env.local # Environment variables
โโโ .env.example
โโโ next.config.ts
โโโ tailwind.config.ts
โโโ tsconfig.json
โโโ package.json
โโโ README.md
๐ ๏ธ Tech Stack
| Category | Technology |
|---|---|
| Framework | Next.js 14+ (App Router) |
| Language | TypeScript |
| Styling | TailwindCSS + shadcn/ui |
| AI API | OpenRouter |
| State | React hooks + Context (simple) |
| Deployment | Netlify |
| Package Manager | pnpm |
๐ง Tool Configuration System
Each tool is defined by a configuration object:
// src/lib/tools/types.ts
interface ToolConfig {
id: string;
name: string;
description: string;
icon: string;
category: ToolCategory;
// Model configuration
defaultModel: string;
allowedModels?: string[];
// Input configuration
inputs: ToolInput[];
// Variants (different system instructions)
variants: ToolVariant[];
// Generation settings
settings: {
maxTokens: number;
temperature: number;
topP?: number;
};
}
interface ToolVariant {
id: string;
name: string;
description: string;
systemPromptPath: string; // Path to .md file
language?: string;
}
interface ToolInput {
id: string;
label: string;
type: 'text' | 'textarea' | 'select' | 'number';
placeholder?: string;
required: boolean;
options?: { value: string; label: string }[];
}
Example Tool Configuration
// src/config/tools/story-creator.ts
export const storyCreatorTool: ToolConfig = {
id: 'story-creator',
name: 'Story Creator',
description: 'Generate engaging stories for social media, reels, or general content',
icon: 'book-open',
category: 'content',
defaultModel: 'anthropic/claude-3-haiku',
allowedModels: [
'anthropic/claude-3-haiku',
'anthropic/claude-3-sonnet',
'openai/gpt-4o-mini',
'google/gemini-flash-1.5',
],
inputs: [
{
id: 'topic',
label: 'Topic or Theme',
type: 'textarea',
placeholder: 'What should the story be about?',
required: true,
},
{
id: 'tone',
label: 'Tone',
type: 'select',
required: true,
options: [
{ value: 'engaging', label: 'Engaging' },
{ value: 'emotional', label: 'Emotional' },
{ value: 'funny', label: 'Funny' },
{ value: 'inspiring', label: 'Inspiring' },
],
},
{
id: 'length',
label: 'Length',
type: 'select',
required: true,
options: [
{ value: 'short', label: 'Short (30-60 sec read)' },
{ value: 'medium', label: 'Medium (1-2 min read)' },
{ value: 'long', label: 'Long (3-5 min read)' },
],
},
],
variants: [
{
id: 'reels',
name: 'Instagram Reels',
description: 'Hook-driven stories for short video content',
systemPromptPath: 'story/reels.md',
},
{
id: 'tiktok',
name: 'TikTok Story',
description: 'Viral-style storytelling for TikTok',
systemPromptPath: 'story/tiktok.md',
},
{
id: 'general',
name: 'General Story',
description: 'Classic storytelling format',
systemPromptPath: 'story/general.md',
},
{
id: 'russian',
name: 'Russian Story',
description: 'Stories optimized for Russian audience',
systemPromptPath: 'story/russian.md',
language: 'ru',
},
],
settings: {
maxTokens: 1500,
temperature: 0.8,
},
};
๐ฑ Initial Tools (MVP)
1. Story Creator
- Purpose: Generate engaging stories
- Variants: Reels, TikTok, General, Language-specific
- Inputs: Topic, tone, length, target audience
2. Social Media Post Generator
- Purpose: Create platform-specific posts
- Variants: VK, Dzen, Facebook, Instagram, Twitter/X
- Inputs: Topic, platform, hashtag count, CTA type
3. Image Prompt Generator
- Purpose: Create prompts for AI image generators
- Variants: Midjourney style, DALL-E style, Stable Diffusion
- Inputs: Subject, style, mood, aspect ratio
4. Content Repurposer (Future)
- Purpose: Convert content between formats
- Variants: Blog โ Thread, Video โ Post, etc.
๐ OpenRouter Integration
// src/lib/openrouter/client.ts
const OPENROUTER_API_URL = 'https://openrouter.ai/api/v1/chat/completions';
export const createCompletion = async (params: {
model: string;
systemPrompt: string;
userMessage: string;
maxTokens: number;
temperature: number;
}): Promise<string> => {
const response = await fetch(OPENROUTER_API_URL, {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.OPENROUTER_API_KEY}`,
'HTTP-Referer': process.env.NEXT_PUBLIC_SITE_URL,
'X-Title': 'AI Tools',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: params.model,
messages: [
{ role: 'system', content: params.systemPrompt },
{ role: 'user', content: params.userMessage },
],
max_tokens: params.maxTokens,
temperature: params.temperature,
}),
});
if (!response.ok) {
throw new Error(`OpenRouter API error: ${response.status}`);
}
const data = await response.json();
return data.choices[0].message.content;
};
๐ API Routes
POST /api/generate
Main generation endpoint
// Request
{
toolId: string;
variantId: string;
modelId?: string; // Optional, uses default if not provided
inputs: Record<string, string>;
}
// Response
{
success: boolean;
content: string;
model: string;
tokensUsed: number;
}
GET /api/tools
Get all available tools
// Response
{
tools: ToolConfig[];
}
๐จ UI/UX Design
Pages
-
Home/Dashboard
- Quick access to recent tools
- Tool categories grid
- Quick generation shortcuts
-
Tools List
- Categorized tool cards
- Search/filter functionality
-
Tool Page
- Input form on left
- Output/preview on right
- Variant selector
- Model selector (collapsible/advanced)
- Copy/export buttons
Design Principles
- Clean, minimal interface
- Dark mode by default (with toggle)
- Responsive design
- Keyboard shortcuts for power users
๐ Deployment (Netlify)
Environment Variables
OPENROUTER_API_KEY=sk-or-...
NEXT_PUBLIC_SITE_URL=https://your-app.netlify.app
Build Settings
# netlify.toml
[build]
command = "pnpm build"
publish = ".next"
[[plugins]]
package = "@netlify/plugin-nextjs"
๐ Development Phases
Week 1: Foundation
- Create project plan
- Initialize Next.js project with TypeScript
- Set up TailwindCSS + shadcn/ui
- Create project structure
- Implement OpenRouter client
Week 2: Core Features
- Build tool configuration system
- Create tool registry
- Implement first tool (Story Creator)
- Build basic UI components
Week 3: Polish & Deploy
- Add 2-3 more tools
- Build responsive layouts
- Add loading states & error handling
- Deploy to Netlify
- Test & iterate
๐ฎ Future Enhancements (Phase 2-3)
Authentication
- NextAuth.js or Clerk
- Social login (Google, GitHub)
- Usage tracking per user
Database
- Supabase or PlanetScale
- Save generation history
- User preferences
- Prompt templates
Advanced Features
- Streaming responses
- Queue system (Upstash/BullMQ)
- Rate limiting
- API key management for multi-user
- Custom prompt editor
- A/B testing for prompts
Analytics
- Usage metrics
- Popular tools tracking
- Model performance comparison
๐ Notes
- Keep initial implementation simple - no over-engineering
- System prompts stored as markdown for easy editing
- Use streaming for better UX when needed
- All tools should work offline (with mock data) for development
๐ Resources
Related Documents
๐ GitHub MCP Server - Feature Showcase
> **๐ก AI Optimization Tip**: For AI agents, use `response_format: "compact"` to save 80-97% tokens. Examples below show `markdown` for human readability, but `compact` is recommended for programmatic use. See [Token Efficiency Guide](TOKEN_EFFICIENCY.md) for details.
OpenCode Agents
<a href="README.md">๐ท๐บ ะ ัััะบะธะน</a> ยท <a href="README.en.md">๐ฌ๐ง English</a> ยท <a href="README.zh.md">๐จ๐ณ ไธญๆ</a>
msitarzewski/agency-agents
date: 2026-03-15T13:27:54+08:00
SunCube AI - Comprehensive Documentation
- [Overview](#overview)