Agent skill

Templ Syntax

by Xe in Xe/site

Learn and write templ component syntax including expressions, conditionals, loops, and Go integration.

ZlibAuto-check passed

Install Templ Syntax

skills CLI
$ npx skills add Xe/site --skill templ-syntax -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Xe/site templ-syntax --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Xe/site.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/templ-syntax .claude/skills/templ-syntax && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
templ-syntax
GitHub stars
731
Token cost
~519 tokens
SKILL.md length
151 words
Files
4
Skills in repo
12
Repo updated
First seen
Licence
Zlib

At a glance

Learn and write templ component syntax including expressions, conditionals, loops, and Go integration.

  • Works in 5 steps: Define a component with typed params. → Render values with { expr }. → Compose components with… → …
  • Writing .templ files
  • SKILL.md covers Level 1: Fast Path, Level 2: Core Rules, Level 3: Common Patterns and Escalate to Other Skills, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Templ Syntax is an agent skill from Xe/site. Learn and write templ component syntax including expressions, conditionals, loops, and Go integration. Use when writing .templ files, learning templ syntax, or mentions 'templ component', 'templ expressions', or '.templ file syntax'.

Its SKILL.md is about 520 tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files (for example `resources/foundations.md`, `resources/patterns.md` and `resources/reference.md`).

The repository describes itself as: The new frontend/backend code for https://xeiaso.net. The licence is Zlib.

When your agent uses it

  • Writing .templ files
  • Learning templ syntax
  • Mentions templ component
  • Templ expressions

Example prompts

  • “templ component”
  • “templ expressions”
  • “.templ file syntax”
  • “/templ-syntax”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Define a component with typed params.
  2. Render values with { expr }.
  3. Compose components with @OtherComponent(...).
  4. Use Go control flow (if, for, switch) directly in markup.
  5. Keep business logic in Go helpers, not inline in templates.

What it can do on your machine

Read from SKILL.md and the folder at commit 45c532e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are templ).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • templ.guide

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Templ Syntax loads about 519 tokens when it runs. Until then it costs about 62 tokens; SKILL.md has 151 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~62
When it runs · the whole SKILL.md, loaded when a task matches
~519

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Xe/site at commit 45c532e, republished under its Zlib licence (© Xe). 151 words, ~519 tokens.

Download SKILL.mdSave it as .claude/skills/templ-syntax/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
templ-syntax
description
Learn and write templ component syntax including expressions, conditionals, loops, and Go integration. Use when writing .templ files, learning templ syntax, or mentions 'templ component', 'templ expressions', or '.templ file syntax'.

Templ Syntax

Use this skill with progressive disclosure: start at Level 1, then read deeper sections only when needed.

Level 1: Fast Path

Use this skill when you need to write or fix .templ syntax.

  1. Define a component with typed params.
  2. Render values with { expr }.
  3. Compose components with @OtherComponent(...).
  4. Use Go control flow (if, for, switch) directly in markup.
  5. Keep business logic in Go helpers, not inline in templates.
templ
package components

templ Greeting(name string, isAdmin bool) {
    <h1>Hello, { name }</h1>
    if isAdmin {
        <p>Admin mode</p>
    }
}

Level 2: Core Rules

  • Output: { value } auto-escapes text.
  • Dynamic attrs: class={ classes }, disabled?={ isDisabled }.
  • Children: accept with { children... }, pass with block syntax.
  • Composition: call components with @Component(...).
  • Safety: URLs should use safe helpers (for example templ.URL(...)) when appropriate.

Level 3: Common Patterns

templ
templ Card(title string) {
    <section class="card">
        <h2>{ title }</h2>
        <div>{ children... }</div>
    </section>
}

templ UserList(users []string) {
    if len(users) == 0 {
        <p>No users</p>
    } else {
        <ul>
            for _, user := range users {
                <li>{ user }</li>
            }
        </ul>
    }
}

Escalate to Other Skills

  • Building reusable UI APIs: use templ-components.
  • Wiring templates to handlers/routes: use templ-http.
  • Adding dynamic interactions: use templ-htmx.

References

© Xe, Zlib. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files in .agents/skills/templ-syntax of Xe/site.

  • SKILL.md
  • resources/foundations.md
  • resources/patterns.md
  • resources/reference.md

Open the folder on GitHubat commit 45c532e

Compare with similar skills

Templ Syntax next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Templ Syntax compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Templ Syntax this skillXe/site731—~519Automated safety check: PassZlib
N8n Expression Syntaxdavila7/claude-code-templates32k4 repos~2.4kAutomated safety check: PassMIT
Learning to Learn (OpenMAIC)THU-MAIC/OpenMAIC40k—~502Automated safety check: PassMIT
n8n Expression Syntaxczlonkowski/n8n-skills6.4k—~5.2kAutomated safety check: PassMIT
Scikit LearnK-Dense-AI/scientific-agent-skills48k1 repos~3.3kAutomated safety check: NotesBSD-3-Clause
Project Learnings Managergarrytan/gstack136k—~8.2kAutomated safety check: NotesMIT

Similar skills

  • N8n Expression Syntax

    davila7/claude-code-templates

    Validate n8n expression syntax and fix common errors. An agent skill from davila7/claude-code-templates.

    32k GitHub starsUsed in 4 repos~2.4k tokens
    Productivity & AutomationAuto-check passed
  • A Chinese-language skill that embeds learning strategies like retrieval practice and self-explanation as a parallel goal inside an OpenMAIC subject lesson, without making study skills the topic.

    40k GitHub stars~502 tokensUpdated today
    EducationAuto-check passed
  • n8n Expression Syntax

    czlonkowski/n8n-skills

    Validates and fixes n8n's double-curly-brace expressions, covering $json, $node, and the webhook body-wrapping mistake.

    6.4k GitHub stars~5.2k tokensUpdated 21 days ago
    Productivity & AutomationAuto-check passed
  • Scikit Learn

    K-Dense-AI/scientific-agent-skills

    Supports machine learning in Python with scikit-learn. An agent skill from K-Dense-AI/scientific-agent-skills.

    48k GitHub starsUsed in 1 repo~3.3k tokens
    Data & AnalyticsAuto-check: notes
  • Lets you review, search, prune and export the learnings gstack has collected across sessions, and surfaces them when a past fix or pattern comes up.

    136k GitHub stars~8.2k tokensUpdated today
    Agent WorkflowsAuto-check: notes
  • [DEPRECATED - use continuous-learning-v2] Legacy v1 stop-hook skill extractor.

    274k GitHub stars~1.1k tokensUpdated 2 days ago
    Auto-check passed
  • Stop Slop

    Xe/site

    Remove AI writing patterns from prose. An agent skill from Xe/site.

    731 GitHub starsUsed in 8 repos~423 tokens
    Auto-check passed
  • Choose and create the right Neon branch type for testing and development.

    731 GitHub starsUsed in 3 repos~2.4k tokens
    Auto-check: notes
  • Guides and best practices for working with Neon Serverless Postgres.

    731 GitHub starsUsed in 2 repos~1.8k tokens
    Auto-check passed
  • A skill your agent uses when creating git commits, writing commit messages, or following version control workflows

    731 GitHub stars~1.3k tokensUpdated 2 days ago
    Auto-check passed
  • A skill your agent uses when asked to generate a "no way to prevent this" / no-way-to-prevent-this satire post for a memory-safety CVE (out-of-bounds write/read, buffer/heap overflow…

    731 GitHub stars~816 tokensUpdated 2 days ago
    Auto-check passed
  • Create reusable templ UI components with props, children, and composition patterns.

    731 GitHub stars~552 tokensUpdated 2 days ago
    Auto-check passed

Questions about Templ Syntax

What does Templ Syntax do?

Learn and write templ component syntax including expressions, conditionals, loops, and Go integration. Templ Syntax is an agent skill from Xe/site. Learn and write templ component syntax including expressions, conditionals, loops, and Go integration.

When should I use Templ Syntax?

Templ Syntax fits situations like: writing .templ files; learning templ syntax; mentions templ component; templ expressions.

How do I install Templ Syntax in Claude Code?

Run `npx skills add Xe/site --skill templ-syntax -a claude-code`. Or copy the skill folder (.agents/skills/templ-syntax in Xe/site) into .claude/skills/templ-syntax in your project. Claude Code loads it when a task matches its description.

How do I install Templ Syntax in Codex?

Run `npx skills add Xe/site --skill templ-syntax -a codex`. Or copy the skill folder (.agents/skills/templ-syntax in Xe/site) into .agents/skills/templ-syntax in your project. Codex loads it when a task matches its description.

Can I use Templ Syntax in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Xe/site --skill templ-syntax -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/templ-syntax, .gemini/skills/templ-syntax, .github/skills/templ-syntax and .opencode/skills/templ-syntax in your project.

What does Templ Syntax need to run?

SKILL.md names no scripts, command-line tools or credentials: Templ Syntax is instructions for the agent only.

Does Templ Syntax access the network?

SKILL.md names 1 domain. As links in the text: templ.guide. This is read from the text; nothing was executed.

Is Templ Syntax safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Templ Syntax use?

Templ Syntax is published under the Zlib licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Templ Syntax use?

About 519 tokens (SKILL.md is roughly 2.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Templ Syntax?

Skills that share tags, products or a category with Templ Syntax: N8n Expression Syntax (davila7/claude-code-templates, 32k stars), Learning to Learn (OpenMAIC) (THU-MAIC/OpenMAIC, 40k stars), n8n Expression Syntax (czlonkowski/n8n-skills, 6.4k stars) and Scikit Learn (K-Dense-AI/scientific-agent-skills, 48k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Templ Syntax?

Xe (a GitHub user) maintains it in Xe/site, which has 731 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on October 5, 2026.

Source: Xe/site on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.