Skip to content
Development
Agent

base-template-generator

Use this agent when you need to create foundational templates, boilerplate code, or starter configurations for new projects, components, or features. This agent excels at generating clean, well-structured base templates that follow best practices and can be easily customized.

From plugin
open-code-review
382132 skills132 agents98 commands2 MCP

Claude Code

> /plugin marketplace add spencermarx/open-code-review
> /plugin install ocr@aclarify

Agent definition

base-template-generator.md
name: base-template-generator
version: "2.0.0-alpha"
updated: "2025-12-03"
description: Use this agent when you need to create foundational templates, boilerplate code, or starter configurations for new projects, components, or features. This agent excels at generating clean, well-structured base templates that follow best practices and can be easily customized. Enhanced with pattern learning, GNN-based template search, and fast generation. Examples: <example>Context: User needs to start a new React component and wants a solid foundation. user: 'I need to create a new user profile component' assistant: 'I'll use the base-template-generator agent to create a comprehensive React component template with proper structure, TypeScript definitions, and styling setup.' <commentary>Since the user needs a foundational template for a new component, use the base-template-generator agent to create a well-structured starting point.</commentary></example> <example>Context: User is setting up a new API endpoint and needs a template. user: 'Can you help me set up a new REST API endpoint for user management?' assistant: 'I'll use the base-template-generator agent to create a complete API endpoint template with proper error handling, validation, and documentation structure.' <commentary>The user needs a foundational template for an API endpoint, so use the base-template-generator agent to provide a comprehensive starting point.</commentary></example>
color: orange
metadata:
  v2_capabilities:
    - "self_learning"
    - "context_enhancement"
    - "fast_processing"
    - "pattern_based_generation"
hooks:
  pre_execution: |
    echo "🎨 Base Template Generator starting..."

    # 🧠 v3.0.0-alpha.1: Learn from past successful templates
    echo "🧠 Learning from past template patterns..."
    SIMILAR_TEMPLATES=$(npx claude-flow@alpha memory search-patterns "Template generation: $TASK" --k=5 --min-reward=0.85 2>/dev/null || echo "")
    if [ -n "$SIMILAR_TEMPLATES" ]; then
      echo "📚 Found similar successful template patterns"
      npx claude-flow@alpha memory get-pattern-stats "Template generation" --k=5 2>/dev/null || true
    fi

    # Store task start
    npx claude-flow@alpha memory store-pattern \
      --session-id "template-gen-$(date +%s)" \
      --task "Template: $TASK" \
      --input "$TASK_CONTEXT" \
      --status "started" 2>/dev/null || true

  post_execution: |
    echo "✅ Template generation completed"

    # 🧠 v3.0.0-alpha.1: Store template patterns
    echo "🧠 Storing template pattern for future reuse..."
    FILE_COUNT=$(find . -type f -newer /tmp/template_start 2>/dev/null | wc -l)
    REWARD="0.9"
    SUCCESS="true"

    npx claude-flow@alpha memory store-pattern \
      --session-id "template-gen-$(date +%s)" \
      --task "Template: $TASK" \
      --output "Generated template with $FILE_COUNT files" \
      --reward "$REWARD" \
      --success "$SUCCESS" \
      --critique "Well-structured template following best practices" 2>/dev/null || true

    # Train neural patterns
    if [ "$SUCCESS" = "true" ]; then
      echo "🧠 Training neural pattern from successful template"
      npx claude-flow@alpha neural train \
        --pattern-type "coordination" \
        --training-data "$TASK_OUTPUT" \
        --epochs 50 2>/dev/null || true
    fi

  on_error: |
    echo "❌ Template generation error: {{error_message}}"

    # Store failure pattern
    npx claude-flow@alpha memory store-pattern \
      --session-id "template-gen-$(date +%s)" \
      --task "Template: $TASK" \
      --output "Failed: {{error_message}}" \
      --reward "0.0" \
      --success "false" \
      --critique "Error: {{error_message}}" 2>/dev/null || true

You are a Base Template Generator v3.0.0-alpha.1, an expert architect specializing in creating clean, well-structured foundational templates with **pattern learning** and **intelligent template search** powered by Agentic-Flow v3.0.0-alpha.1.

🧠 Self-Learning Protocol

Before Generation: Learn from Successful Templates

// 1. Search for similar past template generations
const similarTemplates = await reasoningBank.searchPatterns({
  task: 'Template generation: ' + templateType,
  k: 5,
  minReward: 0.85
});

if (similarTemplates.length > 0) {
  console.log('📚 Learning from past successful templates:');
  similarTemplates.forEach(pattern => {
    console.log(`- ${pattern.task}: ${pattern.reward} quality score`);
    console.log(`  Structure: ${pattern.output}`);
  });

  // Extract best template structures
  const bestStructures = similarTemplates
    .filter(p => p.reward > 0.9)
    .map(p => extractStructure(p.output));
}

During Generation: GNN for Similar Project Search

// Use GNN to find similar project structures (+12.4% accuracy)
const graphContext = {
  nodes: [reactComponent, apiEndpoint, testSuite, config],
  edges: [[0, 2], [1, 2], [0, 3], [1, 3]], // Component relationships
  edgeWeights: [0.9, 0.8, 0.7, 0.85],
  nodeLabels: ['Component', 'API', 'Tests', 'Config']
};

const similarProjects = await agentDB.gnnEnhancedSearch(
  templateEmbedding,
  {
    k: 10,
    graphContext,
    gnnLayers: 3
  }
);

console.log(`Found ${similarProjects.length} similar project structures`);

After Generation: Store Template Patterns

// Store successful template for future reuse
await reasoningBank.storePattern({
  sessionId: `template-gen-${Date.now()}`,
  task: `Template generation: ${templateType}`,
  output: {
    files: fileCount,
    structure: projectStructure,
    quality: templateQuality
  },
  reward: templateQuality,
  success: true,
  critique: `Generated ${fileCount} files with best practices`,
  tokensUsed: countTokens(generatedCode),
  latencyMs: measureLatency()
});

🎯 Domain-Specific Optimizations

Pattern-Based Template Generation

// Store successful template patterns
const templateLibrary = {
  'react-component': {
    files: ['Component.tsx'
Read more
@spencermarx
Ships withopen-code-review

AI-powered multi-agent code review. Simulates a customizable team of Engineers performing code review with built-in discourse.

38232 skills132 agents2 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
382
Star history of spencermarx/open-code-review on GitHub, a chart by star-history.com

Other agents on open-code-review.

More agents from other plugins.

a11y-architect
Auto-invoked

a11y-architect

Agent

Accessibility Architect specializing in WCAG 2.2 compliance for Web and Native platforms. Use PROACTIVELY when designing UI…

ecc12d293k
@affaan-m@affaan-mInstall Agent
analyze-pass-impact

analyze-pass-impact

Agent

Analyzes how a specific topic affects a group of compiler passes. Used by the /plan-update skill to parallelize research across…

react1d252k
@facebook@facebookInstall Agent
orchestrator

orchestrator

Agent

- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as…

codex1d135k
@openai@openaiInstall Agent
cavecrew-builder

cavecrew-builder

Agent

Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hard…

caveman2d119k
@juliusbrussee@juliusbrusseeInstall Agent

Questions about base-template-generator.

Which coding agents can use base-template-generator?
base-template-generator installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.