Agent写作
- 作者仓库星标 2,549
- 作者更新于 实时读取
- 作者仓库 torchrec
- 领域
- 设计与多媒体
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @meta-pytorch · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 即装即用
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 底层运行要求
- 无特殊要求
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- 网络行为
- 仅限本地
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: skill-writer
description: Guide users through creating Agent Skills for Claude Code. Use when the user wants to create, wr…
category: 设计与多媒体
runtime: 无特殊运行时
---
# skill-writer 输出预览
## PART A: 任务判断
- 适用问题:视觉内容、演示材料、信息图或设计交付。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“When to use this Skill / Instructions / Step 1: Determine Skill scope”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于视觉内容、演示材料、信息图或设计交付,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“When to use this Skill / Instructions / Step 1: Determine Skill scope”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、主要在本地完成、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件;主要在本地完成;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文出现了 `/sharding-analyzer` 这类斜杠命令;如果你的 Agent 支持命令触发,优先用命令开场,再补充目标和边界。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件。
先用一个小任务确认它会围绕“When to use this Skill / Instructions / Step 1: Determine Skill scope”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: skill-writer
description: Guide users through creating Agent Skills for Claude Code. Use when the user wants to create, wr…
category: 设计与多媒体
source: meta-pytorch/torchrec
---
# skill-writer
## 什么时候使用
- 把设计与视觉方向的常用动作沉淀成 Agent 可调用的技能 适合处理界面、视觉、封面、信息图或演示材料交付,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代的步骤…
- 面向视觉内容、演示材料、信息图或设计交付,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「When to use this Skill / Instructions / Step 1: Determine Skill scope」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件;主要在本地完成;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "skill-writer" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> When to use this Skill / Instructions / Step 1: Determine Skill scope
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> 无特殊运行时 | 读取文件、写入/修改文件 | 主要在本地完成
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} 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:
Ask clarifying questions:
- What specific TorchRec capability should this Skill provide?
- When should Claude use this Skill?
- What tools or resources does it need?
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:
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:
---
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)
allowed-tools: Read, Grep, Globargument-hint: Hint for expected arguments
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:
description: Optimize sharding plans for TorchRec embedding tables. Use when configuring DistributedModelParallel, analyzing sharding strategies, or tuning embedding performance.
✅ Good:
description: Validate KeyedJaggedTensor (KJT) configurations and debug sparse tensor issues. Use when working with KJT, debugging embedding lookups, or validating feature configurations.
❌ Too vague:
description: Helps with TorchRec
description: For distributed training
Step 6: Structure the Skill content
Use clear Markdown sections:
# 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)
-
namefollows naming rules -
descriptionis 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
---
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:
- Ask clarifying questions about scope and requirements
- Suggest a Skill name and location
- Create the SKILL.md file with proper frontmatter
- Include TorchRec-specific instructions and examples
- Add references to relevant TorchRec code
- Provide validation checklist
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核