技能作家
- 作者仓库星标 2,549
- 作者仓库 torchrec
- 领域
- 设计与多媒体
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @meta-pytorch · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 即装即用
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- 未检出明确要求
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
第 1 步:确定技能范围
首先,了解该技能应该做什么:提出澄清问题:该技能应提供哪些具体的 TorchRec 功能?克劳德什么时候应该使用这个技能?需要什么工具或资源?
第2步:选择技能位置
TorchRec 技能应放置在:
第 3 步:创建技能结构
创建目录和文件: 对于多文件技能:
第四步:编写SKILL.md frontmatter
创建包含必填字段的 YAML frontmatter: 字段要求: 名称:仅限小写字母、数字、连字符 最多 64 个字符
第 5 步:撰写有效的描述
描述对于克劳德发现你的技能至关重要。公式:`[What it does] + [When to use it] + [TorchRec keywords]` 示例: ✅ 好: ✅ 好:
第 6 步:构建技能内容
使用清晰的 Markdown 部分:
第 7 步:验证技能
检查这些要求: ✅ 文件结构:[ ] SKILL.md 存在于正确位置 [ ] 目录名称与 frontmatter `name` 匹配 ✅ YAML frontmatter:
# TorchRec Skill Writer
This Skill helps you create well-structured Agent Skills for Claude Code specifically for the TorchRec project.
## When to use this Skill
Use this Skill when:
- Creating a new Agent Skill for TorchRec
- Writing or updating SKILL.md files
- Designing skill structure and frontmatter
- Converting existing TorchRec workflows into Skills
## Instructions
### Step 1: Determine Skill scope
First, understand what the Skill should do:
1. **Ask clarifying questions**:
- What specific TorchRec capability should this Skill provide?
- When should Claude use this Skill?
- What tools or resources does it need?
2. **Keep it focused**: One Skill = one capability
- Good: "sharding-optimizer", "embedding-config-validator"
- Too broad: "distributed-training", "model-tools"
### Step 2: Choose Skill location
TorchRec Skills should be placed in:
```
fbcode/torchrec/.claude/skills/<skill-name>/SKILL.md
```
### Step 3: Create Skill structure
Create the directory and files:
```bash
mkdir -p fbcode/torchrec/.claude/skills/skill-name
```
For multi-file Skills:
```
skill-name/
├── SKILL.md (required)
├── reference.md (optional)
├── examples.md (optional)
└── templates/ (optional)
```
### Step 4: Write SKILL.md frontmatter
Create YAML frontmatter with required fields:
```yaml
---
name: skill-name
description: Brief description of what this does and when to use it
---
```
**Field requirements**:
- **name**:
- Lowercase letters, numbers, hyphens only
- Max 64 characters
- Must match directory name
- Good: `sharding-optimizer`, `kjt-validator`
- Bad: `Sharding_Optimizer`, `KJT Validator!`
- **description**:
- Max 1024 characters
- Include BOTH what it does AND when to use it
- Use specific trigger words users would say
- Mention TorchRec concepts (embeddings, sharding, KJT, etc.)
**Optional frontmatter fields**:
- **allowed-tools**: Restrict tool access (comma-separated list)
```yaml
allowed-tools: Read, Grep, Glob
```
- **argument-hint**: Hint for expected arguments
```yaml
argument-hint: [feature or task description]
```
### Step 5: Write effective descriptions
The description is critical for Claude to discover your Skill.
**Formula**: `[What it does] + [When to use it] + [TorchRec keywords]`
**Examples**:
✅ **Good**:
```yaml
description: Optimize sharding plans for TorchRec embedding tables. Use when configuring DistributedModelParallel, analyzing sharding strategies, or tuning embedding performance.
```
✅ **Good**:
```yaml
description: Validate KeyedJaggedTensor (KJT) configurations and debug sparse tensor issues. Use when working with KJT, debugging embedding lookups, or validating feature configurations.
```
❌ **Too vague**:
```yaml
description: Helps with TorchRec
description: For distributed training
```
### Step 6: Structure the Skill content
Use clear Markdown sections:
```markdown
# Skill Name
Brief overview of what this Skill does for TorchRec.
## Quick start
Provide a simple example to get started immediately.
## Instructions
Step-by-step guidance for Claude:
1. First step with clear action
2. Second step with expected outcome
3. Handle edge cases
## TorchRec-Specific Patterns
Document TorchRec-specific patterns and conventions.
## Examples
Show concrete usage examples with TorchRec code.
## Best practices
- Key conventions to follow
- Common pitfalls to avoid
- When to use vs. not use
## Files to Reference
List important TorchRec files for context:
- `torchrec/distributed/` - Distributed training code
- `torchrec/modules/` - Core modules
```
### Step 7: Validate the Skill
Check these requirements:
✅ **File structure**:
- [ ] SKILL.md exists in correct location
- [ ] Directory name matches frontmatter `name`
✅ **YAML frontmatter**:
- [ ] Opening `---` on line 1
- [ ] Closing `---` before content
- [ ] Valid YAML (no tabs, correct indentation)
- [ ] `name` follows naming rules
- [ ] `description` is specific and < 1024 chars
✅ **Content quality**:
- [ ] Clear instructions for Claude
- [ ] TorchRec-specific examples provided
- [ ] Edge cases handled
- [ ] References to relevant TorchRec code
## TorchRec Skill Ideas
Here are some useful Skills to consider creating:
| Skill Name | Purpose |
|------------|---------|
| `sharding-optimizer` | Analyze and optimize embedding sharding plans |
| `kjt-validator` | Validate KeyedJaggedTensor configurations |
| `distributed-debug` | Debug distributed training issues |
| `embedding-benchmark` | Benchmark embedding performance |
| `migration-helper` | Help migrate to newer TorchRec APIs |
## Example: Complete TorchRec Skill
```yaml
---
name: sharding-analyzer
description: Analyze TorchRec sharding plans and suggest optimizations. Use when reviewing ShardingPlan, DistributedModelParallel configuration, or optimizing embedding distribution across devices.
---
# Sharding Analyzer
Analyze TorchRec sharding plans and suggest optimizations for embedding tables.
## Quick start
Run `/sharding-analyzer` on a file containing a ShardingPlan to get optimization suggestions.
## Instructions
1. Read the sharding plan configuration
2. Analyze table sizes and sharding strategies
3. Check for common anti-patterns:
- Large tables with TABLE_WISE sharding
- Small tables with ROW_WISE sharding
- Unbalanced memory distribution
4. Suggest optimizations
## TorchRec Sharding Strategies
| Strategy | Best For | Avoid When |
|----------|----------|------------|
| TABLE_WISE | Small tables, < 1M rows | Large tables |
| ROW_WISE | Large tables, uniform access | Small tables |
| COLUMN_WISE | Wide embeddings, > 256 dim | Narrow embeddings |
## Files to Reference
- `torchrec/distributed/planner/` - Sharding planner
- `torchrec/distributed/sharding/` - Sharding implementations
```
## Output format
When creating a Skill, I will:
1. Ask clarifying questions about scope and requirements
2. Suggest a Skill name and location
3. Create the SKILL.md file with proper frontmatter
4. Include TorchRec-specific instructions and examples
5. Add references to relevant TorchRec code
6. Provide validation checklist
章节与文件索引
按说明文件中的顺序排列。
何时使用该技能
第 1 步:确定技能范围
第2步:选择技能位置
第 3 步:创建技能结构
第四步:编写SKILL.md frontmatter
文件/命令 -> sharding-optimizer · kjt-validator · Sharding_Optimizer · KJT Validator! · [What it does] + [When to use it] + [TorchRec keywords] · torchrec/distributed/ · torchrec/modules/ · name
内容校验值 -> 6c6795ca2230
当前原文的自动摘译,尚未人工审校。
何时使用该技能
在以下情况下使用此技能: 为 TorchRec 创建新的代理技能 编写或更新 SKILL.md 文件 设计技能结构和 frontmatter 将现有 TorchRec 工作流程转换为技能