Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

template-instantiation模板实例化

Agent Skill

template-instantiation 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

4,308

周安装

176

GitHub Stars

1,471

下载量

1,394
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:template-instantiation(模板实例化)
来源仓库:https://github.com/dotnet/skills
仓库路径:skills/template-instantiation
安装命令:
npx skills add https://github.com/dotnet/skills --skill template-instantiation
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/dotnet/skills --skill template-instantiation

简介

template-instantiation 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。

  • 适用于模板化开发、代码复用、配置管理和自动化脚本生成场景。
  • 支持基于模板生成具体实例,提升开发效率和一致性。
  • 安装命令:npx skills add https://github.com/dotnet/skills --skill template-instantiation。
  • 使用前需确认权限范围、维护状态及是否触发联网或文件读写操作。

SKILL.md

Template Instantiation

This skill creates.NET projects from templates using dotnet new CLI commands, with guidance for parameter validation, Central Package Management adaptation, and multi-project composition.

When to Use

  • User asks to create a new.NET project, app, or service
  • User needs a solution with multiple projects (API + tests + library)
  • User wants to create a project that respects existing Directory.Packages.props
  • User needs to install or manage template packages

When Not to Use

  • User is searching for or comparing templates — route to template-discovery skill
  • User wants to author a custom template — route to template-authoring skill
  • User wants to add packages to an existing project — use dotnet add package directly

Inputs

InputRequiredDescription
Template name or intentYesTemplate short name (e.g., webapi) or natural-language description
Project nameYesName for the created project
Output pathRecommendedDirectory where the project should be created
ParametersNoTemplate-specific parameters (e.g., --framework, --auth, --aot)

Workflow

Step 1: Resolve template and parameters

If the user provides a natural-language description, map it to a template short name (see the keyword table in the template-discovery skill). If they provide a template name, proceed directly.

Use dotnet new <template> --help to review available parameters, defaults, and types for any parameters the user did not specify.

Step 2: Analyze the workspace

Check the existing solution structure before creating:

  • Is Central Package Management (CPM) enabled? Look for Directory.Packages.props
  • What target frameworks are in use? Check existing .csproj files
  • Is there a global.json pinning the SDK?

This ensures the new project is consistent with the workspace.

Step 3: Preview the creation

Use dotnet new <template> --dry-run to show the user what files would be created. Confirm before proceeding.

dotnet new webapi --name MyApi --framework net10.0 --dry-run

Step 4: Create the project

Use dotnet new with the template name and all parameters:

dotnet new webapi --name MyApi --output ./src/MyApi --framework net10.0 --auth Individual

Common parameter combinations

TemplateParametersExample
webapi--auth (None, Individual, SingleOrg, Windows), --aot (native AOT)dotnet new webapi -n MyApi --auth Individual --aot
webapi--use-controllers (use controllers vs minimal APIs)dotnet new webapi -n MyApi --use-controllers
blazor--interactivity (None, Server, WebAssembly, Auto), --authdotnet new blazor -n MyApp --interactivity Server
grpc--aot (native AOT)dotnet new grpc -n MyService --aot
worker--aot (native AOT)dotnet new worker -n MyWorker --aot

Note: Use dotnet new <template> --help to see all available parameters for any template.

After creation, if the workspace uses CPM:

  1. Check .csproj for inline <PackageReference> versions
  2. Move version attributes to Directory.Packages.props as <PackageVersion> entries
  3. Remove Version attributes from the .csproj

Step 5: Multi-project composition (optional)

For complex structures, create each project sequentially and wire them together:

dotnet new webapi --name MyApi --output ./src/MyApi
dotnet new xunit --name MyApi.Tests --output ./tests/MyApi.Tests
dotnet add ./tests/MyApi.Tests reference ./src/MyApi
dotnet sln add ./src/MyApi ./tests/MyApi.Tests

Step 6: Template package management

Install or uninstall template packages:

dotnet new install Microsoft.DotNet.Web.ProjectTemplates.10.0
dotnet new uninstall Microsoft.DotNet.Web.ProjectTemplates.10.0

Step 7: Post-creation verification

  1. Verify the project builds: dotnet build
  2. If added to a solution, verify dotnet build at the solution level
  3. If CPM was adapted, verify Directory.Packages.props has the new entries

Validation

  • Project was created successfully with the expected files
  • Project builds cleanly with dotnet build
  • If CPM is active, .csproj has no version attributes and Directory.Packages.props has matching entries
  • Package versions in the project are current (not stale template defaults)
  • If multi-project, all projects build and reference each other correctly

Common Pitfalls

PitfallSolution
Not checking for CPM before creating a projectIf Directory.Packages.props exists, dotnet new creates projects with inline versions that conflict. After creation, move versions to Directory.Packages.props and remove them from .csproj.
Creating projects without specifying the frameworkAlways specify --framework when the template supports multiple TFMs to avoid defaulting to an older version.
Not adding the project to the solutionAfter creation, run dotnet sln add to include the project in the solution.
Not verifying the project buildsAlways run dotnet build after creation to catch missing dependencies or parameter issues early.

More Info

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

31.74%
按下载量换算442

Claude

31.18%
按下载量换算435

Cursor

18.97%
按下载量换算264

Gemini CLI

9.28%
按下载量换算129

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills