Skill sheet

From benbrastmckie/nvim · View interactive version

Skill sheet is an AI agent skill from the GitHub repository benbrastmckie/nvim. XLSX creation, editing, and analysis routing to sheet-agent

How to use this skill

Skill file

XLSX Skill

Thin wrapper that routes XLSX creation, editing, and analysis requests to the sheet-agent, which manipulates spreadsheets using openpyxl and pandas via Bash.

Context Pointers

Reference (do not load eagerly):

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

Implicit Invocation (during task implementation)

When an implementing agent encounters any of these patterns:

Plan step language patterns:

File extension detection:

Task description keywords:

When NOT to Trigger

Do not invoke for:


Execution

1. Input Validation

Validate required inputs:

# For edit mode: validate source exists and is xlsx/xlsm
if [ "$mode" = "edit" ]; then
  if [ ! -f "$file_path" ]; then
    return error "XLSX file not found: $file_path"
  fi
  if [[ "${file_path##*.}" != "xlsx" && "${file_path##*.}" != "xlsm" ]]; then
    return error "Source must be a .xlsx or .xlsm file: $file_path"
  fi
fi

# For analyze mode: validate source exists
if [ "$mode" = "analyze" ]; then
  if [ ! -f "$file_path" ]; then
    return error "File not found for analysis: $file_path"
  fi
fi

# For create mode: validate xlsx extension
if [ "$mode" = "create" ]; then
  if [[ "${file_path##*.}" != "xlsx" && "${file_path##*.}" != "xlsm" ]]; then
    return error "New file must have .xlsx or .xlsm extension: $file_path"
  fi
fi

2. Context Preparation

Prepare delegation context:

{
  "file_path": "/absolute/path/to/spreadsheet.xlsx",
  "instruction": "Create a budget tracking spreadsheet with categories, monthly columns, and SUM formulas",
  "mode": "create",
  "metadata": {
    "session_id": "sess_{timestamp}_{random}",
    "delegation_depth": 1,
    "delegation_path": ["orchestrator", "sheet", "skill-sheet"]
  }
}

3. Invoke Agent

CRITICAL: You MUST use the Task tool to spawn the sheet-agent.

Required Tool Invocation:

Tool: Task (NOT Skill)
Parameters:
  - subagent_type: "sheet-agent"
  - prompt: [Include file_path, instruction, mode, metadata]
  - description: "{mode} {file_path}: {instruction}"

DO NOT use Skill(sheet-agent) - this will FAIL.

Agents live in .opencode/agent/subagents/ or extension agent directories, not .opencode/skills/.

The Skill tool can only invoke skills from .opencode/skills/.

The agent will:

4. Return Validation

Validate return matches subagent-return.md schema:

Status value rules:

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": "created",
  "summary": "Created budget.xlsx with 4 category rows, monthly columns Jan-Dec, SUM formulas for totals, and currency formatting.",
  "artifacts": [
    {
      "type": "implementation",
      "path": "/absolute/path/to/budget.xlsx",
      "summary": "XLSX workbook with formulas and formatting"
    }
  ],
  "metadata": {
    "session_id": "sess_...",
    "agent_type": "sheet-agent",
    "delegation_depth": 2,
    "delegation_path": ["orchestrator", "sheet", "skill-sheet", "sheet-agent"],
    "tool_used": "openpyxl",
    "mode": "create",
    "sheets": 1,
    "rows": 6,
    "columns": 14
  },
  "next_steps": "Open spreadsheet to verify formulas and formatting"
}

Error Handling

Input Validation Errors

Return immediately with failed status if file not found, not a .xlsx/.xlsm, or instruction is empty.

Unsupported Format

Return failed status if file extension is not .xlsx or .xlsm (for create/edit). Suggest using /convert or /table for other spreadsheet operations.

Agent Errors

Pass through the agent's error return verbatim.

Tool Not Available

Return failed status with installation instructions for openpyxl and pandas.


MUST NOT

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.