template-creator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Mode: Cognitive/Prompt-Driven -- No standalone utility script; use via agent context.
模式:认知/提示驱动 -- 无独立实用脚本;需通过Agent上下文调用。

Template Creator Skill

Template Creator Skill

Creates, validates, and registers templates for the multi-agent orchestration framework.
+==============================================================+
|  MANDATORY: Research-Synthesis MUST be invoked BEFORE         |
|  this skill. Invoke: Skill({ skill: "research-synthesis" })   |
|  FAILURE TO RESEARCH = UNINFORMED TEMPLATE = REJECTED         |
+==============================================================+
|                                                               |
|  DO NOT WRITE TEMPLATE FILES DIRECTLY!                        |
|                                                               |
|  This includes:                                               |
|    - Copying archived templates                               |
|    - Restoring from _archive/ backup                          |
|    - "Quick" manual creation                                  |
|                                                               |
|  WHY: Direct writes bypass MANDATORY post-creation steps:     |
|    1. Template catalog update (template NOT discoverable)     |
|    2. README.md update (template INVISIBLE to consumers)      |
|    3. Consuming skill update (template NEVER used)            |
|    4. CLAUDE.md update (if user-invocable)                    |
|                                                               |
|  RESULT: Template EXISTS in filesystem but is NEVER USED.     |
|                                                               |
|  ENFORCEMENT: unified-creator-guard.cjs blocks direct         |
|  template writes. Override: CREATOR_GUARD=off (DANGEROUS)     |
|                                                               |
|  ALWAYS invoke this skill properly:                           |
|    Skill({ skill: "template-creator" })                       |
|                                                               |
+==============================================================+
为多代理编排框架创建、验证并注册模板。
+==============================================================+
|  强制要求:必须先调用Research-Synthesis                     |
|  调用方式:Skill({ skill: "research-synthesis" })           |
|  未执行研究将导致模板信息不足,直接被驳回                   |
+==============================================================+
|                                                               |
|  禁止直接编写模板文件!                                       |
|                                                               |
|  包括以下行为:                                               |
|    - 复制已归档的模板                                         |
|    - 从_archive/备份中恢复模板                               |
|    - 「快速」手动创建模板                                     |
|                                                               |
|  原因:直接编写会跳过强制的创建后步骤:                       |
|    1. 模板目录更新(模板将无法被发现)                       |
|    2. README.md更新(模板对使用者不可见)                    |
|    3. 消费型Skill更新(模板永远不会被使用)                  |
|    4. CLAUDE.md更新(若模板支持用户调用)                    |
|                                                               |
|  后果:模板存在于文件系统中,但永远不会被使用。               |
|                                                               |
|  强制管控:unified-creator-guard.cjs会拦截直接的模板写入操作 |
|  临时关闭方式:CREATOR_GUARD=off(危险操作)                 |
|                                                               |
|  请始终正确调用本Skill:                                       |
|    Skill({ skill: "template-creator" })                       |
|                                                               |
+==============================================================+

ROUTER UPDATE REQUIRED (CRITICAL - DO NOT SKIP)

必须更新路由(关键步骤 - 请勿跳过)

After creating ANY template, you MUST update:
  1. .claude/templates/README.md
    - Add template entry
  2. .claude/context/artifacts/catalogs/template-catalog.md
    - Add catalog entry
  3. CLAUDE.md Section 2 or 8.5 if template is framework-significant or user-invocable
  4. Consuming creator skill if template standardizes an artifact type
  5. .claude/context/memory/learnings.md
    - Record creation
Verification:
bash
grep "<template-name>" .claude/templates/README.md || echo "ERROR: README NOT UPDATED!"
grep "<template-name>" .claude/context/artifacts/catalogs/template-catalog.md || echo "ERROR: CATALOG NOT UPDATED!"
WHY: Templates not in the catalog are invisible to other creators and will never be used.

创建任何模板后,必须更新以下内容:
  1. .claude/templates/README.md
    - 添加模板条目
  2. .claude/context/artifacts/catalogs/template-catalog.md
    - 添加目录条目
  3. 若模板为框架核心或支持用户调用,更新CLAUDE.md的第2节或第8.5节
  4. 若模板标准化了某类工件,更新对应的消费型Skill
  5. .claude/context/memory/learnings.md
    - 记录创建信息
验证方式:
bash
grep "<template-name>" .claude/templates/README.md || echo "ERROR: README未更新!"
grep "<template-name>" .claude/context/artifacts/catalogs/template-catalog.md || echo "ERROR: 目录未更新!"
原因: 未录入目录的模板对其他创建者不可见,永远不会被使用。

Overview

概述

Templates ensure consistency across the multi-agent framework. This skill creates templates for:
  • Agent definitions - Standardized agent structures
  • Skill definitions - Reusable capability patterns
  • Workflow definitions - Multi-agent orchestration patterns
  • Spawn prompts - Agent spawn prompt templates consumed by
    spawn-template-resolver.cjs
  • Reports - Report document templates
  • Code style guides - Language-specific coding standards
  • General documents - ADRs, specs, checklists, and other framework documents
Core principle: Templates are the DNA of the system. Consistent templates produce consistent, predictable agents and skills.
模板确保多代理框架的一致性。本Skill可创建以下类型的模板:
  • Agent定义 - 标准化的Agent结构
  • Skill定义 - 可复用的能力模式
  • 工作流定义 - 多代理编排模式
  • Spawn提示 - 被
    spawn-template-resolver.cjs
    消费的Agent启动提示模板
  • 报告 - 报告文档模板
  • 代码风格指南 - 特定语言的编码标准
  • 通用文档 - ADR、规格说明、检查清单及其他框架文档
核心原则: 模板是系统的DNA。一致的模板能生成一致、可预测的Agent和Skill。

When to Use

使用场景

Always:
  • Creating a new type of artifact that will be replicated
  • Standardizing an existing pattern across the codebase
  • Adding a new template category
  • Improving existing templates with better patterns
Exceptions:
  • One-off files that will never be replicated
  • Temporary/throwaway code
必须使用本Skill的场景:
  • 创建会被复用的新型工件
  • 标准化代码库中已有的模式
  • 添加新的模板类别
  • 用更优模式改进现有模板
例外场景:
  • 不会被复用的一次性文件
  • 临时/可丢弃的代码

Template Types

模板类型

TypeLocationCountPurposeKey Consumers
Spawn
.claude/templates/spawn/
4Agent spawn prompt templatesrouter, spawn-prompt-assembler
Agent
.claude/templates/agents/
2Agent definition boilerplateagent-creator
Skill
.claude/templates/skills/
1Skill definition boilerplateskill-creator
Workflow
.claude/templates/workflows/
1Workflow definition boilerplateworkflow-creator
Report
.claude/templates/reports/
5Report document templatesqa, developer, researcher
Code Style
.claude/templates/code-styles/
3Language style guidesdeveloper, code-reviewer
Document
.claude/templates/
(root)
8+General document templates (ADR, spec)planner, architect, qa
Cross-Reference: See
.claude/context/artifacts/catalogs/template-catalog.md
for the complete inventory (28 active templates). For spawn template resolution logic, see
.claude/lib/spawn/spawn-template-resolver.cjs
.
类型存储位置数量用途主要消费者
Spawn
.claude/templates/spawn/
4Agent启动提示模板router, spawn-prompt-assembler
Agent
.claude/templates/agents/
2Agent定义模板框架agent-creator
Skill
.claude/templates/skills/
1Skill定义模板框架skill-creator
Workflow
.claude/templates/workflows/
1工作流定义模板框架workflow-creator
Report
.claude/templates/reports/
5报告文档模板qa, developer, researcher
Code Style
.claude/templates/code-styles/
3语言风格指南developer, code-reviewer
Document
.claude/templates/
(根目录)
8+通用文档模板(ADR、规格说明)planner, architect, qa
交叉参考: 完整模板清单(28个活跃模板)请查看
.claude/context/artifacts/catalogs/template-catalog.md
。Spawn模板解析逻辑请查看
.claude/lib/spawn/spawn-template-resolver.cjs

Template Security Compliance

模板安全合规

Critical Security Requirements:
  1. No Secrets (SEC-TC-007): Templates MUST NOT include secrets, credentials, tokens, or API keys
  2. Path Safety: All template references MUST use relative paths (
    .claude/templates/...
    ), never absolute paths
  3. No Sensitive Metadata: Templates MUST NOT expose internal system paths or user directories
  4. No Windows Reserved Names: Template names MUST NOT use
    nul
    ,
    con
    ,
    prn
    ,
    aux
    ,
    com1
    -
    com9
    ,
    lpt1
    -
    lpt9
  5. Retention Mandates (SEC-TMPL-006): Templates flagged by SEC-TMPL-006 MUST remain at designated locations
  6. Spawn Template Placeholder Safety (SEC-TC-001): Spawn templates with
    {{PLACEHOLDER}}
    tokens in
    prompt:
    fields MUST reference
    sanitizeSubstitutionValue()
    from
    prompt-factory.cjs
    for value sanitization. Unsanitized placeholders in spawn prompts create a prompt injection surface. Do NOT place
    {{PLACEHOLDER}}
    tokens where user-provided input is directly substituted without sanitization.
  7. No Eval/Exec: Templates MUST NOT contain
    eval()
    ,
    exec()
    ,
    Function()
    , or other code execution patterns
Enforcement:
unified-creator-guard.cjs
hook blocks direct template writes (default: block mode).
关键安全要求:
  1. 禁止包含机密信息(SEC-TC-007): 模板不得包含机密信息、凭证、令牌或API密钥
  2. 路径安全: 所有模板引用必须使用相对路径(
    .claude/templates/...
    ),禁止使用绝对路径
  3. 禁止敏感元数据: 模板不得暴露内部系统路径或用户目录
  4. 禁止Windows保留名称: 模板名称不得使用
    nul
    con
    prn
    aux
    com1
    -
    com9
    lpt1
    -
    lpt9
  5. 保留要求(SEC-TMPL-006): 被SEC-TMPL-006标记的模板必须保留在指定位置
  6. Spawn模板占位符安全(SEC-TC-001): 若Spawn模板的
    prompt:
    字段包含
    {{PLACEHOLDER}}
    令牌,必须引用
    prompt-factory.cjs
    中的
    sanitizeSubstitutionValue()
    进行值清理。未清理的占位符会导致提示注入风险。禁止将
    {{PLACEHOLDER}}
    令牌直接用于用户提供的输入内容。
  7. 禁止代码执行模式: 模板不得包含
    eval()
    exec()
    Function()
    或其他代码执行模式
强制管控:
unified-creator-guard.cjs
钩子会拦截直接的模板写入操作(默认:拦截模式)。

The Iron Law

铁律

NO TEMPLATE WITHOUT PLACEHOLDER DOCUMENTATION
Every
{{PLACEHOLDER}}
must have a corresponding comment explaining:
  1. What value should replace it
  2. Valid options/formats
  3. Example value
No exceptions:
  • Every placeholder is documented
  • Every required field is marked
  • Every optional field has a default

无占位符文档的模板一律不允许存在
每个
{{PLACEHOLDER}}
必须有对应的注释说明:
  1. 应该替换成什么值
  2. 有效选项/格式
  3. 示例值
无例外:
  • 每个占位符都有文档说明
  • 每个必填字段都有标记
  • 每个可选字段都有默认值

Workflow Steps

工作流步骤

Step 0: Research-Synthesis (MANDATORY - BLOCKING)

步骤0:Research-Synthesis(强制要求 - 阻塞步骤)

Per CLAUDE.md Section 3 requirement, invoke
research-synthesis
BEFORE template creation:
javascript
Skill({ skill: 'research-synthesis' });
Research focuses for templates:
  • Search existing templates:
    Glob: .claude/templates/**/*.md
  • Review template catalog: Read
    .claude/context/artifacts/catalogs/template-catalog.md
  • Check if similar template already exists in the ecosystem
  • If creating for a new domain, research best-practice template structures via WebSearch
BLOCKING: Template creation CANNOT proceed without research-synthesis invocation.
根据CLAUDE.md第3节要求,必须在创建模板前调用
research-synthesis
javascript
Skill({ skill: 'research-synthesis' });
模板相关的研究重点:
  • 搜索现有模板:
    Glob: .claude/templates/**/*.md
  • 查看模板目录:阅读
    .claude/context/artifacts/catalogs/template-catalog.md
  • 检查生态系统中是否已存在类似模板
  • 若为新领域创建模板,通过WebSearch研究最佳实践模板结构
阻塞规则: 未调用research-synthesis则无法继续创建模板。

Step 0.5: Companion Check

步骤0.5:配套检查

Before proceeding with creation, run the ecosystem companion check:
  1. Use
    companion-check.cjs
    from
    .claude/lib/creators/companion-check.cjs
  2. Call
    checkCompanions("template", "{template-name}")
    to identify companion artifacts
  3. Review the companion checklist — note which required/recommended companions are missing
  4. Plan to create or verify missing companions after this artifact is complete
  5. Include companion findings in post-creation integration notes
This step is informational (does not block creation) but ensures the full artifact ecosystem is considered.
在开始创建前,运行生态系统配套检查:
  1. 使用
    .claude/lib/creators/companion-check.cjs
    中的
    companion-check.cjs
  2. 调用
    checkCompanions("template", "{template-name}")
    识别配套工件
  3. 查看配套清单,记录缺失的必填/推荐配套项
  4. 规划在本工件完成后创建或验证缺失的配套项
  5. 将配套检查结果纳入创建后的集成说明
本步骤为信息性步骤(不阻塞创建),但需确保考虑完整的工件生态系统。

Step 1: Gather Requirements

步骤1:收集需求

Analyze the request:
  1. Template Type: Which category (spawn, agent, skill, workflow, report, code-style, document)?
  2. Purpose: What will this template be used for?
  3. Required Fields: What fields are mandatory?
  4. Optional Fields: What fields are optional with defaults?
  5. Validation Rules: What constraints apply?
  6. Consumers: Which creators/agents will use this template?
Example analysis:
Template Request: "Create a template for security audit reports"
- Type: Report
- Purpose: Standardize security audit report structure
- Required: findings, severity_levels, recommendations
- Optional: compliance_framework, remediation_timeline
- Rules: severity must be CRITICAL|HIGH|MEDIUM|LOW
- Consumers: security-architect, qa
分析请求:
  1. 模板类型:属于哪一类别(spawn、agent、skill、workflow、report、code-style、document)?
  2. 用途:该模板将用于什么场景?
  3. 必填字段:哪些字段是必填的?
  4. 可选字段:哪些字段是可选的,且有默认值?
  5. 验证规则:有哪些约束条件?
  6. 消费者:哪些创建者/Agent会使用该模板?
示例分析:
模板请求:"创建安全审计报告模板"
- 类型:Report
- 用途:标准化安全审计报告结构
- 必填字段:findings, severity_levels, recommendations
- 可选字段:compliance_framework, remediation_timeline
- 规则:严重程度必须为CRITICAL|HIGH|MEDIUM|LOW
- 消费者:security-architect, qa

Step 2: Template Type Classification

步骤2:模板类型分类

Classify the template to determine output path and validation rules:
TypeOutput PathKey FieldsValidation Focus
Spawn
.claude/templates/spawn/
subagent_type, prompt, model, task_idTaskUpdate protocol, allowed_tools, model
Agent
.claude/templates/agents/
name, description, tools, skills, model, enforcement_hooksFrontmatter completeness, alignment sections
Skill
.claude/templates/skills/
name, version, tools, invoked_bySKILL.md structure, memory protocol
Workflow
.claude/templates/workflows/
phases, agents, dependenciesPhase ordering, agent references
Report
.claude/templates/reports/
type, findings, recommendationsFinding severity, evidence requirements
Code Style
.claude/templates/code-styles/
language, conventions, examplesConvention clarity, example quality
Document
.claude/templates/
(root)
varies by template typeSection completeness
对模板进行分类,以确定输出路径和验证规则:
类型输出路径关键字段验证重点
Spawn
.claude/templates/spawn/
subagent_type, prompt, model, task_idTaskUpdate协议、允许使用的工具、模型
Agent
.claude/templates/agents/
name, description, tools, skills, model, enforcement_hooks前置元数据完整性、对齐章节
Skill
.claude/templates/skills/
name, version, tools, invoked_bySKILL.md结构、内存协议
Workflow
.claude/templates/workflows/
phases, agents, dependencies阶段顺序、Agent引用
Report
.claude/templates/reports/
type, findings, recommendations发现结果的严重程度、证据要求
Code Style
.claude/templates/code-styles/
language, conventions, examples约定清晰度、示例质量
Document
.claude/templates/
(根目录)
因模板类型而异章节完整性

Step 3: Name Validation (SEC-TC-003)

步骤3:名称验证(SEC-TC-003)

BEFORE constructing the output path, validate the template name.
Template name MUST match this regex:
/^[a-z0-9][a-z0-9-]*[a-z0-9]$/
Validation rules:
  • Lowercase letters, digits, and hyphens only
  • Must start and end with a letter or digit (not a hyphen)
  • No path separators (
    /
    ,
    \
    ), no
    ..
    , no special characters
  • No Windows reserved names (
    nul
    ,
    con
    ,
    prn
    ,
    aux
    ,
    com1
    -
    com9
    ,
    lpt1
    -
    lpt9
    )
Rejection examples:
REJECTED: "../hooks/malicious-hook"  (path traversal)
REJECTED: "My Template"             (spaces, uppercase)
REJECTED: "-leading-hyphen"         (starts with hyphen)
REJECTED: "template_with_underscores" (underscores not allowed)
ACCEPTED: "security-audit-report"   (valid kebab-case)
ACCEPTED: "agent-template-v2"       (valid with version)
在构建输出路径前,必须验证模板名称。
模板名称必须符合以下正则表达式:
/^[a-z0-9][a-z0-9-]*[a-z0-9]$/
验证规则:
  • 仅允许小写字母、数字和连字符
  • 必须以字母或数字开头和结尾(不能以连字符开头/结尾)
  • 禁止使用路径分隔符(
    /
    \
    )、
    ..
    或特殊字符
  • 禁止使用Windows保留名称(
    nul
    con
    prn
    aux
    com1
    -
    com9
    lpt1
    -
    lpt9
示例:
被驳回:"../hooks/malicious-hook"  (路径遍历风险)
被驳回:"My Template"             (包含空格和大写字母)
被驳回:"-leading-hyphen"         (以连字符开头)
被驳回:"template_with_underscores" (使用了下划线)
通过:"security-audit-report"   (有效的短横线命名)
通过:"agent-template-v2"       (包含版本号的有效命名)

Step 4: Determine Output Path

步骤4:确定输出路径

Based on the template type classification from Step 2, construct the output path:
.claude/templates/<category>/<validated-template-name>.md
Where
<category>
is one of:
spawn/
,
agents/
,
skills/
,
workflows/
,
reports/
,
code-styles/
, or root level (no category subdirectory).
Validate the resolved path:
  • Path MUST start with
    .claude/templates/
  • Path MUST NOT contain
    ..
    segments after normalization
  • Path MUST end with
    .md
根据步骤2的模板类型分类,构建输出路径:
.claude/templates/<category>/<validated-template-name>.md
其中
<category>
为以下之一:
spawn/
agents/
skills/
workflows/
reports/
code-styles/
,或根目录(无类别子目录)。
验证解析后的路径:
  • 路径必须以
    .claude/templates/
    开头
  • 路径经过规范化后不得包含
    ..
  • 路径必须以
    .md
    结尾

Step 5: Content Design

步骤5:内容设计

Design the template content following these standards:
按照以下标准设计模板内容:

Placeholder Format Standard

占位符格式标准

Placeholder TypeFormatExample
Required field
{{FIELD_NAME}}
{{AGENT_NAME}}
Optional field
{{FIELD_NAME:default}}
{{MODEL:sonnet}}
Multi-line
{{FIELD_NAME_BLOCK}}
{{DESCRIPTION_BLOCK}}
List item
{{ITEM_N}}
{{TOOL_1}}
,
{{TOOL_2}}
占位符类型格式示例
必填字段
{{FIELD_NAME}}
{{AGENT_NAME}}
可选字段
{{FIELD_NAME:default}}
{{MODEL:sonnet}}
多行内容
{{FIELD_NAME_BLOCK}}
{{DESCRIPTION_BLOCK}}
列表项
{{ITEM_N}}
{{TOOL_1}}
,
{{TOOL_2}}

Template Structure

模板结构

markdown
---
markdown
---

YAML Frontmatter with all required fields

YAML前置元数据,包含所有必填字段

name: { { NAME } } description: { { DESCRIPTION } }
name: { { NAME } } description: { { DESCRIPTION } }

... other fields with documentation comments

... 其他带文档注释的字段



{{DISPLAY_NAME}}

{{DISPLAY_NAME}}

POST-CREATION CHECKLIST (BLOCKING - DO NOT SKIP)

创建后检查清单(阻塞步骤 - 请勿跳过)

<!-- Always include blocking checklist -->
<!-- 始终包含阻塞性检查清单 -->

Overview

概述

{{OVERVIEW_DESCRIPTION}}
{{OVERVIEW_DESCRIPTION}}

Sections

章节

<!-- Domain-specific sections -->
<!-- 领域相关章节 -->

Memory Protocol (MANDATORY)

内存协议(强制要求)

<!-- Always include memory protocol -->
undefined
<!-- 始终包含内存协议章节 -->
undefined

Security Checklist for Spawn Templates (SEC-TC-001)

Spawn模板安全检查清单(SEC-TC-001)

If creating a SPAWN template, you MUST also verify:
  • No
    {{PLACEHOLDER}}
    tokens inside
    prompt:
    fields that accept unsanitized user input
  • Reference to
    sanitizeSubstitutionValue()
    from
    prompt-factory.cjs
    included in documentation
  • TaskUpdate protocol is present in the spawn prompt body
  • allowed_tools
    array does not grant
    Task
    tool to non-orchestrator agents
  • No prompt override patterns (
    IGNORE PREVIOUS
    ,
    SYSTEM:
    , etc.) in template body
  • Template size under 50KB
若创建SPAWN模板,必须验证以下内容:
  • prompt:
    字段中没有接受未清理用户输入的
    {{PLACEHOLDER}}
    令牌
  • 文档中引用了
    prompt-factory.cjs
    中的
    sanitizeSubstitutionValue()
  • 启动提示正文中包含TaskUpdate协议
  • allowed_tools
    数组未给非编排类Agent授予
    Task
    工具权限
  • 模板正文中没有提示覆盖模式(
    IGNORE PREVIOUS
    SYSTEM:
    等)
  • 模板大小小于50KB

Documentation Comments

文档注释

Add inline documentation for each placeholder:
markdown
---
为每个占位符添加内联文档:
markdown
---

[REQUIRED] Unique identifier, lowercase-with-hyphens

[必填] 唯一标识符,使用小写字母加连字符

name: { { AGENT_NAME } }
name: { { AGENT_NAME } }

[REQUIRED] Single line, describes what it does AND when to use it

[必填] 单行文本,说明其功能及使用场景

Example: "Reviews mobile app UX against Apple HIG. Use for iOS UX audits."

示例:"根据Apple HIG审核移动应用UX。用于iOS UX审核场景。"

description: { { DESCRIPTION } }
description: { { DESCRIPTION } }

[OPTIONAL] Default: sonnet. Options: haiku, sonnet, opus

[可选] 默认值:sonnet。可选值:haiku, sonnet, opus

model: { { MODEL:sonnet } }

undefined

model: { { MODEL:sonnet } }

undefined

Step 6: Write Template File

步骤6:编写模板文件

Write to the validated output path determined in Step 4:
bash
Write: .claude/templates/<category>/<template-name>.md
写入步骤4中确定的验证后的输出路径:
bash
Write: .claude/templates/<category>/<template-name>.md

Step 7: Validate Template Structure (BLOCKING)

步骤7:验证模板结构(阻塞步骤)

Before proceeding to registration, verify ALL requirements:
Structural Validation:
[ ] YAML frontmatter is valid syntax
[ ] All required fields have placeholders
[ ] All placeholders follow {{UPPER_CASE}} naming convention
[ ] All placeholders have documentation comments
[ ] POST-CREATION CHECKLIST section present
[ ] Memory Protocol section present
[ ] Verification commands included
[ ] Example values provided where helpful
Security Validation (SEC-TC-007):
[ ] No secrets, credentials, or API keys in template content
[ ] No absolute file paths (use relative from PROJECT_ROOT)
[ ] No eval(), exec(), Function() or code execution patterns
[ ] No prompt override patterns ("IGNORE PREVIOUS", "SYSTEM:", etc.)
[ ] Template size under 50KB
Verification Commands:
bash
undefined
在进行注册前,验证所有要求:
结构验证:
[ ] YAML前置元数据语法有效
[ ] 所有必填字段都有占位符
[ ] 所有占位符遵循{{UPPER_CASE}}命名规范
[ ] 所有占位符都有文档注释
[ ] 存在创建后检查清单章节
[ ] 存在内存协议章节
[ ] 包含验证命令
[ ] 提供示例值(若有帮助)
安全验证(SEC-TC-007):
[ ] 模板内容中无机密信息、凭证或API密钥
[ ] 无绝对文件路径(使用相对于PROJECT_ROOT的相对路径)
[ ] 无eval()、exec()、Function()或其他代码执行模式
[ ] 无提示覆盖模式("IGNORE PREVIOUS"、"SYSTEM:"等)
[ ] 模板大小小于50KB
验证命令:
bash
undefined

Check no unresolved placeholders from template-creator itself

检查是否存在来自template-creator自身的未解析占位符

grep "{{" <created-file> | head -5 # Should show only intended placeholders
grep "{{" <created-file> | head -5 # 应仅显示预期的占位符

Check YAML frontmatter is present

检查YAML前置元数据是否存在

head -50 <file> | grep -E "^---$" | wc -l # Should be 2
head -50 <file> | grep -E "^---$" | wc -l # 结果应为2

Check required sections present

检查是否存在必填章节

grep -E "^## Memory Protocol" <file> || echo "ERROR: Missing Memory Protocol!"

**BLOCKING**: Template must pass ALL validation checks before proceeding.
grep -E "^## Memory Protocol" <file> || echo "ERROR: 缺少内存协议章节!"

**阻塞规则:** 模板必须通过所有验证检查才能继续。

Step 8: Update Template Catalog (MANDATORY - BLOCKING)

步骤8:更新模板目录(强制要求 - 阻塞步骤)

Update the template catalog to ensure the new template is discoverable.
  1. Read current catalog:
    bash
    cat .claude/context/artifacts/catalogs/template-catalog.md
  2. Determine template category based on type:
    • Spawn (
      spawn/
      ), Creator (
      agents/
      ,
      skills/
      ,
      workflows/
      ), Document (root), Report (
      reports/
      ), Code Style (
      code-styles/
      )
  3. Add template entry in correct category section:
    markdown
    ### <template-name>.md
    
    | Field              | Value                                             |
    | ------------------ | ------------------------------------------------- |
    | **Path**           | `.claude/templates/<category>/<template-name>.md` |
    | **Category**       | <Category> Templates                              |
    | **Status**         | active                                            |
    | **Used By Agents** | <agent-list>                                      |
    | **Used By Skills** | <skill-list>                                      |
    
    **Purpose:** <Purpose description>
  4. Update Template Categories Summary table (totals row)
  5. Verify update:
    bash
    grep "<template-name>" .claude/context/artifacts/catalogs/template-catalog.md || echo "ERROR: CATALOG NOT UPDATED!"
Important: Use
JSON.stringify()
when constructing any JSON registry entries (SEC-TC-004). Never manually concatenate strings to build JSON. The
location
field MUST be validated to start with
.claude/templates/
and contain no
..
segments.
BLOCKING: Template must appear in catalog. Uncataloged templates are invisible.
更新模板目录,确保新模板可被发现。
  1. 读取当前目录:
    bash
    cat .claude/context/artifacts/catalogs/template-catalog.md
  2. 根据类型确定模板类别
    • Spawn(
      spawn/
      )、Creator(
      agents/
      skills/
      workflows/
      )、Document(根目录)、Report(
      reports/
      )、Code Style(
      code-styles/
  3. 在对应类别章节添加模板条目:
    markdown
    ### <template-name>.md
    
    | 字段              ||
    | ------------------ | ------------------------------------------------- |
    | **路径**           | `.claude/templates/<category>/<template-name>.md` |
    | **类别**       | <Category> 模板                              |
    | **状态**         | 活跃                                            |
    | **被Agent使用** | <agent列表>                                      |
    | **被Skill使用** | <skill列表>                                      |
    
    **用途:** <用途描述>
  4. 更新模板类别汇总表(总计行)
  5. 验证更新:
    bash
    grep "<template-name>" .claude/context/artifacts/catalogs/template-catalog.md || echo "ERROR: 目录未更新!"
重要提示: 构建任何JSON注册表条目时请使用
JSON.stringify()
(SEC-TC-004)。请勿手动拼接字符串构建JSON。
location
字段必须验证为以
.claude/templates/
开头且不包含
..
段。
阻塞规则: 模板必须出现在目录中。未录入目录的模板不可见。

Step 9: Update Templates README (MANDATORY - BLOCKING)

步骤9:更新Templates README(强制要求 - 阻塞步骤)

After updating the catalog, update
.claude/templates/README.md
:
  1. Add to appropriate section (or create new section)
  2. Document usage instructions
  3. Add to Quick Reference table
Entry format:
markdown
undefined
更新目录后,更新
.claude/templates/README.md
  1. 添加到对应章节(或创建新章节)
  2. 记录使用说明
  3. 添加到快速参考表
条目格式:
markdown
undefined

{{Template Type}} Templates (
{{directory}}/
)

{{模板类型}} 模板(
{{directory}}/

Use when {{use case}}.
File:
{{directory}}/{{template-name}}.md
Usage:
  1. Copy template to
    {{target-path}}
  2. Replace all
    {{PLACEHOLDER}}
    values
  3. {{Additional steps}}

**Verification:**

```bash
grep "<template-name>" .claude/templates/README.md || echo "ERROR: README NOT UPDATED - BLOCKING!"
BLOCKING: README must contain the template entry.
适用于{{使用场景}}。
文件:
{{directory}}/{{template-name}}.md
使用方法:
  1. 将模板复制到
    {{target-path}}
  2. 替换所有
    {{PLACEHOLDER}}
  3. {{额外步骤}}

**验证:**

```bash
grep "<template-name>" .claude/templates/README.md || echo "ERROR: README未更新 - 阻塞步骤!"
阻塞规则: README必须包含该模板条目。

Step 10: Update CLAUDE.md (CONDITIONAL - BLOCKING)

步骤10:更新CLAUDE.md(条件性 - 阻塞步骤)

If the template is framework-significant or user-invocable:
  1. Check if template needs CLAUDE.md entry:
    • Is it a new spawn template? -> Update Section 2 (Spawn Templates)
    • Is it a new creator template? -> Update relevant creator section
    • Is it a user-invocable template? -> Update Section 8.5
  2. If YES, add entry:
    markdown
    **{Template Name}:** `.claude/templates/{category}/{name}.md`
  3. Verify:
    bash
    grep "<template-name>" .claude/CLAUDE.md || echo "WARNING: Template not in CLAUDE.md (may be OK if internal-only)"
Note: Not all templates need CLAUDE.md entries. Only framework-significant ones (spawn templates, creator templates) require this step.
若模板为框架核心或支持用户调用:
  1. 检查是否需要在CLAUDE.md中添加条目:
    • 是否为新的Spawn模板? -> 更新第2节(Spawn模板)
    • 是否为新的Creator模板? -> 更新对应的Creator章节
    • 是否为用户可调用的模板? -> 更新第8.5节
  2. 若需要,添加条目:
    markdown
    **{模板名称}:** `.claude/templates/{category}/{name}.md`
  3. 验证:
    bash
    grep "<template-name>" .claude/CLAUDE.md || echo "警告:模板未录入CLAUDE.md(若为内部模板则可忽略)"
注意: 并非所有模板都需要录入CLAUDE.md。仅框架核心模板(Spawn模板、Creator模板)需要执行此步骤。

Step 11: Assign Consumer Agents

步骤11:分配消费者Agent

Templates exist to be consumed by creators and agents. After creation:
  1. Identify consumers based on template type:
    • Agent templates -> agent-creator skill should reference
    • Skill templates -> skill-creator skill should reference
    • Workflow templates -> workflow-creator skill should reference
    • Report templates -> relevant agents (qa, developer, etc.)
    • Spawn templates -> router documentation, spawn-template-resolver
    • Code style templates -> developer, code-reviewer
  2. Update consuming skill/agent to reference the template:
    markdown
    **Available Templates:**
    
    - See `.claude/templates/<category>/<template-name>.md` for standardized <type> template
  3. Verify at least one consumer references the template:
    bash
    grep -r "<template-name>" .claude/skills/ .claude/agents/ || echo "WARNING: No consumer references template"
WHY: Templates without consumers are dead on arrival. Every template MUST have at least one consuming skill or agent.
模板的存在意义是被创建者和Agent消费。创建完成后:
  1. 根据模板类型识别消费者:
    • Agent模板 -> agent-creator Skill应引用该模板
    • Skill模板 -> skill-creator Skill应引用该模板
    • 工作流模板 -> workflow-creator Skill应引用该模板
    • 报告模板 -> 相关Agent(qa、developer等)
    • Spawn模板 -> router文档、spawn-template-resolver
    • 代码风格模板 -> developer、code-reviewer
  2. 更新消费型Skill/Agent以引用该模板:
    markdown
    **可用模板:**
    
    - 标准化<类型>模板请查看`.claude/templates/<category>/<template-name>.md`
  3. 验证至少有一个消费者引用了该模板:
    bash
    grep -r "<template-name>" .claude/skills/ .claude/agents/ || echo "警告:无消费者引用该模板"
原因: 没有消费者的模板毫无用处。每个模板必须至少被一个消费型Skill或Agent引用。

Step 12: Integration Verification (BLOCKING - DO NOT SKIP)

步骤12:集成验证(阻塞步骤 - 请勿跳过)

This step verifies the artifact is properly integrated into the ecosystem.
Before calling
TaskUpdate({ status: "completed" })
, run the post-creation validation:
  1. Run the integration checklist:
    bash
    node .claude/tools/cli/validate-integration.cjs .claude/templates/<category>/<template-name>.md
  2. Verify exit code is 0 (all checks passed)
  3. If exit code is 1 (one or more checks failed):
    • Read the error output for specific failures
    • Fix each failure:
      • Missing README entry -> Add to
        .claude/templates/README.md
      • Missing catalog entry -> Add to
        template-catalog.md
      • Missing memory update -> Update
        learnings.md
    • Re-run validation until exit code is 0
  4. Only proceed when validation passes
This step is BLOCKING. Do NOT mark task complete until validation passes.
Why this matters: The Party Mode incident showed that fully-implemented artifacts can be invisible to the Router if integration steps are missed. This validation ensures no "invisible artifact" pattern.
Reference:
.claude/workflows/core/post-creation-validation.md
此步骤验证工件是否已正确集成到生态系统中。
在调用
TaskUpdate({ status: "completed" })
前,运行创建后验证:
  1. 运行集成检查清单:
    bash
    node .claude/tools/cli/validate-integration.cjs .claude/templates/<category>/<template-name>.md
  2. 验证退出码为0(所有检查通过)
  3. 若退出码为1(一项或多项检查失败):
    • 读取错误输出查看具体失败项
    • 修复每个失败项:
      • 缺少README条目 -> 添加到
        .claude/templates/README.md
      • 缺少目录条目 -> 添加到
        template-catalog.md
      • 缺少内存更新 -> 更新
        learnings.md
    • 重新运行验证直到退出码为0
  4. 仅在验证通过后继续
此步骤为阻塞步骤。 验证通过前请勿标记任务完成。
重要性: "派对模式"事件表明,若遗漏集成步骤,即使完全实现的工件也可能对Router不可见。此验证确保不会出现"不可见工件"问题。
参考:
.claude/workflows/core/post-creation-validation.md

Step 13: Completion Checklist (BLOCKING)

步骤13:完成检查清单(阻塞步骤)

All items MUST pass before template creation is complete:
[ ] Research-synthesis skill invoked (Step 0)
[ ] Existence check passed (no duplicate template)
[ ] Template name validates against /^[a-z0-9][a-z0-9-]*[a-z0-9]$/ (Step 3)
[ ] Template file created at .claude/templates/<category>/<name>.md
[ ] All placeholders use {{PLACEHOLDER_NAME}} format
[ ] All placeholders have documentation comments
[ ] POST-CREATION CHECKLIST section present in template
[ ] Memory Protocol section present in template
[ ] No hardcoded values (all configurable via placeholders)
[ ] No secrets, credentials, or absolute paths in template (SEC-TC-007)
[ ] No eval() or code execution patterns in template
[ ] template-catalog.md updated with structured entry (Step 8)
[ ] .claude/templates/README.md updated with template entry (Step 9)
[ ] CLAUDE.md updated if template is framework-significant (Step 10)
[ ] At least one consuming skill/agent references the template (Step 11)
[ ] Integration verification passed (Step 12)
[ ] Template tested with at least one real usage
[ ] Memory files updated (learnings.md)
BLOCKING: If ANY item fails, template creation is INCOMPLETE. Fix all issues before proceeding.

所有项必须通过才能完成模板创建:
[ ] 已调用research-synthesis Skill(步骤0)
[ ] 存在性检查通过(无重复模板)
[ ] 模板名称符合/^[a-z0-9][a-z0-9-]*[a-z0-9]$/(步骤3)
[ ] 模板文件已创建于.claude/templates/<category>/<name>.md
[ ] 所有占位符使用{{PLACEHOLDER_NAME}}格式
[ ] 所有占位符都有文档注释
[ ] 模板中存在创建后检查清单章节
[ ] 模板中存在内存协议章节
[ ] 无硬编码值(所有配置都通过占位符实现)
[ ] 模板中无机密信息、凭证或绝对路径(SEC-TC-007)
[ ] 模板中无eval()或代码执行模式
[ ] template-catalog.md已添加结构化条目(步骤8)
[ ] .claude/templates/README.md已添加模板条目(步骤9)
[ ] 若模板为框架核心,已更新CLAUDE.md(步骤10)
[ ] 至少有一个消费型Skill/Agent引用了该模板(步骤11)
[ ] 集成验证通过(步骤12)
[ ] 已用至少一个真实场景测试模板
[ ] 已更新内存文件(learnings.md)
阻塞规则: 若有任何一项未通过,模板创建未完成。修复所有问题后再继续。

Architecture Compliance

架构合规

File Placement (ADR-076)

文件放置(ADR-076)

  • Templates:
    .claude/templates/{category}/
    (spawn, agents, skills, workflows, reports, code-styles)
  • Archived templates:
    .claude/templates/_archive/
  • Template catalog:
    .claude/context/artifacts/catalogs/template-catalog.md
  • Tests:
    tests/
    (NOT in
    .claude/
    )
  • 模板:
    .claude/templates/{category}/
    (spawn、agents、skills、workflows、reports、code-styles)
  • 已归档模板:
    .claude/templates/_archive/
  • 模板目录:
    .claude/context/artifacts/catalogs/template-catalog.md
  • 测试:
    tests/
    (不在
    .claude/
    目录下)

Documentation References (CLAUDE.md v2.2.1)

文档参考(CLAUDE.md v2.2.1)

  • Reference files use @notation: @TOOL_REFERENCE.md, @SKILL_CATALOG_TABLE.md
  • Located in:
    .claude/docs/@*.md
  • See: CLAUDE.md Section 2 (Spawn Templates)
  • 参考文件使用@标记:@TOOL_REFERENCE.md、@SKILL_CATALOG_TABLE.md
  • 存储位置:
    .claude/docs/@*.md
  • 查看:CLAUDE.md第2节(Spawn模板)

Shell Security (ADR-077)

Shell安全(ADR-077)

  • Spawn templates MUST include:
    cd "$PROJECT_ROOT" || exit 1
    for background tasks
  • Environment variables control validators (block/warn/off mode)
  • See:
    .claude/docs/SHELL-SECURITY-GUIDE.md
  • Apply to: all spawn templates, background task templates
  • Spawn模板必须包含:
    cd "$PROJECT_ROOT" || exit 1
    (用于后台任务)
  • 环境变量控制验证器(阻塞/警告/关闭模式)
  • 查看:
    .claude/docs/SHELL-SECURITY-GUIDE.md
  • 适用范围:所有Spawn模板、后台任务模板

Security Compliance (ADR-085, ADR-086, SEC-TMPL-006)

安全合规(ADR-085、ADR-086、SEC-TMPL-006)

  • Templates MUST NOT include hardcoded secrets, credentials, or API keys
  • Templates MUST use relative paths (
    .claude/templates/...
    ), never absolute paths
  • Templates MUST NOT expose internal system paths or user directories
  • Retention mandates: security-design-checklist.md and error-recovery-template.md must remain at designated locations
  • Spawn template placeholder sanitization: reference
    sanitizeSubstitutionValue()
    in
    prompt-factory.cjs
  • 模板不得包含硬编码的机密信息、凭证或API密钥
  • 模板必须使用相对路径(
    .claude/templates/...
    ),禁止使用绝对路径
  • 模板不得暴露内部系统路径或用户目录
  • 保留要求:security-design-checklist.md和error-recovery-template.md必须保留在指定位置
  • Spawn模板占位符清理:引用
    prompt-factory.cjs
    中的
    sanitizeSubstitutionValue()

Recent ADRs

最新ADR

  • ADR-075: Router Config-Aware Model Selection
  • ADR-076: File Placement Architecture Redesign
  • ADR-077: Shell Command Security Architecture
  • ADR-085: Template System Overhaul (spawn resolver + dead template cleanup)
  • ADR-086: Template-Creator Overhaul to v2.1 Creator Standard

  • ADR-075:Router配置感知模型选择
  • ADR-076:文件放置架构重设计
  • ADR-077:Shell命令安全架构
  • ADR-085:模板系统全面升级(spawn解析器 + 废弃模板清理)
  • ADR-086:Template-Creator升级到v2.1 Creator标准

Iron Laws of Template Creation

模板创建铁律

These rules are INVIOLABLE. Breaking them causes inconsistency across the framework.
1. NO TEMPLATE WITHOUT PLACEHOLDER DOCUMENTATION
   - Every {{PLACEHOLDER}} must have an inline comment
   - Comments explain valid values and examples

2. NO TEMPLATE WITHOUT POST-CREATION CHECKLIST
   - Users must know what to do after using template
   - Blocking steps prevent incomplete artifacts

3. NO TEMPLATE WITHOUT MEMORY PROTOCOL
   - All templates must include Memory Protocol section
   - Ensures artifacts created from template follow memory rules

4. NO TEMPLATE WITHOUT README UPDATE
   - Templates README must document new template
   - Undocumented templates are invisible

5. NO PLACEHOLDER WITHOUT NAMING CONVENTION
   - Use {{UPPER_CASE_WITH_UNDERSCORES}}
   - Never use lowercase or mixed case

6. NO OPTIONAL FIELD WITHOUT DEFAULT
   - Format: {{FIELD:default_value}}
   - Makes templates usable without full customization

7. NO TEMPLATE WITHOUT VERIFICATION COMMANDS
   - Include commands to validate created artifacts
   - Users can verify their work is correct

8. NO AGENT TEMPLATE WITHOUT ALIGNMENT SECTIONS
   - Agent templates MUST include {{ENFORCEMENT_HOOKS}} placeholder section
   - Agent templates MUST include {{RELATED_WORKFLOWS}} placeholder section
   - Agent templates MUST include Output Standards block referencing workspace-conventions
   - Reference: @HOOK_AGENT_MAP.md and @WORKFLOW_AGENT_MAP.md for archetype sets

9. NO TEMPLATE WITHOUT CATALOG ENTRY
   - Every template MUST be registered in template-catalog.md
   - Uncataloged templates are invisible to the system
   - Verify: grep "<template-name>" .claude/context/artifacts/catalogs/template-catalog.md

10. NO TEMPLATE WITHOUT CONSUMING SKILL/AGENT
    - Every template MUST be referenced by at least one consuming skill or agent
    - Templates without consumers are dead on arrival
    - Verify: grep -r "<template-name>" .claude/skills/ .claude/agents/

11. NO CREATION WITHOUT RESEARCH-SYNTHESIS
    - Per CLAUDE.md Section 3, research-synthesis MUST be invoked before any creator
    - Template creation is no exception
    - Invoke: Skill({ skill: 'research-synthesis' })

这些规则不可违反。违反会导致框架不一致。
1. 无占位符文档的模板一律不允许存在
   - 每个{{PLACEHOLDER}}必须有内联注释
   - 注释说明有效值和示例

2. 无创建后检查清单的模板一律不允许存在
   - 用户必须知道使用模板后要做什么
   - 阻塞步骤防止工件不完整

3. 无内存协议的模板一律不允许存在
   - 所有模板必须包含内存协议章节
   - 确保从模板创建的工件遵循内存规则

4. 未更新README的模板一律不允许存在
   - Templates README必须记录新模板
   - 未文档化的模板不可见

5. 不符合命名规范的占位符一律不允许存在
   - 使用{{UPPER_CASE_WITH_UNDERSCORES}}
   - 禁止使用小写或混合大小写

6. 无默认值的可选字段一律不允许存在
   - 格式:{{FIELD:default_value}}
   - 无需完全自定义即可使用模板

7. 无验证命令的模板一律不允许存在
   - 包含验证创建后工件的命令
   - 用户可验证自己的工作是否正确

8. 无对齐章节的Agent模板一律不允许存在
   - Agent模板必须包含{{ENFORCEMENT_HOOKS}}占位符章节
   - Agent模板必须包含{{RELATED_WORKFLOWS}}占位符章节
   - Agent模板必须包含引用workspace-conventions的输出标准块
   - 参考:@HOOK_AGENT_MAP.md和@WORKFLOW_AGENT_MAP.md中的原型集

9. 未录入目录的模板一律不允许存在
   - 每个模板必须在template-catalog.md中注册
   - 未录入目录的模板对系统不可见
   - 验证方式:grep "<template-name>" .claude/context/artifacts/catalogs/template-catalog.md

10. 无消费型Skill/Agent引用的模板一律不允许存在
    - 每个模板必须至少被一个消费型Skill或Agent引用
    - 没有消费者的模板毫无用处
    - 验证方式:grep -r "<template-name>" .claude/skills/ .claude/agents/

11. 未做研究的模板创建一律不允许存在
    - 根据CLAUDE.md第3节,任何创建者必须先调用research-synthesis
    - 模板创建也不例外
    - 调用方式:Skill({ skill: 'research-synthesis' })

Reference Template

参考模板

Use
.claude/templates/spawn/universal-agent-spawn.md
as the canonical reference template.
Before finalizing any template, compare:
  • Has clear placeholder documentation
  • Placeholders are UPPERCASE with underscores
  • Has usage examples section
  • Has integration notes
  • Has POST-CREATION CHECKLIST
  • Has Memory Protocol

请将
.claude/templates/spawn/universal-agent-spawn.md
作为标准参考模板。
在最终确定任何模板前,对比检查:
  • 有清晰的占位符文档
  • 占位符为大写加下划线格式
  • 有使用示例章节
  • 有集成说明
  • 有创建后检查清单
  • 有内存协议

Template Best Practices

模板最佳实践

Placeholder Standards

占位符标准

PracticeGoodBad
Naming
{{AGENT_NAME}}
{{name}}
,
{AGENT_NAME}
Required fieldsAlways presentSometimes omitted
Optional fields
{{FIELD:default}}
No default indicator
DocumentationInline commentsSeparate docs file
ExamplesIn commentsNone provided
实践规范示例不规范示例
命名
{{AGENT_NAME}}
{{name}}
,
{AGENT_NAME}
必填字段始终存在有时会遗漏
可选字段
{{FIELD:default}}
无默认值标识
文档说明内联注释单独的文档文件
示例注释中包含示例无示例

Structure Standards

结构标准

  1. YAML Frontmatter First
    • All machine-readable metadata
    • Comments explaining each field
  2. POST-CREATION CHECKLIST Second
    • Blocking steps after using template
    • Verification commands
  3. Content Sections
    • Follow existing pattern for type
    • Include all required sections
  4. Memory Protocol Last
    • Standard format across all templates
    • Always present
  1. YAML前置元数据优先
    • 所有机器可读的元数据
    • 每个字段都有注释说明
  2. 创建后检查清单次之
    • 使用模板后的阻塞步骤
    • 验证命令
  3. 内容章节
    • 遵循对应类型的现有模式
    • 包含所有必填章节
  4. 内存协议最后
    • 所有模板使用标准格式
    • 始终存在

Validation Examples

验证示例

Include validation examples in templates:
markdown
undefined
在模板中包含验证示例:
markdown
undefined

Validation

验证

After replacing placeholders, validate:
bash
undefined
替换占位符后,执行以下验证:
bash
undefined

Check YAML is valid

检查YAML是否有效

head -50 <file> | grep -E "^---$" | wc -l # Should be 2
head -50 <file> | grep -E "^---$" | wc -l # 结果应为2

Check no unresolved placeholders

检查是否有未解析的占位符

grep "{{" <file> && echo "ERROR: Unresolved placeholders!"
grep "{{" <file> && echo "ERROR: 存在未解析的占位符!"

Check required sections present

检查是否存在必填章节

grep -E "^## Memory Protocol" <file> || echo "ERROR: Missing Memory Protocol!"
undefined

grep -E "^## Memory Protocol" <file> || echo "ERROR: 缺少内存协议章节!"
undefined

System Impact Analysis (MANDATORY)

系统影响分析(强制要求)

After creating a template, complete this 7-point analysis:
[TEMPLATE-CREATOR] System Impact Analysis for: <template-name>

1. README UPDATE (MANDATORY - Step 9)
   - Added to .claude/templates/README.md
   - Usage instructions documented
   - Quick Reference table updated

2. CATALOG UPDATE (MANDATORY - Step 8)
   - Added to .claude/context/artifacts/catalogs/template-catalog.md
   - Category, status, agents, skills documented
   - Purpose clearly stated

3. CLAUDE.MD UPDATE (CONDITIONAL - Step 10)
   - Is template framework-significant? If yes, add to CLAUDE.md
   - Spawn templates -> Section 2
   - Creator templates -> relevant creator section
   - User-invocable -> Section 8.5

4. CONSUMER ASSIGNMENT (MANDATORY - Step 11)
   - Which skills/agents consume this template?
   - Is template reference added to consuming creator skill?
   - Verify with grep across skills/ and agents/

5. RELATED TEMPLATES CHECK
   - Does this template supersede an existing one?
   - Are there related templates that need cross-references?
   - Should archived templates be updated or removed?

6. SECURITY COMPLIANCE (SEC-TMPL-006, SEC-TC-001, SEC-TC-007)
   - No secrets, credentials, or absolute paths
   - Relative paths only
   - Retention mandates respected
   - Spawn template placeholders sanitized

7. MEMORY UPDATE
   - Record creation in learnings.md
   - Document any decisions in decisions.md

创建模板后,完成以下7点分析:
[TEMPLATE-CREATOR] 系统影响分析:<template-name>

1. README更新(强制要求 - 步骤9)
   - 已添加到.claude/templates/README.md
   - 已记录使用说明
   - 已更新快速参考表

2. 目录更新(强制要求 - 步骤8)
   - 已添加到.claude/context/artifacts/catalogs/template-catalog.md
   - 已记录类别、状态、Agent、Skill
   - 已清晰说明用途

3. CLAUDE.MD更新(条件性 - 步骤10)
   - 模板是否为框架核心?若是,添加到CLAUDE.md
   - Spawn模板 -> 第2节
   - Creator模板 -> 对应Creator章节
   - 用户可调用 -> 第8.5节

4. 消费者分配(强制要求 - 步骤11)
   - 哪些Skill/Agent会消费该模板?
   - 消费型Creator Skill是否已引用该模板?
   - 通过在skills/和agents/目录下grep验证

5. 相关模板检查
   - 该模板是否取代了现有模板?
   - 是否有相关模板需要添加交叉引用?
   - 已归档的模板是否需要更新或移除?

6. 安全合规(SEC-TMPL-006、SEC-TC-001、SEC-TC-007)
   - 无机密信息、凭证或绝对路径
   - 仅使用相对路径
   - 遵守保留要求
   - Spawn模板占位符已做清理

7. 内存更新
   - 在learnings.md中记录创建信息
   - 在decisions.md中记录决策

Workflow Integration

工作流集成

This skill is part of the unified artifact lifecycle. For complete multi-agent orchestration:
Router Decision:
.claude/workflows/core/router-decision.md
  • How the Router discovers and invokes this skill's artifacts
Artifact Lifecycle:
.claude/workflows/core/skill-lifecycle.md
  • Discovery, creation, update, deprecation phases
  • Version management and registry updates
  • CLAUDE.md integration requirements
External Integration:
.claude/workflows/core/external-integration.md
  • Safe integration of external artifacts
  • Security review and validation phases
Spawn Template Resolver:
.claude/lib/spawn/spawn-template-resolver.cjs
  • Programmatic template selection for spawn operations
  • Template scoring and fallback logic

本Skill是统一工件生命周期的一部分。完整的多代理编排请参考:
Router决策:
.claude/workflows/core/router-decision.md
  • Router如何发现并调用本Skill的工件
工件生命周期:
.claude/workflows/core/skill-lifecycle.md
  • 发现、创建、更新、弃用阶段
  • 版本管理和注册表更新
  • CLAUDE.md集成要求
外部集成:
.claude/workflows/core/external-integration.md
  • 外部工件的安全集成
  • 安全审查和验证阶段
Spawn模板解析器:
.claude/lib/spawn/spawn-template-resolver.cjs
  • 启动操作的程序化模板选择
  • 模板评分和回退逻辑

Cross-Reference: Creator Ecosystem

交叉参考:Creator生态系统

This skill is part of the Creator Ecosystem. Use companion creators when needed:
CreatorWhen to UseInvocation
agent-creatorTemplate needs agent integration
Skill({ skill: 'agent-creator' })
skill-creatorTemplate needs skill integration
Skill({ skill: 'skill-creator' })
workflow-creatorTemplate needs workflow patterns
Skill({ skill: 'workflow-creator' })
schema-creatorTemplate needs JSON schemas
Skill({ skill: 'schema-creator' })
hook-creatorTemplate needs hooks
Skill({ skill: 'hook-creator' })
本Skill是Creator生态系统的一部分。需要时可使用配套创建者:
创建者使用场景调用方式
agent-creator模板需要Agent集成
Skill({ skill: 'agent-creator' })
skill-creator模板需要Skill集成
Skill({ skill: 'skill-creator' })
workflow-creator模板需要工作流模式
Skill({ skill: 'workflow-creator' })
schema-creator模板需要JSON schema
Skill({ skill: 'schema-creator' })
hook-creator模板需要钩子
Skill({ skill: 'hook-creator' })

Integration Workflow

集成工作流

After creating a template that needs additional artifacts:
javascript
// 1. Template created for new hook type
// 2. Need to create example hook using template
Skill({ skill: 'hook-creator' });

// 3. Template created for new agent category
// 4. Need to update agent-creator to recognize new category
// Edit .claude/skills/agent-creator/SKILL.md to add category
创建需要额外工件的模板后:
javascript
// 1. 为新钩子类型创建模板
// 2. 需要使用模板创建示例钩子
Skill({ skill: 'hook-creator' });

// 3. 为新Agent类别创建模板
// 4. 需要更新agent-creator以识别新类别
// 编辑.claude/skills/agent-creator/SKILL.md添加类别

Post-Creation Checklist for Ecosystem Integration

生态系统集成创建后检查清单

After template is fully created and validated:
[ ] Does template need a companion skill? -> Use skill-creator
[ ] Does template need a companion workflow? -> Use workflow-creator
[ ] Does template supersede an existing template? -> Archive old one
[ ] Should template be part of enterprise workflows? -> Update Section 8.6
[ ] Does template interact with spawn-template-resolver? -> Update resolver config

模板完全创建并验证后:
[ ] 模板是否需要配套Skill? -> 使用skill-creator
[ ] 模板是否需要配套工作流? -> 使用workflow-creator
[ ] 模板是否取代了现有模板? -> 归档旧模板
[ ] 模板是否应纳入企业工作流? -> 更新第8.6节
[ ] 模板是否与spawn-template-resolver交互? -> 更新解析器配置

File Placement & Standards

文件放置与标准

Output Location Rules

输出位置规则

This skill outputs to:
.claude/templates/
Subdirectories by type:
  • spawn/
    - Agent spawn prompt templates (4 templates)
  • agents/
    - Agent definition templates (2 templates)
  • skills/
    - Skill definition templates (1 template)
  • workflows/
    - Workflow definition templates (1 template)
  • reports/
    - Report document templates (5 templates)
  • code-styles/
    - Language style guides (3 templates)
  • Root level - General document templates (8+ templates)
  • _archive/
    - Archived/deprecated templates (14 templates)
本Skill的输出位置:
.claude/templates/
按类型划分的子目录:
  • spawn/
    - Agent启动提示模板(4个模板)
  • agents/
    - Agent定义模板(2个模板)
  • skills/
    - Skill定义模板(1个模板)
  • workflows/
    - 工作流定义模板(1个模板)
  • reports/
    - 报告文档模板(5个模板)
  • code-styles/
    - 语言风格指南(3个模板)
  • 根目录 - 通用文档模板(8+个模板)
  • _archive/
    - 已归档/废弃模板(14个模板)

Mandatory References

强制参考

  • File Placement: See
    .claude/docs/FILE_PLACEMENT_RULES.md
  • Developer Workflow: See
    .claude/docs/DEVELOPER_WORKFLOW.md
  • Artifact Naming: See
    .claude/docs/ARTIFACT_NAMING.md
  • Workspace Conventions: See
    .claude/rules/workspace-conventions.md
    (output placement, naming, provenance)
  • 文件放置:查看
    .claude/docs/FILE_PLACEMENT_RULES.md
  • 开发者工作流:查看
    .claude/docs/DEVELOPER_WORKFLOW.md
  • 工件命名:查看
    .claude/docs/ARTIFACT_NAMING.md
  • 工作区约定:查看
    .claude/rules/workspace-conventions.md
    (输出位置、命名、来源)

Enforcement

强制管控

File placement is enforced by
file-placement-guard.cjs
hook. Invalid placements will be blocked in production mode.

文件放置由
file-placement-guard.cjs
钩子强制管控。生产模式下会阻止无效的放置。

Assigned Agents

分配的Agent

This skill is typically invoked by:
AgentRoleAssignment Reason
plannerPlanning standardizationCreates templates for new patterns
architectArchitecture patternsCreates templates for architectural artifacts
developerCode patternsCreates code scaffolding templates
To invoke this skill:
javascript
Skill({ skill: 'template-creator' });

本Skill通常由以下Agent调用:
Agent角色分配原因
planner规划标准化为新模式创建模板
architect架构模式为架构工件创建模板
developer代码模式创建代码脚手架模板
调用本Skill的方式:
javascript
Skill({ skill: 'template-creator' });

Examples

示例

Example 1: Creating a Report Template

示例1:创建报告模板

Request: "Create a template for security audit reports"
Process:
  1. Research: Invoke
    research-synthesis
    , review existing report templates in
    .claude/templates/reports/
  2. Gather: Analyze report type, security focus, audit findings structure
  3. Validate name:
    security-audit-report-template
    matches
    /^[a-z0-9][a-z0-9-]*[a-z0-9]$/
  4. Design: Structure for security audit reports
  5. Create:
    .claude/templates/reports/security-audit-report-template.md
markdown
---
请求: "创建安全审计报告模板"
流程:
  1. 研究:调用
    research-synthesis
    ,查看
    .claude/templates/reports/
    中的现有报告模板
  2. 收集需求:分析报告类型、安全重点、审计发现结构
  3. 验证名称
    security-audit-report-template
    符合/^[a-z0-9][a-z0-9-]*[a-z0-9]$/
  4. 设计:安全审计报告的结构
  5. 创建
    .claude/templates/reports/security-audit-report-template.md
markdown
---

[REQUIRED] Report identifier, lowercase-with-hyphens

[必填] 报告标识符,使用小写字母加连字符

name: { { REPORT_NAME } }
name: { { REPORT_NAME } }

[REQUIRED] What this report documents

[必填] 本报告记录的内容

description: { { REPORT_DESCRIPTION } }
description: { { REPORT_DESCRIPTION } }

[REQUIRED] Report type: audit, implementation, research, reflection, plan

[必填] 报告类型:audit, implementation, research, reflection, plan

type: audit
type: audit

[REQUIRED] Severity levels for findings

[必填] 发现结果的严重程度级别

severity_levels: [CRITICAL, HIGH, MEDIUM, LOW]

severity_levels: [CRITICAL, HIGH, MEDIUM, LOW]

{{REPORT_DISPLAY_NAME}} Report

{{REPORT_DISPLAY_NAME}} 报告

POST-CREATION CHECKLIST (BLOCKING)

创建后检查清单(阻塞步骤)

After creating this report:
  • All findings categorized by severity
  • Recommendations actionable and specific
  • Evidence provided for all claims
创建本报告后:
  • 所有发现结果按严重程度分类
  • 建议可操作且具体
  • 所有结论都有证据支持

Findings

发现结果

CRITICAL

严重

{{CRITICAL_FINDINGS}}
{{CRITICAL_FINDINGS}}

HIGH

{{HIGH_FINDINGS}}
{{HIGH_FINDINGS}}

Recommendations

建议

{{RECOMMENDATIONS}}
{{RECOMMENDATIONS}}

Memory Protocol (MANDATORY)

内存协议(强制要求)

Before starting: Read
.claude/context/memory/learnings.md
After completing: Record patterns to learnings.md

6. **Update catalog**: Add to template-catalog.md under Report Templates
7. **Update README**: Add to reports section in templates README
8. **Assign consumers**: Update security-architect and qa agent references
9. **Update memory**: Record in learnings.md
开始前: 阅读
.claude/context/memory/learnings.md
完成后: 将模式记录到learnings.md

6. **更新目录**:在Report模板类别下添加到template-catalog.md
7. **更新README**:在templates README的报告章节添加条目
8. **分配消费者**:更新security-architect和qa Agent的引用
9. **更新内存**:在learnings.md中记录

Example 2: Creating a Spawn Template

示例2:创建Spawn模板

Request: "Create a template for specialized agent spawn prompts"
Process:
  1. Research: Invoke
    research-synthesis
    , review
    .claude/templates/spawn/universal-agent-spawn.md
  2. Gather: Analyze spawn pattern, specialized vs general-purpose
  3. Validate name:
    specialized-agent-spawn
    matches name regex
  4. Design: Structure for specialized spawn prompts with security considerations (SEC-TC-001)
  5. Create:
    .claude/templates/spawn/specialized-agent-spawn.md
markdown
---
请求: "创建专用Agent启动提示模板"
流程:
  1. 研究:调用
    research-synthesis
    ,查看
    .claude/templates/spawn/universal-agent-spawn.md
  2. 收集需求:分析启动模式、专用与通用的区别
  3. 验证名称
    specialized-agent-spawn
    符合名称正则
  4. 设计:专用启动提示的结构,考虑安全要求(SEC-TC-001)
  5. 创建
    .claude/templates/spawn/specialized-agent-spawn.md
markdown
---

[REQUIRED] Template identifier

[必填] 模板标识符

name: { { TEMPLATE_NAME } }
name: { { TEMPLATE_NAME } }

[REQUIRED] Agent type this template spawns

[必填] 本模板启动的Agent类型

agent_type: { { AGENT_TYPE } }
agent_type: { { AGENT_TYPE } }

[REQUIRED] Recommended model: haiku, sonnet, opus

[必填] 推荐模型:haiku, sonnet, opus

model: { { MODEL:sonnet } }
model: { { MODEL:sonnet } }

[OPTIONAL] Task complexity level

[可选] 任务复杂度级别

complexity: { { COMPLEXITY:medium } }

complexity: { { COMPLEXITY:medium } }

{{AGENT_DISPLAY_NAME}} Spawn Template

{{AGENT_DISPLAY_NAME}} 启动模板

Security Notice (SEC-TC-001)

安全提示(SEC-TC-001)

Placeholder values substituted into the
prompt:
field MUST be sanitized using
sanitizeSubstitutionValue()
from
prompt-factory.cjs
before substitution. This prevents prompt injection via user-provided task descriptions.
替换到
prompt:
字段的占位符值必须使用
prompt-factory.cjs
中的
sanitizeSubstitutionValue()
进行清理。 这可防止通过用户提供的任务描述进行提示注入。

Usage

用途

Use this template when spawning {{AGENT_TYPE}} agents.
启动{{AGENT_TYPE}} Agent时使用本模板。

Spawn Pattern

启动模式

Task({ subagent_type: '{{AGENT_TYPE}}', model: '{{MODEL}}', task_id: '{{TASK_ID}}', prompt: 'You are {{AGENT_IDENTITY}}. ... TaskUpdate protocol ...' });
Task({ subagent_type: '{{AGENT_TYPE}}', model: '{{MODEL}}', task_id: '{{TASK_ID}}', prompt: '你是{{AGENT_IDENTITY}}。... TaskUpdate协议 ...' });

Validation

验证

After using this template:
  • task_id is unique and matches prompt
  • Model matches agent complexity requirements
  • TaskUpdate protocol included in prompt
  • Success criteria clearly defined
  • No unsanitized user input in prompt field

6. **Update catalog**: Add to template-catalog.md under Spawn Templates
7. **Update README**: Add to spawn section in templates README
8. **Update CLAUDE.md**: Add to Section 2 (Spawn Templates) if framework-standard
9. **Assign consumers**: Update router and spawn-template-resolver references
10. **Update memory**: Record in learnings.md

---
使用本模板后:
  • task_id唯一且与提示匹配
  • 模型符合Agent复杂度要求
  • 提示中包含TaskUpdate协议
  • 成功标准清晰定义
  • 提示字段中无未清理的用户输入

6. **更新目录**:在Spawn模板类别下添加到template-catalog.md
7. **更新README**:在templates README的spawn章节添加条目
8. **更新CLAUDE.md**:若为框架标准模板,添加到第2节(Spawn模板)
9. **分配消费者**:更新router和spawn-template-resolver的引用
10. **更新内存**:在learnings.md中记录

---

Troubleshooting

故障排除

Issue: Placeholders Not Rendering

问题:占位符未渲染

Symptoms:
{{PLACEHOLDER}}
appears in final file
Solution:
  • Check placeholder format (double braces, UPPER_CASE)
  • Ensure user replaced all placeholders
  • Add validation command to catch unreplaced
症状: 最终文件中出现
{{PLACEHOLDER}}
解决方案:
  • 检查占位符格式(双大括号、大写)
  • 确保用户已替换所有占位符
  • 添加验证命令检查未替换的占位符

Issue: Template Not Discoverable

问题:模板不可发现

Symptoms: Template exists but not found by creators
Solution:
  • Verify template-catalog.md is updated (Step 8)
  • Verify README.md is updated (Step 9)
  • Check file is in correct directory
  • Run:
    grep "<template-name>" .claude/context/artifacts/catalogs/template-catalog.md
症状: 模板存在但创建者无法找到
解决方案:
  • 验证template-catalog.md已更新(步骤8)
  • 验证README.md已更新(步骤9)
  • 检查文件是否在正确的目录中
  • 运行:
    grep "<template-name>" .claude/context/artifacts/catalogs/template-catalog.md

Issue: Inconsistent Template Structure

问题:模板结构不一致

Symptoms: Different templates have different formats
Solution:
  • Review existing templates before creating
  • Use this skill's patterns
  • Compare against reference template (universal-agent-spawn.md)
  • Run consistency check across templates
症状: 不同模板格式不同
解决方案:
  • 创建前查看现有模板
  • 使用本Skill的模式
  • 与参考模板(universal-agent-spawn.md)对比
  • 运行跨模板一致性检查

Issue: Spawn Template Injection Risk

问题:Spawn模板注入风险

Symptoms: User-provided content in spawn template placeholder could manipulate agent behavior
Solution:
  • Review SEC-TC-001 guidance in this skill
  • Ensure
    sanitizeSubstitutionValue()
    is referenced
  • Do not place
    {{PLACEHOLDER}}
    tokens directly in
    prompt:
    fields for user input
  • Use structured task descriptions that separate user content from system instructions
症状: Spawn模板占位符中的用户提供内容可能操纵Agent行为
解决方案:
  • 查看本Skill中的SEC-TC-001指南
  • 确保引用了
    sanitizeSubstitutionValue()
  • 禁止将
    {{PLACEHOLDER}}
    令牌直接用于用户输入的
    prompt:
    字段
  • 使用结构化任务描述,将用户内容与系统指令分离

Issue: Creator Guard Blocking Template Write

问题:Creator Guard拦截模板写入

Symptoms:
unified-creator-guard.cjs
blocks your template write
Solution:
  • Ensure you invoked this skill properly:
    Skill({ skill: 'template-creator' })
  • Check that the creator state is active (3-minute TTL)
  • If debugging:
    CREATOR_GUARD=warn
    (temporary, restore to
    block
    after)
  • Never use
    CREATOR_GUARD=off
    in production

症状:
unified-creator-guard.cjs
拦截了模板写入操作
解决方案:
  • 确保正确调用本Skill:
    Skill({ skill: 'template-creator' })
  • 检查创建者状态是否活跃(3分钟TTL)
  • 调试时可使用:
    CREATOR_GUARD=warn
    (临时使用,之后恢复为
    block
  • 生产环境中禁止使用
    CREATOR_GUARD=off

Memory Protocol (MANDATORY)

内存协议(强制要求)

Before starting:
bash
cat .claude/context/memory/learnings.md
Check for:
  • Previously created templates
  • Known template patterns
  • User preferences for template behavior
After completing:
  • New template pattern ->
    .claude/context/memory/learnings.md
  • Issue found ->
    .claude/context/memory/issues.md
  • Decision made ->
    .claude/context/memory/decisions.md
ASSUME INTERRUPTION: If it's not in memory, it didn't happen.

开始前:
bash
cat .claude/context/memory/learnings.md
检查内容:
  • 之前创建的模板
  • 已知的模板模式
  • 用户对模板行为的偏好
完成后:
  • 新模板模式 ->
    .claude/context/memory/learnings.md
  • 发现的问题 ->
    .claude/context/memory/issues.md
  • 做出的决策 ->
    .claude/context/memory/decisions.md
假设会被中断:未记录到内存中的操作视为未发生。

Post-Creation Integration

创建后集成

After creation completes, run the ecosystem integration checklist:
  1. Call
    runIntegrationChecklist(artifactType, artifactPath)
    from
    .claude/lib/creators/creator-commons.cjs
  2. Call
    queueCrossCreatorReview(artifactType, artifactPath)
    from
    .claude/lib/creators/creator-commons.cjs
  3. Review the impact report — address all
    mustHave
    items before marking task complete
  4. Log any
    shouldHave
    items as follow-up tasks
Integration verification:
  • Template added to template-catalog.md
  • Template README exists at template location
  • Template assigned to consuming skill(s)
  • Template examples provided
创建完成后,运行生态系统集成检查清单:
  1. 调用
    .claude/lib/creators/creator-commons.cjs
    中的
    runIntegrationChecklist(artifactType, artifactPath)
  2. 调用
    .claude/lib/creators/creator-commons.cjs
    中的
    queueCrossCreatorReview(artifactType, artifactPath)
  3. 查看影响报告 — 在标记任务完成前解决所有
    mustHave
  4. shouldHave
    项记录为后续任务
集成验证:
  • 模板已添加到template-catalog.md
  • 模板位置存在模板README
  • 模板已分配给消费型Skill
  • 提供了模板示例

Ecosystem Alignment Contract (MANDATORY)

生态系统对齐契约(强制要求)

This creator skill is part of a coordinated creator ecosystem. Any artifact created here must align with and validate against related creators:
  • agent-creator
    for ownership and execution paths
  • skill-creator
    for capability packaging and assignment
  • tool-creator
    for executable automation surfaces
  • hook-creator
    for enforcement and guardrails
  • rule-creator
    and
    semgrep-rule-creator
    for policy and static checks
  • template-creator
    for standardized scaffolds
  • workflow-creator
    for orchestration and phase gating
  • command-creator
    for user/operator command UX
本Creator Skill是协同Creator生态系统的一部分。在此创建的任何工件必须与相关创建者对齐并验证:
  • agent-creator
    :所有权和执行路径
  • skill-creator
    :能力打包和分配
  • tool-creator
    :可执行自动化接口
  • hook-creator
    :强制管控和护栏
  • rule-creator
    semgrep-rule-creator
    :策略和静态检查
  • template-creator
    :标准化脚手架
  • workflow-creator
    :编排和阶段门控
  • command-creator
    :用户/操作员命令UX

Cross-Creator Handshake (Required)

跨Creator握手(必填)

Before completion, verify all relevant handshakes:
  1. Artifact route exists in
    .claude/CLAUDE.md
    and related routing docs.
  2. Discovery/registry entries are updated (catalog/index/registry as applicable).
  3. Companion artifacts are created or explicitly waived with reason.
  4. validate-integration.cjs
    passes for the created artifact.
  5. Skill index is regenerated when skill metadata changes.
完成前,验证所有相关握手:
  1. 工件路由在
    .claude/CLAUDE.md
    和相关路由文档中存在。
  2. 发现/注册表条目已更新(适用的目录/索引/注册表)。
  3. 已创建配套工件或明确说明放弃原因。
  4. 已创建工件通过
    validate-integration.cjs
    验证。
  5. Skill元数据更改时重新生成Skill索引。

Research Gate (Exa First, arXiv Fallback)

研究门限(优先使用Exa,备用arXiv)

For new patterns, templates, or workflows, research is mandatory:
  1. Use Exa first for implementation and ecosystem patterns.
  2. If Exa is insufficient, use
    WebFetch
    plus arXiv references.
  3. Record decisions, constraints, and non-goals in artifact references/docs.
  4. Keep updates minimal and avoid overengineering.
对于新模式、模板或工作流,研究是强制要求:
  1. 优先使用Exa查找实现和生态系统模式。
  2. 若Exa信息不足,使用
    WebFetch
    加arXiv参考。
  3. 在工件参考/文档中记录决策、约束和非目标。
  4. 最小化更新,避免过度设计。

Regression-Safe Delivery

回归安全交付

  • Follow strict RED -> GREEN -> REFACTOR for behavior changes.
  • Run targeted tests for changed modules.
  • Run lint/format on changed files.
  • Keep commits scoped by concern (logic/docs/generated artifacts).
  • 行为变更遵循严格的RED -> GREEN -> REFACTOR流程。
  • 对变更模块运行针对性测试。
  • 对变更文件运行lint/格式化。
  • 提交按关注点划分(逻辑/文档/生成的工件)。