hydr0pon1c/skills-on-the-fly/168-17

Claude Code and agent skill by hydr0pon1c/skills-on-the-fly

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Install

npx vskill@latest install hydr0pon1c/skills-on-the-fly/168-17

SKILL.md

The same SKILL.md was published earlier as hydr0pon1c/skills-on-the-fly/168-17.

SKILL.md

When to use

Use this skill when the target task requires row deletion in a single sheet of an Excel workbook, based on locating the first occurrence of a specific text string in a column (typically column A). The task is a Sheet-Level Manipulation where the output must place the row containing that text at the top of the sheet (cell A1 after deletion). The agent must write a macro (Python code using openpyxl) that:

  • Opens the given .xlsx file.
  • Searches case‑insensitively for the target phrase in the specified column.
  • Deletes all rows above the first occurrence, leaving that row and any rows below untouched.
  • Saves the result to the required output path.

Before acting, gather:

  • The exact target sheet name (from the spreadsheet_content).
  • The target column (typically A, but confirm from instruction).
  • The exact search phrase (case‑insensitive matching expected).
  • The answer_position range – this indicates the final expected range after deletion (e.g., 'Statement'!A2:E12 tells you the header row will be row 1 and data starts at row 2).
  • Any existing rows that may contain the phrase partially (e.g., “Invoice No.” inside longer text) – the instruction usually asks for the first instance, but check for partial matches using regex or str.contains.

Possible Failure Modes

  • Off‑by‑one row index: Deleting the target row itself instead of rows above it, or failing to account for 1‑based row indexing in openpyxl.
  • Case sensitivity: Using an exact match without case‑insensitivity may miss “invoice no.” or “INVOICE NO.”
  • Forgetting to delete in reverse order: If rows are deleted from top to bottom, indices shift and the wrong rows are removed. Always delete from bottom to top.
  • Assuming only one occurrence: The task asks for the first instance; after deletion the sheet should have that row at the top. If there are multiple occurrences, ensure only rows above the first are deleted.
  • Ignoring empty rows above: The spreadsheet may contain blank rows or non‑data rows (e.g., company name, account number). The macro must still delete them all above the found row.
  • Misinterpreting `answer_position`: The given range (e.g., 'Statement'!A2:E12) is the expected valid range after manipulation. If the target row ends up not being row 1, or if the range is off, the evaluator will flag mismatches.
  • Partial/multiple string matches: Using str.contains or re.search may match a substring that is not the intended phrase (e.g., “Invoice No.” inside “Invoice Number”). Use exact phrase matching (e.g., re.search(r'Invoice No\.', cell_value, re.IGNORECASE) ensures the period is included).
  • Modifying the wrong sheet: The target sheet name must be exactly as given (e.g., “Statement”), not “Sheet1” or any other default.

Possible procedures

  1. Load the workbook using openpyxl.load_workbook(input_path). Select the target sheet by name.
  2. Read column A (or the specified column) in order from row 1 to the last used row. For each cell:
  • Check if the value is a non‑None string.
  • Apply a case‑insensitive search for the exact phrase. Use re.search(r'Your Phrase\.', cell_value, re.IGNORECASE) to handle punctuation like a period. Make sure the phrase matches the instruction exactly (including punctuation, spaces).
  • Stop at the first match and record its row number (row_to_keep).
  1. If `row_to_keep` is found, delete all rows from row 1 to row_to_keep - 1. Crucially, delete in reverse order (from the highest row index to the lowest) to preserve row indices:

``python for r in range(row_to_keep - 1, 0, -1): ws.delete_rows(r) ``

  1. Save the workbook to the provided output_path. Overwrite the existing file.
  2. Recovery check: If no match is found (e.g., the phrase is missing or spelled differently), do not delete anything. Save the original workbook unchanged. This is safer than corrupting data.
  3. Decision point – multiple sheets: If the task involves another sheet (not in this target, but seen in retrieved), always verify that deletion logic is correctly scoped to the correct column pairs and that you do not over‑delete on the second sheet.

Verification Checklist

  • [ ] Target row is row 1: After deletion, verify that the cell containing the search phrase is now in A1. You can print its value to confirm.
  • [ ] Rows above deleted: Ensure no rows above the matched row remain (the sheet should start with that row).
  • [ ] Rows below are untouched: The rows after the matched row (including that row) should retain their original data, order, and formatting.
  • [ ] Case‑insensitivity: Test with different casing of the phrase in your code (e.g., re.IGNORECASE). The evaluator may use any casing.
  • [ ] Exact phrase matching: The phrase must include any punctuation (e.g., a period after “No.”). Your regex or string comparison must account for that.
  • [ ] Answer‑position consistency: The answer_position field (e.g., 'Statement'!A2:E12) implies that after deletion, the data range from row 2 onward is expected. If your code incorrectly deletes the matched row as well, this range will shift.
  • [ ] No unrelated state changes: Only rows above the first occurrence are deleted. No other cells, sheets, or formatting should be altered.
  • [ ] File saved to correct output path: Verify that wb.save(output_path) writes to the exact path provided in output_path. Use os.path.exists() or confirm the file is non‑empty.
  • [ ] Error recovery: If the search phrase is not found, the code should not delete any rows. Consider adding an if row_to_keep is not None guard.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/hydr0pon1c/skills-on-the-fly/168-17/badge)](https://verified-skill.com/skills/hydr0pon1c/skills-on-the-fly/168-17)

Something wrong with this skill or its page? Tell us.