본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)5.8k · #14616

template-validation

하는 일

이 스킬은 템플릿이 동작하지 않게 만드는 실수를 사용자 정의 .NET 프로젝트 템플릿 파일에서 찾습니다. 예를 들어 빠진 필드나 충돌하는 짧은 이름이 있습니다. 공개 전에 문제를 잡으려는 템플릿 작성자를 위한 스킬입니다.

사용하는 경우

  • ✓template.json 파일을 쓰고 공개하기 전에 검사하고 싶을 때.
  • ✓템플릿을 설치했는데 dotnet new list에 나타나지 않을 때.
  • ✓NuGet에서 공유하기 전에 템플릿의 매개변수 정의를 검토할 때.

스킬 링크

https://github.com/dotnet/skills/blob/main/plugins/dotnet-template-engine/skills/template-validation/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/dotnet/skills/blob/main/plugins/dotnet-template-engine/skills/template-validation/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제가 팀을 위해 만든 template.json을 확인해서, NuGet에 공개하기 전에 오류가 있는지 알려 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트가 먼저 파일을 파싱하고, 문법이 깨졌으면 멈춘 뒤, 필드, 매개변수, 짧은 이름, 제약 조건을 검증 규칙과 대조합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Template Validation

This skill helps validate custom dotnet new templates for correctness before publishing. It encodes the validation rules that catch common authoring mistakes — issues that cause templates to silently fail, produce broken projects, or not appear in dotnet new list.

When to Use

  • User asks to check or validate a template.json file
  • User reports "my template doesn't show up after installing"
  • User wants to review a template before packaging and publishing to NuGet
  • User encounters unexpected behavior from a custom template

When Not to Use

  • User wants to find or use existing templates — route to template-discovery
  • User wants to create a project — route to template-instantiation
  • User wants to create a template from an existing project — route to template-authoring

Inputs

Input Required Description
template.json path Yes Path to the template.json file or the template directory containing .template.config/template.json

Validation Rules

When reviewing a template.json, check ALL of the following categories systematically. Report every finding as an error, warning, or suggestion.

Parse gate — stop on syntax errors. Parse JSON before applying any semantic rule. If parsing fails, report the parser's line and column, show only the smallest concrete syntax correction, and stop. Do not invent required-field, symbol, post-action, or discoverability findings from a document that did not parse. Re-parse after the correction before making any semantic claim.

The malformed-JSON final response has exactly two parts: the one-line parse verdict and a corrected snippet showing the exact edit. Do not append semantic recommendations, optional metadata, or a full replacement manifest.

1. Required Fields

Field Severity Rule
identity ERROR Must be present and non-empty
name ERROR Must be present and non-empty
shortName ERROR Must be present and non-empty
sourceName WARNING Without it, --name won't customize the generated project name
author WARNING Improves template discoverability
description SUGGESTION Helps users understand what the template creates
classifications SUGGESTION Improves search and categorization (e.g., ["Web", "API"])
defaultName SUGGESTION Provides a fallback project name when --name is not specified

2. Identity Format

  • ERROR if identity contains spaces — use dots or dashes (e.g., MyCompany.WebApi.CSharp)
  • WARNING if identity has no namespace separator (. or -) — use reverse-DNS format

3. ShortName Conflicts

A shortName that matches a dotnet new subcommand conflicts, because dotnet new <name> is then parsed as that subcommand instead of instantiating the template. Read the reserved set for the installed SDK from the Commands: section of dotnet new --help — that is the authoritative source and avoids this rule going stale.

As of current SDKs the subcommands include (illustrative only — version-dependent, do not hardcode this list; the live dotnet new --help output is canonical): install, uninstall, update, list, search, details, create. Note that top-level dotnet verbs like build, run, test, and publish do NOT conflict — dotnet new test does not collide with dotnet test.

  • ERROR if shortName matches any subcommand reported by dotnet new --help (case-insensitive)
  • WARNING if shortName is only 1 character — too short for discoverability
  • Note: shortName can be a string or an array of strings; check all values

4. Symbol Validation

For each symbol in the symbols object:

  • ERROR if a symbol is missing the type field
  • For type: "parameter":
    • WARNING if no datatype specified (defaults to string)
    • SUGGESTION if no description (improves --help output)
    • If datatype: "choice":
      • ERROR if no choices defined
      • ERROR if choices is empty
      • ERROR if defaultValue is not in the choices list
      • WARNING if optional (not isRequired) and no defaultValue — users get unexpected behavior
    • If datatype: "bool":
      • ERROR if defaultValue is not a valid boolean
    • If datatype: "int":
      • ERROR if defaultValue is not a valid integer
    • Valid datatypes: string, bool, choice, int, float, hex, text
    • ERROR if datatype is not in the valid list
  • For
자주 묻는 질문

에이전트는 무엇을 보고하나요?

각 발견 사항을 오류, 경고, 제안으로 표시해서 무엇을 먼저 고칠지 알 수 있게 합니다.

JSON이 깨졌으면 어떻게 되나요?

문제가 있는 줄과 열을 알려 주고, 다른 것을 검사하기 전에 가장 작은 수정 방법을 보여 줍니다.

템플릿을 만드나요?

아니요. 기존 템플릿 파일을 검증하며, 템플릿 생성은 별도의 스킬이 다룹니다.

상세 정보

작성자의 원본 설명

Validates custom dotnet new templates for correctness before publishing. Catches missing fields, parameter bugs, shortName conflicts, constraint issues, and common authoring mistakes that cause templates to fail silently. USE FOR: checking template.json files for errors before publishing or testing, diagnosing why a template doesn't appear after installation, reviewing template parameter definitions for type mismatches and missing defaults, finding shortName conflicts with dotnet CLI commands, validating post-action and constraint configuration. DO NOT USE FOR: finding or using existing templa

repo: dotnet/skills

인기도

GitHub 스타
5.8k
순위
#14616
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬