gtpl-skills

Provide best practices for Go text/template and html/template packages.

4|2|Updated Dec 28, 2025
One-click install
npx skills add https://github.com/lazygophers/ccplugin --skill gtpl-skills
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gtpl-skills
Source: https://github.com/lazygophers/ccplugin/tree/main/plugins/languages/golang/skills/gtpl-skills
Command: npx skills add https://github.com/lazygophers/ccplugin --skill gtpl-skills

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers write secure, efficient, and maintainable Go templates by providing clear guidelines on best practices, security, and performance.

Core Features & Use Cases

  • Secure HTML Generation: Ensures protection against XSS attacks by prioritizing html/template.
  • Performance Optimization: Guides on template caching, pre-compilation, and efficient rendering.
  • Structured Design: Provides a framework for organizing templates and custom functions.
  • Use Case: When developing a web application, use this Skill to ensure all dynamic HTML content is rendered safely and efficiently, preventing common vulnerabilities and improving load times.

Quick Start

Follow the Go template design and security guidelines to build a secure and performant web application.

Frequently Asked Questions about gtpl-skills

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent XSS in Go html/template?

Preventing XSS in Go html/template requires prioritizing the html/template package over text/template, as it automatically escapes dynamic content. This Skill provides best practices to ensure secure HTML generation and robust web development against common vulnerabilities.

What is the best way to optimize Go template performance?

Optimizing Go template performance involves implementing template caching, pre-compilation, and efficient rendering strategies. This Skill guides developers through structured design and caching techniques to significantly improve web application load times.

How do I organize and structure Go templates for maintainability?

Organizing Go templates for maintainability requires a structured design framework that separates concerns and manages custom function development effectively. This Skill provides guidelines for template selection, structure design, and organization to ensure maintainable code.

Does Go text/template automatically escape HTML to prevent XSS?

Go text/template does not automatically escape HTML, making it unsafe for dynamic web content; html/template must be used instead. This Skill outlines template selection criteria to ensure protection against XSS attacks in web applications.

How do I handle errors when rendering Go templates?

Handling errors when rendering Go templates requires implementing robust error handling mechanisms during execution and parsing. This Skill covers comprehensive error handling strategies alongside custom function development for secure and reliable rendering.

Can I use Go templates for web development without pre-compilation?

Using Go templates without pre-compilation is possible but leads to significant performance bottlenecks in web development. This Skill guides developers on implementing caching strategies and pre-compilation to ensure efficient rendering and improved load times.