go-cms-templating

Implements a shared variable interpolation engine for Go CMS feature modules.

Updated Jun 15, 2026
One-click install
npx skills add https://github.com/vernal96/go-cms --skill go-cms-templating-vernal96
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: go-cms-templating
Source: https://github.com/vernal96/go-cms/tree/main/.codex/skills/go-cms-templating
Command: npx skills add https://github.com/vernal96/go-cms --skill go-cms-templating-vernal96

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Feature modules like SEO, Mail, and SMS each need {{...}} placeholder interpolation, but building separate engines per module creates duplicated logic, inconsistent placeholder behavior, and tight coupling between features. This Skill defines how to build one small, reusable templating engine in a neutral kernel package that all modules share. ## Core Features & Use Cases - Compile-then-render pipeline: Templates are compiled against an allowlisted variable set so malformed delimiters and unknown variables fail before rendering, while declared-but-missing values render empty with structured warnings. - Context-aware rendering: Separate output contexts for plain text, HTML (with automatic escaping of dynamic values), and message headers (with CR/LF rejection to prevent header injection). - Namespaced variable catalogs: Enforces explicit namespaces like site., resource., data., and user., with shared domain catalogs (e.g., site.field.<key>) owned by core packages rather than duplicated per feature. - Use Case: Migrate the existing SEO module's local interpolation engine into kernel/templating, then have Mail reuse the same engine and the same site variable catalog without changing any existing SEO placeholder behavior. ## Quick Start Ask the agent to extract the SEO module's interpolation logic into a shared kernel/templating package following this skill's ownership, namespacing, and testing rules.

Frequently Asked Questions about go-cms-templating

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

FAQPage Schema
How do I add {{...}} placeholder interpolation to a Go CMS module?▼

Use the shared kernel/templating package: compile the template against your module's allowlisted variable set, then render through an explicit resolver. Feature modules own their variable catalogs and resolvers; the kernel package only compiles, validates, and renders.

How should I migrate the SEO template engine to shared kernel templating?▼

Move the reusable interpolation mechanics into kernel/templating and adapt SEO to use it, preserving existing placeholder names like site.field.* and resource.field.*. Update SEO tests to prove output compatibility, missing-value warnings, and limits remain unchanged.

Does the templating engine support loops or conditionals?▼

No. The language is intentionally interpolation-only, with no loops, conditionals, functions, Go text/template execution, or reflection-based traversal. This keeps the engine a small, safe primitive rather than a CMS expression language.

What happens when a template variable has no value?▼

A declared variable with no current value renders as empty output plus a structured warning entry for diagnostics. Unknown or undeclared variables are different: they fail as validation errors at compile time.

Can the templating engine resolve file or media variables to URLs?▼

No. Generic templating never opens files or media and does not convert file.ID or media.ID values. Each feature resolves typed file values for its own context, such as a Mail attachment, an HTML body URL, or an SEO OG image.

How does the engine prevent HTML injection and header injection?▼

Rendering distinguishes output contexts: HTML interpolation escapes dynamic scalar values by default while literal markup stays literal, and header-like output rejects CR/LF and control sequences that could enable header injection.