name: base-template-generator
description: Generate clean, production-ready boilerplate templates for Node.js, Python,
Go, React, Vue, and other frameworks. Use when starting new projects or creating
consistent foundational code structures. Provides modern best practices with minimal
dependencies. Gold tier with automated scripts, validation tools, and Docker/CI/CD
support.
tier: gold
version: 2.0.0
category: foundry
tags:
- foundry
- creation
- meta-tools
author: ruv
<!-- SKILL SOP IMPROVEMENT v1.0 -->
Skill Execution Criteria
When to Use This Skill
- Starting new projects requiring solid foundational structure
- Creating consistent boilerplate across team projects
- Scaffolding microservices or API backends
- Setting up frontend applications with modern tooling
- Need Docker and CI/CD ready out-of-box
- Require automated validation and quality checks
When NOT to Use This Skill
- For existing projects (use refactoring skills instead)
- When custom architecture is required (templates enforce patterns)
- For prototypes that won't reach production
- When dependencies must be minimized beyond template defaults
Success Criteria
- primary_outcome: "Production-ready project template with modern tooling, automated validation, Docker support, and CI/CD integration"
- quality_threshold: 0.88
- verification_method: "Template generates successfully, passes validation scripts, builds without errors, includes working tests and CI/CD pipeline"
Edge Cases
- case: "Template type not supported (not in 6 core types)"
handling: "Identify closest template match, customize post-generation, or request new template type"
- case: "Conflicting dependency requirements"
handling: "Document conflicts, provide manual override instructions, suggest alternative template"
- case: "Custom project structure needed"
handling: "Use base template as starting point, document customizations, consider creating new template variant"
Skill Guardrails
NEVER:
- "Generate templates with excessive dependencies (minimal deps philosophy)"
- "Skip validation scripts (automated quality checks required)"
- "Omit Docker/CI/CD support (production-readiness requirement)"
- "Use outdated patterns (modern best practices enforced)"
ALWAYS:
- "Include automated validation tools and quality checks"
- "Provide Docker support and CI/CD integration out-of-box"
- "Use modern ES modules, async/await, type hints per language"
- "Follow standard layout (cmd/internal/pkg for Go, src/tests for others)"
- "Include comprehensive README with setup and usage instructions"
Evidence-Based Execution
self_consistency: "After template generation, validate structure matches specification, all scripts execute successfully, and quality checks pass"
program_of_thought: "Decompose generation into: 1) Select template type, 2) Generate base structure, 3) Configure tooling, 4) Add validation, 5) Setup Docker/CI/CD, 6) Validate output"
plan_and_solve: "Plan: Identify project requirements + select template -> Execute: Generate + configure + validate -> Verify: Build success + tests pass + CI/CD ready"
<!-- END SKILL SOP IMPROVEMENT -->
Base Template Generator (Gold Tier)
Generate clean, production-ready foundational code templates for modern development frameworks with automated validation, Docker support, and CI/CD integration.
When to Use This Skill
Use this skill when:
- Starting new projects that need solid foundational structure
- Creating consistent boilerplate across team projects
- Scaffolding microservices or API backends
- Setting up frontend applications with modern tooling
- Need Docker and CI/CD ready out-of-box
- Require automated validation and quality checks
Template Types (6 Supported)
Backend Templates
- Node.js with Express - ES modules, modern async/await, minimal deps
- Python with FastAPI - Type hints, async, Pydantic validation
- Go with standard library - Standard layout (cmd/internal/pkg), minimal deps
Frontend Templates
- React 18 with Vite - TypeScript, fast HMR, modern tooling
- Vue 3 Composition API - TypeScript, Pinia, modern patterns
- Vanilla TypeScript - Clean setup with Vite
Available Tools
1. Template Generator (generate_boilerplate.py)
python resources/scripts/generate_boilerplate.py --type node --name my-api
python resources/scripts/generate_boilerplate.py --type python --name ml-service
python resources/scripts/generate_boilerplate.py --type go --name backend-svc
Features:
- 6 project types with modern versions
- Minimal dependencies (5-10 production deps)
- Security best practices built-in
- Clean directory structure
- .gitignore, README, .editorconfig included
2. Structure Validator (validate_structure.sh)
bash resources/scripts/validate_structure.sh ./my-project
Checks (30+ validation points):
- Required files and directories
- Security (no .env files, secrets)
- Documentation quality (README sections)
- Dependency count and versions
- Type-specific validation
Output:
- ✓ Passed: Count of successful checks
- ⚠ Warnings: Non-critical issues
- ✗ Failed: Blocking errors
3. Interactive Initializer (init_project.py)
python resources/scripts/init_project.py
Interactive Setup:
- Project name and type
- License selection (MIT, Apache-2.0, GPL-3.0, BSD-3-Clause)
- Optional features:
- Docker support (Dockerfile, docker-compose.yml)
- CI/CD (GitHub Actions workflows)
- Testing framework setup
- Linting/formatting tools
- Git repository initialization
- Initial commit creation
Process
-
Choose Generation Method
- Quick: Use generate_boilerplate.py for basic template
- Interactive: Use init_project.py for full-featured setup
-
Generate Foundational Structure
- Clean directory layout following best practices
- Package configuration (package.json, pyproject.toml, go.mod)
- .gitignore, .editorconfig, .env.example
- README with comprehensive documentation
-
Add Essential Tooling
- Linting (ESLint, Ruff, golangci-lint)
- Formatting (Prettier, Black, gofmt)
- Testing framework (Jest/Pytest/Go test)
- Build/dev scripts
-
Include Minimal Dependencies
- Core framework only (Express, FastAPI, gorilla/mux)
- Essential dev tools
- No bloat from unnecessary packages
-
Optional Features
- Docker multi-stage builds
- GitHub Actions CI/CD workflows
- Comprehensive testing setup
- Security middleware
-
Validate Quality
- Run structure validation
- Check security practices
- Verify documentation
- Test build and runtime
Template Resources
Configuration Templates
- project-structure.yaml - Standard directory structures for all types
- config-template.json - JSON Schema for template configuration
- readme-template.md - Handlebars-style README template
- gitignore-template.txt - Comprehensive .gitignore for all languages
Testing
Test Suites Included
- test-1-basic-template.md - Basic generation for all 6 types
- test-2-complex-project.md - Full-featured with Docker/CI/CD
- test-3-validation.md - Quality assurance and validation
Running Tests
# Basic template tests
cd tests && bash test-1-basic-template.md
# Complex project tests
bash test-2-complex-project.md
# Validation tests
bash test-3-validation.md
Quality Standards
Code Quality
- Modern language/framework versions (Node 18+, Python 3.11+, Go 1.21+)
- Security best practices (no secrets, proper .gitignore)
- No deprecated dependencies
- Clear, commented code
- Production-ready configuration
Dependencies
- Node.js: ≤ 5 production deps
- Python: ≤ 10 production deps
- Go: ≤ 5 direct deps
Documentation
- README: ≥ 30 lines with clear sections
- Quick start instructions
- Project structure visualization
- Development commands
- Deployment checklist
Validation
- 30+ checks per project type
- Security scanning (secrets, credentials)
- Structure validation
- Dependency analysis
- Runtime testing
Performance Benchmarks
Generation Speed
- Basic template: < 5 seconds
- Full-featured: < 10 seconds
- Validation: < 1 second per project
Docker Build Times
- Node.js: < 2 minutes
- Python: < 3 minutes
- Go: < 1 minute
Image Sizes
- Node.js: < 100MB
- Python: < 150MB
- Go: < 20MB (Alpine)
Example Usage
Quick Start (Basic Template)
# Generate template
python resources/scripts/generate_boilerplate.py --type node --name my-api
# Validate
bash resources/scripts/validate_structure.sh my-api
# Start development
cd my-api && npm install && npm run dev
Full Setup (Interactive)
# Interactive setup with all features
python resources/scripts/init_project.py
# Follow prompts for Docker, CI/CD, Testing, Linting
# Git repository automatically initialized
# Ready for development immediately
Validation Only
# Validate existing project
bash resources/scripts/validate_structure.sh /path/to/project
# View security checks
bash resources/scripts/validate_structure.sh . 2>&1 | grep "Security"
Integration with SPARC Three-Loop System
Loop 1: Research-Driven Planning
- Generate clean foundations for prototyping
- Validate structure before implementation
Loop 2: Parallel Swarm Implementation
- Agents use templates as starting points
- Consistent structure across swarm
Loop 3: CI/CD Intelligent Recovery
- Generated workflows integrate with Loop 3
- Automated testing and validation
Files Included (13 Total)
Scripts (3)
- generate_boilerplate.py - Core generation engine
- validate_structure.sh - Structure validation
- init_project.py - Interactive setup
Templates (4)
- project-structure.yaml - Directory structures
- config-template.json - Configuration schema
- readme-template.md - README template
- gitignore-template.txt - Comprehensive ignores
Tests (3)
- test-1-basic-template.md - Basic generation
- test-2-complex-project.md - Complex features
- test-3-validation.md - Quality assurance
Documentation (3)
- skill.md - This file
- README.md - Overview
- ENHANCEMENT-SUMMARY.md - Gold tier details
Tier Status
Current Tier: Gold
Files: 13 (exceeds 12-file target)
Scripts: 3 production-ready
Templates: 4 comprehensive
Tests: 3 extensive suites
Validation: 30+ checks per type
Status: ✅ Production Ready