Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

fixing-templates

БесплатноБез исполняемых скриптовНе проверен

Use when fixing template issues in create-faster - indentation, spacing, typos, or formatting problems in .hbs files

plvoот plvo★ 31 звезда на GitHub6 установок в других каталогах

Об этом скилле

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-templates skill)
  • Extracting from external projects (use extracting-templates skill)
  • 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.json files — generated by package-json-generator.ts
  • All .env.example files — generated by env-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 turborepo
  • hasLibrary "name" — check if current app has library
  • has "category" "value" — check database/orm/tooling
  • hasContext "key" — check if key exists in context
  • appPort appName — get port for app
  • eq, 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
Полный SKILL.md на GitHub

Установить 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), без исполняемых скриптов.

Похожие скиллы

Сравнить fixing-templates с