template-based-generation-template

djankies 的头像作者 djankies

[REPLACE] 从模板生成结构化内容。在[REPLACE替换为具体触发条件]时使用。

📖 中文导读:[REPLACE] 从模板生成结构化内容。在[REPLACE替换为具体触发条件]时使用。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。

name: template-based-generation-template description: [REPLACE] Generate structured content from templates. Use when [REPLACE with specific triggers]. allowed-tools: Write, Read, TodoWrite

Template-Based Generation Template

Purpose

This template demonstrates structured content generation from templates with placeholder filling and validation.

Use this template when:

  • Generating configuration files
  • Creating boilerplate code
  • Producing structured documents
  • Output follows predictable patterns

Workflow

Phase 1: Gather Requirements

1. Identify required configuration values 2. Collect user inputs 3. Determine target environment 4. Check for optional features 5. Validate input completeness

Phase 2: Select Template

Based on requirements: - Production: @references/production-config-template.md - Development: @references/dev-config-template.md - Testing: @references/test-config-template.md

Phase 3: Fill Template

1. Replace required placeholders 2. Apply conditional sections 3. Insert computed values 4. Format output appropriately 5. Add generation metadata

Phase 4: Validate Output

1. Check all placeholders replaced 2. Verify syntax correctness 3. Validate security settings 4. Confirm required fields present 5. Test configuration loading 6. List scripts that should be run to validate the output of this skill

Template Selection Logic

Production Configuration:

  • High security requirements
  • Performance optimization
  • Monitoring and logging
  • Secrets management

Development Configuration:

  • Debug mode enabled
  • Verbose logging
  • Local service URLs
  • Mock credentials

Testing Configuration:

  • Test database
  • Reduced timeouts
  • Isolated environment
  • Deterministic behavior

Progressive Disclosure

Core workflow (this file):

  • Requirement gathering
  • Template selection logic
  • Validation rules

Templates (references/):

  • @references/production-config-template.md - Production config example
  • Domain-specific templates loaded when needed

Example Usage

<gather-requirements>
Environment: production
Database: PostgreSQL
Features: [caching, monitoring, rate-limiting]
Region: us-east-1
</gather-requirements>

<select-template>
Selected: Production configuration template
Security level: High
Monitoring: Enabled
</select-template>

<fill-template>
Generating config/production.json:
- Database URL: [REDACTED - from environment]
- Redis URL: [REDACTED - from environment]
- Rate limit: 1000 req/min
- Monitoring: DataDog integration
- Log level: info
</fill-template>

<validate-output>
✓ No plaintext secrets
✓ All required fields present
✓ Valid JSON syntax
✓ Security headers configured
✓ CORS settings appropriate
Configuration ready!
</validate-output>

See Also

  • @references/production-config-template.md - Complete config generation example