技能展示

数据 社区

技能解读

当前原文的自动摘译,尚未人工审校。

上下文指针

参考(不要急于加载): 路径:.claude/context/formats/subagent-return.md 目的:返回验证 加载于:仅子代理执行 注意:此技能是一个薄包装。上下文由委托代理加载,而不是由该技能加载。

直接调用

用户使用 .pptx/.ppt 源运行 /convert,并且 --format beamer|polylux|touying 用户在对话中请求演示文稿转换

隐式调用(任务执行期间)

当实施代理遇到以下任何模式时: 计划步骤语言模式:“将演示文稿转换为 Beamer”“从 PowerPoint 提取幻灯片”“生成 Polylux 幻灯片”

何时不触发

请勿调用: 文档转换(使用技能文件类型) 电子表格转换(使用技能电子表格) 无需幻灯片格式的简单降价提取

1. 输入验证

验证所需的输入: source_path - 必须提供且文件必须存在 output_path - 可选,默认为扩展名为 .tex 的源目录 output_format - 可选,默认为“beamer” theme - 可选主题名称

流狐档案 运行与权限由流狐静态检查推断,不代表作者声明或实际测试结果。
领域
数据
作者声明的智能体
未找到明确声明;不据此推断已兼容或已测试
静态检查
88 / 100 · 启发式扫描,不代表运行安全
运行环境证据
未执行;当前没有隔离运行测试证据
作者 / 版本 / 许可证
@benbrastmckie · 未声明许可证
上下文用量评级
低消耗
接入复杂程度
需简单配置
是否需要外部接口密钥
不需要
兼容的系统
未声明(默认跨平台)
运行环境要求
Python
检测到的文件与系统行为
  • 只读
  • 允许写入 / 修改
  • 命令执行
网络行为
仅限本地
安装命令数
无(仅作为资料)

需要注意: 未声明工具权限范围;实际权限由运行环境决定。

作者说明文件(原文) SKILL.md

# Presentation Skill

Thin wrapper that routes presentation operations to the `presentation-agent`.

## Context Pointers

Reference (do not load eagerly):
- Path: `.claude/context/formats/subagent-return.md`
- Purpose: Return validation
- Load at: Subagent execution only

Note: This skill is a thin wrapper. Context is loaded by the delegated agent, not this skill.

## Trigger Conditions

This skill activates when:

### Direct Invocation
- User runs `/convert` with a `.pptx`/`.ppt` source and `--format beamer|polylux|touying`
- User requests presentation conversion in conversation

### Implicit Invocation (during task implementation)

When an implementing agent encounters any of these patterns:

**Plan step language patterns**:
- "Convert presentation to Beamer"
- "Extract slides from PowerPoint"
- "Generate Polylux slides"
- "Create Touying presentation"
- "Convert PPTX to LaTeX"

**File extension detection**:
- Source file has extension: `.pptx`, `.ppt`
- Target mentions: "Beamer", "slides", ".tex", "Polylux", "Touying", ".typ"

**Task description keywords**:
- "presentation conversion"
- "PowerPoint to LaTeX"
- "slide extraction"
- "academic slides"

### When NOT to trigger

Do not invoke for:
- Document conversions (use skill-filetypes)
- Spreadsheet conversions (use skill-spreadsheet)
- Simple markdown extraction without slide formatting

---

## Execution

### 1. Input Validation

Validate required inputs:
- `source_path` - Must be provided and file must exist
- `output_path` - Optional, defaults to source dir with .tex extension
- `output_format` - Optional, defaults to "beamer"
- `theme` - Optional theme name

```bash
# Validate source exists
if [ ! -f "$source_path" ]; then
  return error "Source file not found: $source_path"
fi

# Validate source is presentation format
source_ext="${source_path##*.}"
case "$source_ext" in
  pptx|ppt|md) ;; # Valid
  *) return error "Not a presentation format: .$source_ext" ;;
esac

# Determine output path if not provided
if [ -z "$output_path" ]; then
  source_dir=$(dirname "$source_path")
  source_base=$(basename "$source_path" | sed 's/\.[^.]*$//')

  case "$output_format" in
    beamer|latex|tex) output_path="${source_dir}/${source_base}.tex" ;;
    polylux|touying|typst|typ) output_path="${source_dir}/${source_base}.typ" ;;
    pptx) output_path="${source_dir}/${source_base}_generated.pptx" ;;
    *) output_path="${source_dir}/${source_base}.tex" ;;
  esac
fi
```

### 2. Context Preparation

Prepare delegation context:

```json
{
  "source_path": "/absolute/path/to/presentation.pptx",
  "output_path": "/absolute/path/to/slides.tex",
  "output_format": "beamer",
  "theme": "metropolis",
  "metadata": {
    "session_id": "sess_{timestamp}_{random}",
    "delegation_depth": 1,
    "delegation_path": ["orchestrator", "convert", "skill-presentation"]
  }
}
```

### 3. Invoke Agent

**CRITICAL**: You MUST use the **Agent** tool to spawn the agent.

**Required Tool Invocation**:
```
Tool: Agent (NOT Skill, NOT Plan)
Parameters:
  - subagent_type: "presentation-agent"
  - prompt: [Include source_path, output_path, output_format, theme, metadata]
  - description: "Convert {source_path} to {output_format} slides"
```

The agent will:
- Detect available tools (python-pptx, pandoc, markitdown)
- Extract presentation content
- Generate formatted slide output
- Extract and preserve speaker notes
- Return standardized JSON result

### 4. Return Validation

Validate return matches `subagent-return.md` schema:
- Status is one of: converted, partial, failed
- Summary is non-empty and <100 tokens
- Artifacts array present with output file path
- Metadata contains slide count

### 5. Return Propagation

Return validated result to caller without modification.

---

## Return Format

Expected successful return:
```json
{
  "status": "converted",
  "summary": "Successfully converted presentation.pptx to Beamer slides with 15 slides",
  "artifacts": [
    {
      "type": "implementation",
      "path": "/absolute/path/to/slides.tex",
      "summary": "Beamer presentation with speaker notes"
    }
  ],
  "metadata": {
    "session_id": "sess_...",
    "agent_type": "presentation-agent",
    "delegation_depth": 2,
    "tool_used": "python-pptx+pandoc",
    "slide_count": 15,
    "has_speaker_notes": true
  },
  "next_steps": "Review and compile slides"
}
```

---

## Error Handling

### Input Validation Errors
Return immediately with failed status if source file not found or not a presentation.

### Unsupported Format
Return failed status with clear message about supported formats.

### Agent Errors
Pass through the agent's error return verbatim.

### Tool Not Available
Return failed status with installation instructions.

讨论

基于 GitHub Discussions。登录 GitHub 即可参与讨论、点赞、订阅更新。