kemalcr/kemal/kemal-view
Claude Code and agent skill by kemalcr/kemal
- community
Checking that the SKILL.md file is still in the repository.
Rendering ECR templates and layouts with Kemal.
Install
npx vskill@latest install kemalcr/kemal/kemal-viewSKILL.md
The same SKILL.md was published earlier as kemalcr/kemal/kemal-view.
Kemal View Rendering
This skill provides expert guidance on rendering HTML templates using ECR (Embedded Crystal) in Kemal, strictly following patterns from `kemal-by-example`.
Core Mandates
- Rendering: Use
render "path/to/view.ecr"for simple rendering. - Layouts: Use
render "path/to/view.ecr", "path/to/layout.ecr"for layout support. - Paths: Always use relative paths from the project root (e.g.,
src/views/index.ecr). - Data Passing: Local variables in the route block are directly accessible within ECR templates.
- Escaping: ECR does not auto-escape. Wrap user-provided values in
HTML.escape(...)(require "html") when outputting with<%= ... %>.
Patterns from Source Code
Basic Route with View Rendering
Route with Local Variables for Views
Edit Route with Conditional Rendering
Layout Template Structure
Typical layout file at src/views/layouts/application.ecr:
View Template Example
Typical view file at src/views/posts/index.ecr. ECR does not auto-escape output, so any user-provided value rendered with <%= ... %> must go through HTML.escape (stdlib, require "html") to prevent XSS:
Error Rendering with Local Variables
Best Practices
- Layout Structure: Use
<%= content %>in layout files to render the view content. - Partials: Use
render "path/to/_partial.ecr"for reusable UI components (not shown in examples but standard practice). - ECR Directives: Prefer
<%= ... %>for output and<% ... %>for logic/control flow. - Escaping (XSS): ECR performs no automatic HTML escaping. Always wrap user-provided data in
HTML.escape(...)inside<%= ... %>; only render raw HTML you generated yourself (like the layout's<%= content %>). - Local Variables: Pass data to views by defining local variables in the route block before calling
render. - Error Handling: Handle missing resources (404) by checking models before rendering, or set appropriate status codes.
When to Use
- When creating or modifying HTML views in a Kemal application.
- When setting up or changing the main application layout.
- When organizing view files and partials.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/kemal-view/SKILL.md
Popularity
- Repository stars
- 3,918
- Repository forks
- 205
- 7-day trend score
- 41
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kemalcr/kemal/kemal-view)