templ

Provides conventions and best practices for the Go HTML templating language.

19|Updated Jan 30, 2026
One-click install
npx skills add https://github.com/xobotyi/cc-foundry --skill templ
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: templ
Source: https://github.com/xobotyi/cc-foundry/tree/main/plugins/golang/skills/templ
Command: npx skills add https://github.com/xobotyi/cc-foundry --skill templ

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance and conventions for using the templ Go HTML templating engine, ensuring efficient, safe, and maintainable web UI development.

Core Features & Use Cases

  • Syntax Mastery: Understand expressions, elements, control flow, and Go integration.
  • Component Architecture: Learn to define, compose, and manage reusable UI components.
  • Styling & JavaScript: Implement dynamic styling and integrate client-side JavaScript effectively.
  • Use Case: When building a new web application with Go, use this Skill to ensure all .templ files adhere to best practices for structure, security, and performance.

Quick Start

Use the templ skill to write a new .templ file for a user profile card component.

Frequently Asked Questions about templ

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

FAQPage Schema
How do I use the templ Go HTML templating engine to generate type-safe web components?

You can compose reusable UI components in templ by defining them in .templ files and passing typed Go data as parameters, allowing you to safely nest and render dynamic HTML elements without runtime template errors.

What is the best way to structure Go HTML templating syntax for complex control flow?

To master templ syntax for control flow, you embed Go expressions directly into .templ files, utilizing native Go conditionals and loops to manage element rendering and dynamic content generation safely.

Can I integrate JavaScript and CSS styling directly within templ UI components?

Yes, you can integrate JavaScript and apply dynamic CSS styling directly within templ UI components, allowing cohesive client-side behavior and styling encapsulated within the generated Go HTML output.

Does the templ engine support testing strategies for Go HTML templates?

The templ engine supports testing strategies by compiling .templ files into standard Go code, enabling you to write Go unit tests that directly assert against the generated HTML output for reliable UI verification.

Why use templ for Go web development instead of standard html/template packages?

You should use templ instead of standard html/template packages to gain compile-time type safety and native Go code generation, eliminating unsafe runtime template parsing and reducing dynamic content rendering errors.