templ-templates

Edit .templ files and regenerate *_templ.go for Go templates.

1|1|Updated May 3, 2026
One-click install
npx skills add https://github.com/matt-riley/agent-skills --skill templ-templates
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: templ-templates
Source: https://github.com/matt-riley/agent-skills/tree/main/skills/templ-templates
Command: npx skills add https://github.com/matt-riley/agent-skills --skill templ-templates

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Edit and troubleshoot server-side HTML templates (.templ files for Go's templating framework), including automatic regeneration of template artifacts and wiring of handlers to render functions. Use when changing UI components, layouts, or page templates.

Core Features & Use Cases

  • Editing .templ files, regenerating *_templ.go, and wiring of handlers to generated render functions.
  • Debugging compile errors caused by stale template regeneration.
  • Maintaining a clean boundary between handlers (logic) and templates (presentation) to avoid logic in templates.

Quick Start

Locate the target .templ file, edit it, regenerate the template artifacts, and then build and test.

Frequently Asked Questions about templ-templates

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

FAQPage Schema
Why do my Go templ files cause compile errors after editing?

Stale template regeneration causes compile errors in Go templ files. Run templ generate, make templ-generate, or make generate to sync *_templ.go artifacts with edited .templ files and resolve build failures.

How do I wire Go handlers to render generated templ functions?

Wire Go handlers to generated templ render functions by editing .templ files, regenerating artifacts with templ generate, and ensuring handlers set the Content-Type header correctly before calling the render functions.

What is the best way to maintain logic and presentation boundaries in Go templates?

Maintaining boundaries in Go templates requires keeping logic in handlers and presentation in .templ files. Regenerate *_templ.go artifacts after editing templates to preserve a clean separation between handler logic and presentation.

When do I need to regenerate Go template artifacts?

Regenerate Go template artifacts whenever you change UI components, layouts, or page templates in .templ files. Running templ generate or make generate ensures the *_templ.go output stays in sync with template source definitions.

Does Go templ rendering require specific Content-Type headers in handlers?

Go templ rendering requires handlers to set the Content-Type header correctly. Wiring handlers to generated render functions validates that template outputs are served with the correct content type to browsers and clients.

Can I edit .templ files directly without running templ generate?

Editing .templ files without running templ generate leaves *_templ.go artifacts stale, causing compile errors and rendering issues. Always regenerate template artifacts after modifying .templ files to maintain sync with generated Go code.