templ-templates

Edit and troubleshoot server-side HTML templates (.templ), including regeneration and handler wiring.

⭐0stars🔀0forks📁View on GitHub🕐Updated Jan 2, 2026⬇️1downloads

When & Why to Use This Skill

This Claude skill streamlines the development and maintenance of server-side HTML templates using the Go 'templ' library. It automates the end-to-end workflow of editing .templ files, regenerating Go code, wiring templates to HTTP handlers, and troubleshooting common integration issues, ensuring a robust and efficient full-stack development process.

Use Cases

  • Template Modification: Efficiently edit UI layouts and page templates within the 'internal/adapters/http/templates' directory.
  • Automated Code Generation: Resolve compilation errors by automatically triggering 'templ generate' or 'make generate' after template changes.
  • Handler Wiring: Seamlessly connect templates to Go HTTP handlers and ensure correct 'text/html' content-type headers are set.
  • Error Troubleshooting: Identify and fix common pitfalls like missing *_templ.go files or misplaced business logic within templates.
  • CI/CD Integration: Incorporate template regeneration and testing into the standard Go build and test workflow.
nametempl-templates
descriptionEdit and troubleshoot server-side HTML templates (.templ), including regeneration and handler wiring.
licenseMIT
compatibilityRequires bash, git, Go, and templ.
repomjrwtf
runnergithub-copilot-cli
version1.0
allowed-toolsBash(git:*) Bash(make:*) Bash(go:*) Bash(templ:*) Read

Where templates live

  • Layouts: internal/adapters/http/templates/layouts/*.templ
  • Pages: internal/adapters/http/templates/pages/*.templ

Standard workflow

  1. Edit .templ files.
  2. Regenerate:
make templ-generate
# or (full): make generate
  1. Run tests/build:
go build ./...
make test

Handler wiring

  • Handlers typically render templates from internal/infrastructure/http/handlers/*.
  • Set content type: text/html; charset=utf-8.

Common pitfalls

  • Forgetting to run templ generate (compile errors referencing missing *_templ.go).
  • Putting business logic in templates; keep logic in handlers/domain and pass data in.