fixing-templates
БесплатноБез исполняемых скриптовНе проверенUse when fixing template issues in create-faster - indentation, spacing, typos, or formatting problems in .hbs files
Об этом скилле
Fixing Templates in create-faster
Overview
Fix formatting, spacing, and syntax issues in Handlebars templates systematically.
Core principle: Audit comprehensively, fix consistently, verify output.
When to Use
Use this skill when:
- Fixing indentation issues in templates
- Removing trailing/extra spaces
- Fixing typos in template files
- Cleaning up conditional formatting
- Standardizing template patterns
Do NOT use for:
- Adding new content (use
adding-templatesskill) - Extracting from external projects (use
extracting-templatesskill) - Updating dependency versions
- Changing template logic/functionality
Architecture Context
What IS a template: .hbs files in templates/ rendered by Handlebars.
What is NOT a template (generated programmatically, fix in code instead):
- All
package.jsonfiles — generated bypackage-json-generator.ts - All
.env.examplefiles — generated byenv-generator.ts
Template Directory Layout
templates/
├── stack/{framework}/ # Stack base files (Next.js, Expo, Hono, TanStack Start)
├── libraries/{library}/ # Per-app libraries (shadcn, better-auth, mdx, pwa, nativewind)
├── project/
│ ├── database/{provider}/ # Docker compose files (postgres, mysql)
│ ├── orm/{provider}/ # ORM config + schema (drizzle, prisma)
│ └── tooling/{tool}/ # Dev tools (biome, husky)
└── repo/{type}/ # Repo root files (single, turborepo)
Template Systems
YAML Frontmatter (per-file configuration):
---
path: src/lib/db/schema.ts # Output path for single repo
mono:
scope: app | pkg | root # Monorepo scope
path: schema.ts # Monorepo path
only: mono | single # Repo type filter
---
Handlebars helpers:
isMono— check if turborepohasLibrary "name"— check if current app has libraryhas "category" "value"— check database/orm/toolinghasContext "key"— check if key exists in contextappPort appName— get port for appeq,ne,and,or— logical operators
Rendering config (preventIndent: false): Handlebars auto-indents block content to match the helper's indentation. This is a major source of double-indentation issues.
Partials (templates/partials/{group}/{name}.hbs, inserted with {{> group/name}}): fix a shared block in its partial, never in one caller. A partial called alone on its line is indented to the call and ends with one line break; a blank line inside it gets that indentation as trailing spaces. A partial called mid-line must set inline: true in its frontmatter, otherwise its line break splits every caller's line. Registration normalizes the ending, so the file's own final newline is never the cause.
Stack-specific suffix: file.ext.{stack}.hbs (e.g., route.ts.nextjs.hbs) — only included for matching stack.
Common Template Issues
Issue 1: Trailing Spaces in Conditionals
Problem:
"start": "next start {{#if (isMono)}}--port {{appPort appName}}{{/if}}",
When condition is false, renders:
"start": "next start ", // ← trailing space!
Fix:
"start": "next start{{#if (isMono)}} --port {{appPort appName}}{{/if}}",
Space moved INSIDE conditional.
Issue 2: Blank Lines from False Conditionals
When {{#if}} evaluates to false on its own line, Handlebars leaves a blank line.
Problem:
{{#if (hasLibrary "mdx")}}
import createMDX from '@next/mdx';
{{/if}}
import type { NextConfig } from 'next';
When mdx not selected: blank line before import.
Fix options:
- Use tilde syntax
{{~#if}}...{{~/if}}to strip whitespace (careful: also strips newlines when true) - Restructure to put conditional on same line as content
- Accept blank lines if they don't break output validity
Issue 3: Adjacent Mutually-Exclusive Conditionals
Problem:
{{#if (has "database" "postgres")}}
import { pgTable } from 'drizzle-orm/pg-core';
{{/if}}
{{#if (has "database" "mysql")}}
import { mysqlTable } from 'drizzle-orm/mysql-core';
{{/if}}
One always false → blank line.
Issue 4: Inconsistent Indentation
Problem:
{{#if condition}}
content
{{/if}} // ← wrong indent level
Fix: Match surrounding code indentation.
Issue 5: JSX Inline Conditionals
Problem:
<View {{#if (hasLibrary "nativewind")}}className='...'{{/if}}>
When false: <View > (trailing space).
Fix:
<View{{#if (hasLibrary "nativewind")}} className='...'{{/if}}>
Systematic Fixing Process
digraph fixing_templates {
"Start" [shape=doublecircle];
"Audit ALL templates" [shape=box];
"Identify patterns" [shape=box];
"Group by issue type" [shape=box];
"Fix systematically" [shape=box];
"Verify generation" [shape=box];
"Test renders correctly?" [shape=diamond];
"Fix issues" [shape=box];
"Done" [shape=doublecircle];
"S
Установить fixing-templates в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл fixing-templates?
Use when fixing template issues in create-faster - indentation, spacing, typos, or formatting problems in .hbs files
Как установить скилл fixing-templates?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл fixing-templates запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic