skill-filetypes
- Repo stars 435
- Author updated Live
- Author repo nvim
- Domain
- AI
- Compatible agents
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- Trust score
- 88 / 100 · community maintained
- Author / version / license
- @benbrastmckie · no license declared
- Token usage
- Lean
- Setup complexity
- Guided setup
- External API key
- Not required
- Operating systems
- Unspecified (assume cross-platform)
- Runtime requirements
- No special requirements
- Permissions
-
- Read-only
- Write / modify
- Shell exec
- Network behavior
- Local-only
- Install commands
- 26 variants
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: skill-filetypes
description: File format conversion routing with specialized sub-agent dispatch Thin wrapper that routes file…
category: ai
runtime: no special runtime
---
# skill-filetypes output preview
## PART A: Task fit
- Use case: File format conversion routing with specialized sub-agent dispatch Thin wrapper that routes file format operations to the filetypes-router-agent, which then delegates to specialized sub-agents based on file type. Reference (do not load eagerly): This skill activates when: When an implementing agent encounters any of these patterns: Do not invoke for: runs….
- Inputs: target material, constraints, expected output, and acceptance criteria.
- Evidence boundary: follow “Context Pointers / Trigger Conditions / Direct Invocation” and do not present inference as author intent.
## PART B: Execution result
- **01** The card summarizes the use case; runtime output centers on “File format conversion routing with specialized sub-agent dispatch Thin wrapper that routes file format operations to the filetypes-router-agent, which then delegates to specialized sub-agents based on file type. Reference (do not load eagerly): This skill activates when: When an implementing agent encounters any of these patterns: Do not invoke for: runs…”.
- **02** When the source has headings, the agent prioritizes “Context Pointers / Trigger Conditions / Direct Invocation” so the result follows the author’s structure.
- **03** Typical output includes task judgment, concrete steps, required commands or file edits, validation, and follow-up options.
- **04** Risk context follows the fingerprint: read files, write/modify files, run shell commands; mostly runs locally; usually needs no extra API key.
## Running Rules
- read files, write/modify files, run shell commands; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding scope.
- Return the result, validation criteria, and next iteration options. The source mentions slash commands such as `/convert`; use them first when your agent supports command triggers.
Name target files or source material, expected output, forbidden changes, and whether network or shell access is allowed. Permission fingerprint: read files, write/modify files, run shell commands.
Start with a small task and check whether the result follows “Context Pointers / Trigger Conditions / Direct Invocation”. Inspect diffs, logs, previews, or tests before expanding scope.
Confirm the final output includes a concrete result, evidence, and next action. If it stays generic, tighten inputs, boundaries, and acceptance criteria.
---
name: skill-filetypes
description: File format conversion routing with specialized sub-agent dispatch Thin wrapper that routes file…
category: ai
source: benbrastmckie/nvim
---
# skill-filetypes
## When to use
- File format conversion routing with specialized sub-agent dispatch Thin wrapper that routes file format operations to…
- Use it when the task has clear inputs, repeatable steps, and validation criteria.
## What to provide
- Target material, scope, expected result, and forbidden changes.
- Whether network, commands, file writes, or external services are allowed.
## Execution rules
- Organize steps around “Context Pointers / Trigger Conditions / Direct Invocation” and keep inference separate from source facts.
- read files, write/modify files, run shell commands; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding the task.
## Output requirements
- Return the deliverable, key evidence, validation method, and next action.
- Mark missing information as unknown; do not invent commands, platforms, or dependencies. The author source anchors workflow facts; repository files anchor sources and commands; Fluxly only adds fit, limitations, and quality judgment.
skill "skill-filetypes" {
input -> user goal + target files + boundaries + acceptance criteria
context -> Context Pointers / Trigger Conditions / Direct Invocation
rules -> SKILL.md triggers / order / output contract
runtime -> no special runtime | read files, write/modify files, run shell commands | mostly runs locally
guardrails -> usually needs no extra API key + small-sample validation + diff/log review
output -> copyable result + checklist + next iteration
} 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:
.opencode/context/core/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
/convertcommand - 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 existoutput_path- Optional, defaults to source dir with appropriate extension
# 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:
{
"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 .opencode/agents/ or extension agent directories, not .opencode/skills/.
The Skill tool can only invoke skills from .opencode/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 .opencode/context/core/formats/subagent-return.md for full specification.
Expected successful return:
{
"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.
Decide Fit First
Design Intent
How To Use It
Boundaries And Review