integrate-skill
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseIntegrate Claude Skill into Project Guidelines
将Claude Skill集成到项目指南中
Adapt and integrate a Claude global skill into your project's development guidelines (not directly into project code).
将Claude全局Skill适配并集成到项目的开发指南中(而非直接集成到项目代码)。
Usage
使用方法
/trellis:integrate-skill <skill-name>Examples:
/trellis:integrate-skill frontend-design
/trellis:integrate-skill mcp-builder/trellis:integrate-skill <skill-name>示例:
/trellis:integrate-skill frontend-design
/trellis:integrate-skill mcp-builderCore Principle
核心原则
[!] Important: The goal of skill integration is to update development guidelines, not to generate project code directly.
- Guidelines content -> Write to
.trellis/spec/cli/{target}/doc.md- Code examples -> Place in
.trellis/spec/cli/{target}/examples/skills/<skill-name>/- Example files -> Use
suffix (e.g.,.template) to avoid IDE errorscomponent.tsx.templateWhereis{target}orfrontend, determined by skill type.backend
[!] 重要提示:Skill集成的目标是更新开发指南,而非直接生成项目代码。
- 指南内容 -> 写入
.trellis/spec/cli/{target}/doc.md- 代码示例 -> 放置在
.trellis/spec/cli/{target}/examples/skills/<skill-name>/- 示例文件 -> 使用
后缀(如.template)以避免IDE报错component.tsx.template其中根据Skill类型分为{target}或frontend。backend
Execution Steps
执行步骤
1. Read Skill Content
1. 读取Skill内容
bash
openskills read <skill-name>If the skill doesn't exist, prompt user to check available skills:
bash
undefinedbash
openskills read <skill-name>若Skill不存在,提示用户查看可用Skill:
bash
undefinedAvailable skills are listed in AGENTS.md under <available_skills>
可用Skill列在AGENTS.md的<available_skills>部分
undefinedundefined2. Determine Integration Target
2. 确定集成目标
Based on skill type, determine which guidelines to update:
| Skill Category | Integration Target |
|---|---|
UI/Frontend ( | |
Backend/API ( | |
Documentation ( | |
Testing ( | |
根据Skill类型,确定需要更新的指南:
| Skill类别 | 集成目标 |
|---|---|
UI/前端( | |
后端/API( | |
文档( | |
测试( | |
3. Analyze Skill Content
3. 分析Skill内容
Extract from the skill:
- Core concepts: How the skill works and key concepts
- Best practices: Recommended approaches
- Code patterns: Reusable code templates
- Caveats: Common issues and solutions
从Skill中提取以下信息:
- 核心概念:Skill的工作原理和关键概念
- 最佳实践:推荐的实施方法
- 代码模式:可复用的代码模板
- 注意事项:常见问题及解决方案
4. Execute Integration
4. 执行集成
4.1 Update Guidelines Document
4.1 更新指南文档
Add a new section to the corresponding :
doc.mdmarkdown
@@@section:skill-<skill-name>在对应的中添加新章节:
doc.mdmarkdown
@@@section:skill-<skill-name># <Skill Name> Integration Guide
# <Skill名称> 集成指南
Overview
概述
[Core functionality and use cases of the skill]
[Skill的核心功能和使用场景]
Project Adaptation
项目适配
[How to use this skill in the current project]
[如何在当前项目中使用该Skill]
Usage Steps
使用步骤
- [Step 1]
- [Step 2]
- [步骤1]
- [步骤2]
Caveats
注意事项
- [Project-specific constraints]
- [Differences from default behavior]
- [项目特定约束]
- [与默认行为的差异]
Reference Examples
参考示例
See
examples/skills/<skill-name>/@@@/section:skill-<skill-name>
undefined参见
examples/skills/<skill-name>/@@@/section:skill-<skill-name>
undefined4.2 Create Examples Directory (if code examples exist)
4.2 创建示例目录(若存在代码示例)
bash
undefinedbash
undefinedDirectory structure ({target} = frontend or backend)
目录结构({target} = frontend或backend)
.trellis/spec/cli/{target}/
|-- doc.md # Add skill-related section
|-- index.md # Update index
+-- examples/
+-- skills/
+-- <skill-name>/
|-- README.md # Example documentation
|-- example-1.ts.template # Code example (use .template suffix)
+-- example-2.tsx.template
**File naming conventions**:
- Code files: `<name>.<ext>.template` (e.g., `component.tsx.template`)
- Config files: `<name>.config.template` (e.g., `tailwind.config.template`)
- Documentation: `README.md` (normal suffix).trellis/spec/cli/{target}/
|-- doc.md # 添加Skill相关章节
|-- index.md # 更新索引
+-- examples/
+-- skills/
+-- <skill-name>/
|-- README.md # 示例文档
|-- example-1.ts.template # 代码示例(使用.template后缀)
+-- example-2.tsx.template
**文件命名规范**:
- 代码文件:`<name>.<ext>.template`(例如 `component.tsx.template`)
- 配置文件:`<name>.config.template`(例如 `tailwind.config.template`)
- 文档:`README.md`(正常后缀)4.3 Update Index File
4.3 更新索引文件
Add to the Quick Navigation table in :
index.mdmarkdown
| <Skill-related task> | <Section name> | `skill-<skill-name>` |在的快速导航表格中添加条目:
index.mdmarkdown
| <Skill相关任务> | <章节名称> | `skill-<skill-name>` |5. Generate Integration Report
5. 生成集成报告
Skill Integration Report: <skill-name>
<skill-name>Skill集成报告:<skill-name>
<skill-name># Overview
# 概述
- Skill description: [Functionality description]
- Integration target:
.trellis/spec/cli/{target}/
- Skill描述:[功能说明]
- 集成目标:
.trellis/spec/cli/{target}/
# Tech Stack Compatibility
# 技术栈兼容性
| Skill Requirement | Project Status | Compatibility |
|---|---|---|
| [Tech 1] | [Project tech] | [OK]/[!]/[X] |
| Skill要求 | 项目现状 | 兼容性 |
|---|---|---|
| [技术1] | [项目技术栈] | [兼容]/[需调整]/[不兼容] |
# Integration Locations
# 集成位置
| Type | Path |
|---|---|
| Guidelines doc | |
| Code examples | |
| Index update | |
={target}orfrontendbackend
| 类型 | 路径 |
|---|---|
| 指南文档 | |
| 代码示例 | |
| 索引更新 | |
={target}或frontendbackend
# Dependencies (if needed)
# 依赖项(如有需要)
bash
undefinedbash
undefinedInstall required dependencies (adjust for your package manager)
安装所需依赖项(根据包管理器调整)
npm install <package>
npm install <package>
or
或
pnpm add <package>
pnpm add <package>
or
或
yarn add <package>
undefinedyarn add <package>
undefined[OK] Completed Changes
[完成] 已完成的更改
- Added section to
@@@section:skill-<name>doc.md - Added index entry to
index.md - Created example files in
examples/skills/<name>/ - Example files use suffix
.template
- 向添加
doc.md章节@@@section:skill-<name> - 向添加索引条目
index.md - 在中创建示例文件
examples/skills/<name>/ - 示例文件使用后缀
.template
# Related Guidelines
# 相关指南
- [Existing related section IDs]
- [现有相关章节ID]
6. Optional: Create Usage Command
6. 可选:创建使用命令
If this skill is frequently used, create a shortcut command:
bash
/trellis:create-command use-<skill-name> Use <skill-name> skill following project guidelines如果该Skill频繁使用,可创建快捷命令:
bash
/trellis:create-command use-<skill-name> 按照项目指南使用<skill-name> SkillCommon Skill Integration Reference
常见Skill集成参考
| Skill | Integration Target | Examples Directory |
|---|---|---|
| | |
| | |
| | |
| | N/A (documentation workflow only) |
| Skill | 集成目标 | 示例目录 |
|---|---|---|
| | |
| | |
| | |
| | 无(仅文档工作流) |
Example: Integrating mcp-builder
Skill
mcp-builder示例:集成mcp-builder
Skill
mcp-builderDirectory Structure
目录结构
.trellis/spec/cli/backend/
|-- doc.md # Add MCP section
|-- index.md # Add index entry
+-- examples/
+-- skills/
+-- mcp-builder/
|-- README.md
|-- server.ts.template
|-- tools.ts.template
+-- types.ts.template.trellis/spec/cli/backend/
|-- doc.md # 添加MCP章节
|-- index.md # 添加索引条目
+-- examples/
+-- skills/
+-- mcp-builder/
|-- README.md
|-- server.ts.template
|-- tools.ts.template
+-- types.ts.templateNew Section in doc.md
doc.md中的新章节
markdown
@@@section:skill-mcp-buildermarkdown
@@@section:skill-mcp-builder# MCP Server Development Guide
# MCP服务器开发指南
Overview
概述
Create LLM-callable tool services using MCP (Model Context Protocol).
使用MCP(Model Context Protocol)创建可被LLM调用的工具服务。
Project Adaptation
项目适配
- Place services in a dedicated directory
- Follow existing TypeScript and type definition conventions
- Use project's logging system
- 将服务放置在专用目录中
- 遵循现有的TypeScript和类型定义约定
- 使用项目的日志系统
Reference Examples
参考示例
See
examples/skills/mcp-builder/@@@/section:skill-mcp-builder
undefined参见
examples/skills/mcp-builder/@@@/section:skill-mcp-builder
undefined