home / skills / levnikolaevich / claude-code-skills / ln-751-command-templates

ln-751-command-templates skill

/ln-751-command-templates

This skill generates Claude Code commands from templates by substituting variables to automate project bootstrap tasks.

npx playbooks add skill levnikolaevich/claude-code-skills --skill ln-751-command-templates

Review the files below or copy the command above to add this skill to your agents.

Files (8)
SKILL.md
3.2 KB
---
name: ln-751-command-templates
description: Generates individual .claude/commands files from templates
---

> **Paths:** File paths (`shared/`, `references/`, `../ln-*`) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root.

# ln-751-command-templates

**Type:** L3 Worker
**Category:** 7XX Project Bootstrap
**Parent:** ln-750-commands-generator

Generates Claude Code commands from templates with variable substitution.

---

## Overview

| Aspect | Details |
|--------|---------|
| **Input** | Template name, variable values from ln-750 |
| **Output** | `.claude/commands/{command}.md` file |
| **Templates** | Located in `references/` directory |

---

## Available Templates

| Template | Output File | Required |
|----------|-------------|----------|
| `refresh_context_template.md` | refresh_context.md | Always |
| `refresh_infrastructure_template.md` | refresh_infrastructure.md | Always |
| `build_and_test_template.md` | build-and-test.md | Always |
| `ui_testing_template.md` | ui-testing.md | If Playwright |
| `deploy_template.md` | deploy.md | If CI/CD |
| `database_ops_template.md` | database-ops.md | If Database |

---

## Workflow

1. **Receive** template name and variables from ln-750
2. **Load** template from `references/{template}.md`
3. **Substitute** all `{{VARIABLE}}` placeholders
4. **Write** to `.claude/commands/` directory
5. **Report** success/failure to coordinator

---

## Variable Syntax

All templates use Handlebars-style syntax: `{{VARIABLE_NAME}}`

Common variables:
- `{{PROJECT_NAME}}` — Project name
- `{{FRONTEND_ROOT}}` — Frontend source path
- `{{BACKEND_ROOT}}` — Backend source path
- `{{FRONTEND_PORT}}` — Frontend dev server port
- `{{BACKEND_PORT}}` — Backend API port
- `{{TECH_STACK}}` — Technology stack summary

**MANDATORY READ:** Load templates from `references/` for full variable lists.

---

## Critical Rules

- **Template-driven only:** All output generated from `references/` templates, never freeform
- **Full substitution:** Every `{{VARIABLE}}` must be replaced; fail if any placeholder unresolved
- **Write to correct path:** Output always goes to `.claude/commands/`, never elsewhere
- **No template modification:** Templates in `references/` are read-only; only output files are written

## Definition of Done

- Template loaded from `references/{template}.md`
- All `{{VARIABLE}}` placeholders substituted with values from ln-750
- Output written to `.claude/commands/{command}.md`
- Success/failure reported back to coordinator

## Reference Files

- **refresh_context_template.md:** [references/refresh_context_template.md](references/refresh_context_template.md)
- **refresh_infrastructure_template.md:** [references/refresh_infrastructure_template.md](references/refresh_infrastructure_template.md)
- **build_and_test_template.md:** [references/build_and_test_template.md](references/build_and_test_template.md)
- **ui_testing_template.md:** [references/ui_testing_template.md](references/ui_testing_template.md)
- **deploy_template.md:** [references/deploy_template.md](references/deploy_template.md)
- **database_ops_template.md:** [references/database_ops_template.md](references/database_ops_template.md)

---

**Version:** 2.0.0
**Last Updated:** 2026-01-10

Overview

This skill generates individual .claude/commands files from read-only templates with variable substitution. It produces production-ready Claude Code command files and enforces strict template-driven output rules to ensure consistency. The skill integrates with a coordinator that supplies template names and variable values.

How this skill works

The skill loads a specified template from the references/ directory, replaces all Handlebars-style placeholders ({{VARIABLE_NAME}}) with values provided by the coordinator, and writes the resulting file to .claude/commands/{command}.md. It validates that no unresolved placeholders remain and reports success or failure back to the coordinator. Templates are never modified; only generated output files are written.

When to use it

  • Bootstrapping a new project with standardized Claude Code commands
  • Automating command file creation during CI/CD or developer onboarding
  • Generating environment-specific commands (frontend/backend ports, paths) from a single template source
  • Creating optional command sets based on project features (Playwright, Database, CI/CD)

Best practices

  • Always supply a complete set of variables from the coordinator (missing values cause failure)
  • Keep templates in the references/ directory and treat them as read-only sources
  • Validate templates locally to confirm placeholder names match variable keys
  • Use deterministic command names to avoid overwriting critical files
  • Run generation as part of a controlled step (task runner or CI job) so failures are reported and retried

Example use cases

  • Generate refresh_context.md and refresh_infrastructure.md during project setup to standardize developer flows
  • Produce build-and-test.md automatically when creating a new service, injecting build paths and ports
  • Emit ui-testing.md only for projects that include Playwright, using the provided FRONTEND_ROOT and FRONTEND_PORT
  • Write deploy.md when CI/CD is enabled, populating deployment endpoints and credentials placeholders from secure variables
  • Create database-ops.md for projects with a database, substituting connection paths and maintenance commands

FAQ

What happens if a template contains an unresolved placeholder?

The generator fails the operation and reports the unresolved placeholder back to the coordinator. No output file is written until all variables are provided.

Can templates be edited by the generator?

No. Templates in references/ are read-only. The generator only reads templates and writes generated files to .claude/commands/.

Where must generated files be written?

All outputs are written to .claude/commands/{command}.md. Writing elsewhere is not allowed by the skill rules.