Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计提醒

universal-templating通用模板

Agent Skill

universal-templating 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

399

周安装

16

GitHub Stars

11

下载量

129
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:universal-templating(通用模板)
来源仓库:https://github.com/lobbi-docs/claude
仓库路径:skills/universal-templating
安装命令:
npx skills add https://github.com/lobbi-docs/claude --skill universal-templating
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/lobbi-docs/claude --skill universal-templating

简介

通用模板技能用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适用于 Codex、Claude、Cursor、Gemini CLI 等宿主环境中的代码整理场景。
  • 通过 npx skills add 命令从指定仓库安装并使用该技能。
  • 需确认权限范围和维护状态,注意可能触发联网或文件读写操作。
  • universal-templating 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Universal Templating Skill

Comprehensive guide to template format selection, design patterns, generation workflows, and best practices across Handlebars, Cookiecutter, Copier, Maven, and Harness templates.

Template Format Matrix

Handlebars

Use Cases:

  • Simple variable substitution
  • Email templates
  • Document generation
  • Configuration files
  • Quick string templating

Syntax:

Hello {{name}},
{{#if premium}}Welcome to premium!{{/if}}
{{#each items}}- {{this}}{{/each}}

Strengths:

  • Minimal learning curve
  • Fast execution
  • Great for config files
  • Small file size
  • No external dependencies

Weaknesses:

  • Limited logic capabilities
  • No native loops/conditionals
  • Requires helpers for complex operations

Best For: Configuration file templating, simple document generation


Cookiecutter

Use Cases:

  • Interactive project scaffolding
  • Multi-step wizard templates
  • Python package templates
  • Post-generation hooks

Syntax:

{
  "project_name": "{{ cookiecutter.project_name }}",
  "author": "{{ cookiecutter.author_name }}"
}

Strengths:

  • Interactive CLI prompts
  • Python ecosystem integration
  • Post-generation hooks
  • Conditional rendering
  • JSON-based config

Weaknesses:

  • Python dependency required
  • Jinja2 templates (verbose)
  • Less flexible validation
  • Community templates vary in quality

Best For: Python projects, quick prototypes, community templates


Copier

Use Cases:

  • Modern project scaffolding
  • Template versioning and updates
  • Multi-template composition
  • Complex validation rules

Syntax:

_templates_suffix: .jinja
_copy_without_render:
  - "*.png"
  - "*.jpg"

project_name:
  type: str
  help: What is your project name?
  default: my_project

Strengths:

  • Powerful Jinja2 templating
  • Template versioning
  • Update existing projects
  • Composite templates
  • Advanced validation
  • Excellent documentation

Weaknesses:

  • Python dependency
  • Steeper learning curve
  • Larger footprint
  • Development active (API changes possible)

Best For: Enterprise templates, versioned scaffolding, complex projects


Maven

Use Cases:

  • Java/JVM project archetypes
  • Enterprise Java scaffolding
  • Build system integration
  • Dependency management

Syntax:

<archetype>
  <groupId>org.apache.maven.archetypes</groupId>
  <artifactId>maven-archetype-quickstart</artifactId>
</archetype>

Strengths:

  • Native Maven integration
  • Build tool awareness
  • Dependency management
  • Enterprise adoption
  • IDEs have built-in support

Weaknesses:

  • Java/JVM only
  • XML-heavy
  • Complex archetype internals
  • Verbose setup

Best For: Java/JVM projects, Maven-based builds


Harness Templates

Use Cases:

  • CI/CD pipeline steps
  • Reusable stage definitions
  • Pipeline patterns
  • Deployment strategies

Syntax:

template:
  name: Deploy Service
  type: StepGroup
  spec:
    steps:
      - step:
          name: Deploy K8s
          identifier: deploy_k8s
          type: K8sDeploy
          spec:
            service: <+input>

Strengths:

  • Native Harness integration
  • Expression language support
  • Runtime inputs
  • Pipeline-aware
  • Built-in approval flows

Weaknesses:

  • Harness-specific only
  • YAML complexity
  • Requires Harness setup
  • Limited reusability outside Harness

Best For: Harness pipelines, deployment templates


Format Selection Decision Tree

START: Need to generate what?
│
├─ Configuration files
│  ├─ Simple substitution → Handlebars
│  └─ Complex validation → Copier
│
├─ Project scaffold
│  ├─ Python project → Cookiecutter
│  ├─ Enterprise/versioned → Copier
│  └─ Java/JVM → Maven
│
├─ CI/CD pipeline
│  ├─ Harness platform → Harness Templates
│  └─ Other CI → Handlebars + custom
│
├─ Document/email
│  └─ Handlebars
│
└─ Reusable components
   ├─ Code snippets → Handlebars
   └─ Full modules → Copier

Generation Workflow Steps

Step 1: Template Planning

Inputs:

  • Target audience (users, developers, automation)
  • Use cases and scenarios
  • Complexity level (simple, moderate, advanced)
  • Maintenance burden tolerance
  • Integration requirements

Deliverables:

  • Template specification document
  • Format selection justification
  • Variable naming convention document
  • Example instantiation

Questions to Answer:

  1. What will be generated?
  2. Who uses it (users, scripts, tools)?
  3. How often will it change?
  4. Will it need versioning?
  5. What validation is needed?

Step 2: Variable Definition

Essential Variables:

project_name         - Primary identifier
author_name         - Creator/maintainer
organization        - Company/org name
description         - Brief description
license             - License type (MIT, Apache, etc.)
target_framework    - Framework/language version

Optional Variables (by use case):

// Python projects
python_version      - Target Python version
package_name        - PyPI package name
django_version      - Django version (if applicable)

// Java projects
java_version        - JDK version
groupId            - Maven group ID
artifactId         - Maven artifact ID

// Cloud projects
aws_region         - AWS region
kubernetes_cluster - K8s cluster name
docker_registry    - Container registry

Step 3: Variable Naming Conventions

Naming Rules:

  1. Format: snake_case (all formats support this)
  2. Prefixes:

- generated_* - Files/content created by template - input_* - User input required - computed_* - Derived from other variables - optional_* - Optional user input

  1. Examples: ✓ project_name ✓ author_email ✓ generated_version ✓ target_framework ✗ ProjectName (avoid PascalCase) ✗ PROJECT_NAME (avoid SCREAMING_SNAKE_CASE)

Step 4: Content Structure Design

Standard Project Structure:

{project_name}/
├── README.md              # Template instructions
├── {project_name}/        # Main package/app
│   ├── __init__.py        # (if applicable)
│   ├── main.py
│   └── config.py
├── tests/                 # Test directory
│   ├── __init__.py
│   └── test_main.py
├── docs/                  # Documentation
│   └── API.md
├── .gitignore
├── LICENSE
├── requirements.txt       # (Python)
├── setup.py              # (Python)
├── package.json          # (Node.js)
└── {{cookiecutter.var}}/ # Template variables

Step 5: Conditional Rendering

When to Use:

  • Optional features
  • Different project types
  • Target-specific configurations
  • License-based files

Handlebars Example:

{{#if include_docker}}
FROM python:3.11
COPY . /app
{{/if}}

Cookiecutter/Copier Example:

{%- if use_docker %}
# Docker configuration
{%- endif %}

Step 6: Validation & Constraints

Input Validation:

  • Email format checking
  • Version number validation
  • Project name uniqueness checks
  • Path validation

Copier Example:

project_name:
  type: str
  help: Project name (lowercase, alphanumeric + underscore)
  regex: "^[a-z_][a-z0-9_]*$"

python_version:
  type: str
  default: "3.11"
  help: Python version (3.9, 3.10, 3.11, 3.12)
  choices:
    - "3.9"
    - "3.10"
    - "3.11"
    - "3.12"

Step 7: Post-Generation Hooks

Cookiecutter/Copier Hooks:

# hooks/post_gen_project.py
import os
from pathlib import Path

# Initialize git repository
os.system("git init")

# Create virtual environment
os.system("python -m venv venv")

# Install dependencies
os.system("pip install -r requirements.txt")

# Generate API docs
os.system("python generate_docs.py")

Step 8: Documentation

Required Documentation:

  1. README.md - How to use template
  2. VARIABLES.md - All available variables
  3. EXAMPLES.md - Example instantiations
  4. TROUBLESHOOTING.md - Common issues

Best Practices for Template Design

1. Variable Defaults

Good Defaults:

# Clear, sensible defaults
author_name: "Your Name"
license: "MIT"
python_version: "3.11"  # Latest stable
include_docker: false   # Opt-in for complexity
include_tests: true     # Always good to start with tests

Bad Defaults:

# Unclear or empty
author_name: ""
unknown_var: "???"
version: "1.0.0"  # Should be context-aware

2. DRY Principle (Don't Repeat Yourself)

Template Variables Once:

Define: project_name = "my_project"
Use in:
  - Directory name
  - README title
  - Setup.py name
  - Docker image name

3. File Organization

Group Related Files:

template/
├── [project_name]/        # Project source (stays as-is)
├── [project_name]_docs/   # Docs structure
├── [project_name]_config/ # Config templates
└── tests/                 # Test templates

4. Template Readability

Use Clear Comments:

{# This file is generated from {{template_name}} #}
{# Last updated: {{generated_date}} #}
{# For questions, see: {{docs_url}} #}

5. Version Management

Template Versioning:

# In template metadata
version: "1.0.0"
harness_compatibility: "1.4+"
minimum_python: "3.9"

6. Error Handling

Clear Error Messages:

# Instead of: ValueError
# Use:
if not re.match(r"^[a-z_][a-z0-9_]*$", project_name):
    raise ValueError(
        f"Project name '{project_name}' is invalid.\n"
        f"Must start with lowercase letter or underscore,\n"
        f"followed by lowercase letters, numbers, or underscores."
    )

Template Generation Workflow

End-to-End Generation Process

1. USER SELECTION
   ├─ Choose template
   ├─ Select format (if flexible)
   └─ Provide variables

2. VALIDATION
   ├─ Validate all inputs
   ├─ Check constraints
   └─ Generate variable report

3. PRE-PROCESSING
   ├─ Compute derived variables
   ├─ Expand conditionals
   └─ Build file tree

4. GENERATION
   ├─ Render templates
   ├─ Copy static files
   ├─ Create directory structure
   └─ Handle special files

5. POST-PROCESSING
   ├─ Run hooks
   ├─ Initialize git/vcs
   ├─ Install dependencies
   └─ Generate documentation

6. VALIDATION
   ├─ Check generated files
   ├─ Verify structure
   ├─ Test basic functionality
   └─ Generate report

7. OUTPUT
   ├─ Display summary
   ├─ Provide next steps
   └─ Save manifest

Harness Expression Language in Templates

Available Context Variables

Harness Expressions:
├─ <+input.VARIABLE_NAME>        # Inputs
├─ <+pipeline.PROPERTY>          # Pipeline-level
├─ <+stage.PROPERTY>             # Stage-level
├─ <+steps.STEP_ID.PROPERTY>     # Step outputs
├─ <+env.PROPERTY>               # Environment variables
├─ <+secrets.getValue("NAME")>   # Secret references
└─ <+execution.PROPERTY>         # Execution context

Template Examples with Expressions

template:
  name: Deploy Service
  type: Step
  spec:
    service:
      name: <+input.service_name>
    environment:
      name: <+input.environment>
    variables:
      version: <+input.artifact_version>
      deploy_timeout: <+input.timeout_minutes>
      approval_required: <+input.requires_approval>

Related Documentation

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.44%
按下载量换算48

Claude

32.44%
按下载量换算42

Cursor

17.99%
按下载量换算23

Gemini CLI

9.86%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

可疑

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills