template-context
CommunityImprove template testability and coverage.
Authormeaganewaller
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill addresses the challenge of achieving branch coverage for logic embedded within ERB templates, which are often untestable by standard coverage tools.
Core Features & Use Cases
- Extract Conditional Logic: Moves complex
if/unless/ternarystatements from ERB templates into dedicated Plain Old Ruby Objects (POROs). - Enhance Testability: Enables isolated unit testing of decision-making logic, leading to higher code quality.
- Declarative Templates: Simplifies templates to focus on rendering data rather than executing logic.
- Use Case: When your test suite reports 0% branch coverage for template files, use this pattern to refactor the logic into a testable PORO.
Quick Start
Apply the template-context pattern to extract conditional logic from your ERB template into a PORO.
Dependency Matrix
Required Modules
None requiredComponents
references
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: template-context Download link: https://github.com/meaganewaller/.dotfiles/archive/main.zip#template-context Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.