skill-filetypes

File format conversion routing with specialized sub-agent dispatch

438 stars

Best use case

skill-filetypes is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

File format conversion routing with specialized sub-agent dispatch

Teams using skill-filetypes should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/skill-filetypes/SKILL.md --create-dirs "https://raw.githubusercontent.com/benbrastmckie/nvim/main/.claude/extensions/filetypes/skills/skill-filetypes/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/skill-filetypes/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How skill-filetypes Compares

Feature / Agentskill-filetypesStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

File format conversion routing with specialized sub-agent dispatch

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Filetypes Skill

Thin wrapper that routes file format operations to the `filetypes-router-agent`, which then delegates to specialized sub-agents based on file type.

## 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 agents, not this skill.

## Trigger Conditions

This skill activates when:

### Direct Invocation
- User explicitly runs `/convert` command
- User requests file format conversion in conversation

### Implicit Invocation (during task implementation)

When an implementing agent encounters any of these patterns:

**Plan step language patterns**:
- "Extract text from [file].pdf"
- "Extract content from [file]"
- "Convert [file] to markdown"
- "Convert [file] to PDF"
- "Generate PDF from [documentation/file]"
- "Read content from [file].docx"
- "Create PDF version of [file]"
- "Parse [file].pdf for content"
- "Import [file] content"

**File extension detection**:
- Source file has extension: `.pdf`, `.docx`, `.xlsx`, `.pptx`, `.html`
- Target mentions: "markdown", ".md", "PDF", ".pdf"

**Task description keywords**:
- "document conversion"
- "format transformation"
- "extract from PDF"
- "generate PDF"

### When NOT to trigger

Do not invoke for:
- Reading source code files (.py, .js, .lean, etc.)
- Viewing images without extraction
- Operations that don't involve format conversion
- Files already in the target format
- Spreadsheet-specific operations (use skill-spreadsheet)
- Presentation-specific operations (use skill-presentation)

---

## Execution

### 1. Input Validation

Validate required inputs:
- `source_path` - Must be provided and file must exist
- `output_path` - Optional, defaults to source dir with appropriate extension

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

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

  # Infer target extension
  case "$source_ext" in
    pdf|docx|xlsx|pptx|html) output_path="${source_dir}/${source_base}.md" ;;
    md) output_path="${source_dir}/${source_base}.pdf" ;;
    *) return error "Cannot infer output format for .$source_ext" ;;
  esac
fi
```

### 2. Context Preparation

Prepare delegation context:

```json
{
  "source_path": "/absolute/path/to/source.pdf",
  "output_path": "/absolute/path/to/output.md",
  "metadata": {
    "session_id": "sess_{timestamp}_{random}",
    "delegation_depth": 1,
    "delegation_path": ["orchestrator", "convert", "skill-filetypes"]
  }
}
```

### 3. Invoke Router Agent

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

**Required Tool Invocation**:
```
Tool: Task (NOT Skill)
Parameters:
  - subagent_type: "filetypes-router-agent"
  - prompt: [Include source_path, output_path, metadata]
  - description: "Convert {source_path} to {output_path}"
```

**DO NOT** use `Skill(filetypes-router-agent)` - this will FAIL.
Agents live in `.claude/agents/` or extension agent directories, not `.claude/skills/`.
The Skill tool can only invoke skills from `.claude/skills/`.

The router will:
- Detect source and target formats
- Select appropriate sub-agent (document, spreadsheet, presentation)
- Delegate to sub-agent for actual conversion
- Return standardized JSON result

### 4. Return Validation

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

### 5. Return Propagation

Return validated result to caller without modification.

---

## Return Format

See `.claude/context/formats/subagent-return.md` for full specification.

Expected successful return:
```json
{
  "status": "converted",
  "summary": "Successfully converted document.pdf to document.md using markitdown",
  "artifacts": [
    {
      "type": "implementation",
      "path": "/absolute/path/to/document.md",
      "summary": "Converted markdown document"
    }
  ],
  "metadata": {
    "session_id": "sess_...",
    "agent_type": "document-agent",
    "delegation_depth": 2,
    "delegation_path": ["orchestrator", "convert", "skill-filetypes", "filetypes-router-agent", "document-agent"],
    "tool_used": "markitdown"
  },
  "next_steps": "Review converted document"
}
```

---

## Error Handling

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

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

### Router/Subagent Errors
Pass through the router/subagent's error return verbatim.

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

Related Skills

skill-learn

438
from benbrastmckie/nvim

Scan codebase for FIX:/NOTE:/TODO:/QUESTION: tags and create structured tasks with interactive selection. Invoke for /learn command.

skill-deck

438
from benbrastmckie/nvim

Generate YC-style investor pitch decks in Typst

skill-todo

438
from benbrastmckie/nvim

Archive completed and abandoned tasks with CHANGE_LOG.md updates and memory harvest suggestions

skill-team-research

438
from benbrastmckie/nvim

Orchestrate multi-agent research with wave-based parallel execution. Spawns 2-4 teammates for diverse investigation angles and synthesizes findings.

skill-team-plan

438
from benbrastmckie/nvim

Orchestrate multi-agent planning with parallel plan generation. Spawns 2-3 teammates for diverse planning approaches and synthesizes into final plan with trade-off analysis.

skill-team-implement

438
from benbrastmckie/nvim

Orchestrate multi-agent implementation with parallel phase execution. Spawns teammates for independent phases and coordinates dependent phases. Includes debugger teammate for error recovery.

skill-status-sync

438
from benbrastmckie/nvim

Atomically update task status across TODO.md and state.json. For standalone use only.

skill-spawn

438
from benbrastmckie/nvim

Research blockers and spawn new tasks to overcome them, updating parent task dependencies

skill-researcher

438
from benbrastmckie/nvim

Conduct general research using web search, documentation, and codebase exploration. Invoke for general research tasks.

skill-refresh

438
from benbrastmckie/nvim

Manage Claude Code resources - terminate orphaned processes and clean up ~/.claude/ directory

skill-planner

438
from benbrastmckie/nvim

Create phased implementation plans from research findings. Invoke when a task needs an implementation plan.

skill-orchestrator

438
from benbrastmckie/nvim

Route commands to appropriate workflows based on task language and status. Invoke when executing /task, /research, /plan, /implement commands.