ワンクリックで
fixing-templates
Use when fixing template issues in create-faster - indentation, spacing, typos, or formatting problems in .hbs files
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Use when fixing template issues in create-faster - indentation, spacing, typos, or formatting problems in .hbs files
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | fixing-templates |
| description | Use when fixing template issues in create-faster - indentation, spacing, typos, or formatting problems in .hbs files |
Fix formatting, spacing, and syntax issues in Handlebars templates systematically.
Core principle: Audit comprehensively, fix consistently, verify output.
Use this skill when:
Do NOT use for:
adding-templates skill)extracting-templates skill)What IS a template: .hbs files in templates/ rendered by Handlebars.
What is NOT a template (generated programmatically, fix in code instead):
package.json files — generated by package-json-generator.ts.env.example files — generated by env-generator.tstemplates/
├── 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)
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 operatorsRendering config (preventIndent: false): Handlebars auto-indents block content to match the helper's indentation. This is a major source of double-indentation issues.
Stack-specific suffix: file.ext.{stack}.hbs (e.g., route-nextjs.ts.nextjs.hbs) — only included for matching stack.
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.
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:
{{~#if}}...{{~/if}} to strip whitespace (careful: also strips newlines when true)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.
Problem:
{{#if condition}}
content
{{/if}} // ← wrong indent level
Fix: Match surrounding code indentation.
Problem:
<View {{#if (hasLibrary "nativewind")}}className='...'{{/if}}>
When false: <View > (trailing space).
Fix:
<View{{#if (hasLibrary "nativewind")}} className='...'{{/if}}>
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];
"Start" -> "Audit ALL templates";
"Audit ALL templates" -> "Identify patterns";
"Identify patterns" -> "Group by issue type";
"Group by issue type" -> "Fix systematically";
"Fix systematically" -> "Verify generation";
"Verify generation" -> "Test renders correctly?";
"Test renders correctly?" -> "Done" [label="yes"];
"Test renders correctly?" -> "Fix issues" [label="no"];
"Fix issues" -> "Verify generation";
}
DO NOT fix one issue and stop. Audit ALL templates first.
Search for common patterns:
# Trailing spaces before conditionals
grep -r ' {{#if' templates/
# Double spaces in conditionals
grep -r '{{#if ' templates/
# Trailing spaces in general
grep -r ' $' templates/
# Mixed indentation (tabs vs spaces)
grep -rP '\t' templates/
# Consecutive blank lines
grep -rP '\n\n\n+' templates/
# JSX elements with inline conditionals
grep -rn '<[A-Z][a-zA-Z]* {{#if' templates/
# Adjacent mutually-exclusive conditionals
grep -rn '{{/if}}' templates/ | grep -A1 '{{#if'
Count occurrences to know the scope BEFORE starting fixes.
Group similar issues:
Pattern A: Conditional trailing spaces
Pattern B: Blank lines from false conditionals
Pattern C: Wrong indentation
Pattern D: JSON validity issues from conditionals
tsconfig.json.hbs, components.json.hbs, etc.DO ONE pattern type at a time across ALL files.
Don't fix:
DO fix:
Why: Consistency. Same fix applied everywhere.
CRITICAL: Don't assume visual inspection is enough.
Test generation:
# Single repo mode (conditionals = false)
bunx create-faster test-single --app test-single:nextjs
# Turborepo mode (conditionals = true)
bunx create-faster test-turbo --app web:nextjs --app api:hono
Verify:
jq .)cd apps/cli && bun test
All existing tests must pass after template changes.
| Excuse | Reality |
|---|---|
| "I'll just fix this one file" | Audit finds issues across many files. Systematic audit required. |
| "Visual inspection is enough" | Must test actual generation. Trailing spaces invisible. |
| "It's just spacing, not important" | Invalid JSON, broken scripts. Very important. |
| "I'll fix as I find them" | Reactive = missing 90%+ of issues. Proactive audit required. |
| "Too tedious to check all files" | grep does it in 2 seconds. No excuse. |
| "I need to fix package.json.hbs" | Package.json is generated programmatically, not from templates. |
STOP immediately if you think:
These thoughts = baseline failure pattern (fixed 1, missed 100+).
# Trailing spaces before conditionals (most common)
grep -rn ' {{#if' templates/
# Double spaces in conditions
grep -rn '{{#if ' templates/
# JSX elements with inline conditionals
grep -rn '<[A-Z][a-zA-Z]* {{#if' templates/
# All trailing spaces
grep -rn ' $' templates/
# Tabs (should be spaces)
grep -rPn '\t' templates/
# Multiple blank lines
grep -rPn '\n\n\n+' templates/
# Logic bugs: eq with helper name instead of calling helper
grep -rn 'eq hasContext' templates/
grep -rn 'eq hasLibrary' templates/
Use when documenting blueprints in create-faster MDX docs - covers pre-composed starter projects with composition, architecture, application code, CLI usage, and extra dependencies
Use when creating a new blueprint for create-faster from scratch - covers META entry design, application template creation, and testing for complete starter projects
Use when extracting a working project into a create-faster blueprint - triggers on phrases like "turn my project into a blueprint", "extract blueprint from my CRM", "make this project a create-faster template"
Use when updating library or project addon versions in create-faster __meta__.ts, especially when the update may involve breaking changes, new packages, renamed APIs, or cross-integration impacts
Use when documenting modules (libraries/addons) in create-faster MDX docs - covers standalone module pages with supported stacks, dependencies, env vars, and file structures
Use when documenting stacks, databases, or ORMs in create-faster MDX docs - focuses on technical changes and what we add beyond official setup