hydr0pon1c/skills-on-the-fly/254-34
Claude Code and agent skill by hydr0pon1c/skills-on-the-fly
- community
Checking that the SKILL.md file is still in the repository.
Install
npx vskill@latest install hydr0pon1c/skills-on-the-fly/254-34SKILL.md
The same SKILL.md was published earlier as hydr0pon1c/skills-on-the-fly/254-34.
SKILL.md
When to use
Use this skill when you need to automate the identification of cells in a spreadsheet that form a subset with a specific numeric sum (or within a target sum range), highlight those cells with a given color, and output the sum value to a designated cell. This includes tasks where:
- The user has manually identified a subset in a "before" sheet and wants an automated solution.
- The goal may involve highlighting one valid combination (not necessarily all) that achieves a target sum or falls within a range.
- You are asked to delete an extra sheet and preserve all other state.
- The answer position is a single cell meant to contain the sum (or the combination's numeric value).
Before acting, gather:
- Which sheet(s) contain the source numeric values? (often a single column/row of numbers)
- What is the target sum or range? (e.g., "between 994108 and 994112")
- Which cell should receive the sum value?
- Exact highlight color (hex code, e.g., #00FF00)
- Any sheets to delete or exclude.
Possible Failure Modes
- Misidentifying source cells: Assuming the numbers are in a continuous range when they may be scattered, or treating header rows as data. Always verify by reading the actual cell values and their locations.
- Subset sum algorithm choice: For small sets (<30 numbers), use exact enumeration or integer programming; for larger sets, use approximate or heuristic search. Failing to handle multiple valid combinations (the task likely expects exactly one valid combination that matches the manual highlight).
- Off-by-one errors in row/column indices: Especially when writing the sum to the answer cell (e.g., forgetting that openpyxl uses 1-indexed rows/cols).
- Forgetting to delete the specified sheet: or deleting the wrong sheet. Confirm the sheet name and existence.
- Using wrong color format: openpyxl requires
PatternFill(start_color='00FF00', end_color='00FF00', fill_type='solid'); using a different format can cause invisible highlighting. - Modifying cells outside the answer_position: The evaluator may only check the specified range; overwriting other cells may be acceptable but avoid unintended damage.
- Overwriting the target cell with incorrect value: The sum must be exactly the highlighted subset's total (numeric, not text with formatting).
- Assuming data order: The highlighted subset may be any set of cells, not necessarily contiguous. Do not assume sorting or ordering.
- Not preserving other sheets: Only delete the explicitly named sheet; keep all others unchanged.
Possible procedures
- Load workbook using
openpyxl.load_workbook(). Verify all sheet names. - Read the "Before" sheet to identify the numeric values and their cell addresses. Use
ws.iter_rows()orws.cell()to collect all cells that contain numbers. Note any cells that are already highlighted (if provided as example). - Determine the target sum or range from the instruction. If a range is given, you may need to find a subset that falls within that range. If multiple exist, pick one (the instruction implies a single valid combination exists).
- Solve the subset-sum problem:
- If the number of numeric cells is small (<20-30), use a brute-force or dynamic programming approach to find a subset summing exactly to the target (or within range).
- For larger sets, consider using a heuristic (e.g., subset-sum approximation) or backtracking with pruning to find a valid combination. Ensure you return only one combination.
- Verify the sum of the selected subset equals the target (or lies within the range) to avoid floating-point rounding issues.
- Apply highlighting to each selected cell:
``python from openpyxl.styles import PatternFill green_fill = PatternFill(start_color='00FF00', end_color='00FF00', fill_type='solid') for cell_address in selected_cells: ws[cell_address].fill = green_fill ``
- Write the sum value to the answer cell (e.g.,
ws['C2'].value = total_sum). Ensure the value is a number, not a string. - Delete any extra sheets as instructed:
``python if 'Sheet3' in wb.sheetnames: del wb['Sheet3'] ``
- Save the workbook to the specified output path. Do not change any other sheets or cells.
- Recovery check: If the subset-sum search fails to find a valid combination, re-examine the data: ensure you included all numeric cells (including those with odd formatting), and consider that the target range might be inclusive at both ends.
Verification Checklist
- [ ] The only sheet deleted is the exact name given (e.g., "Sheet3") – confirmed by checking
wb.sheetnamesafter deletion. - [ ] The "Before" sheet has highlighted cells: each cell's
fill.start_color.rgbequals"00FF00"andfill.end_color.rgbequals"00FF00". Use a loop to verify. - [ ] The sum of all highlighted cells in "Before" equals the value written in the answer cell (e.g.,
C2). Compute the sum from the highlighted cells and compare. - [ ] The numeric value in the answer cell is a plain number (not a string, not a formula). Check with
isinstance(cell.value, (int, float)). - [ ] No other cells in any sheet have been modified (optional but recommended: keep a copy of original workbook for comparison).
- [ ] The answer cell is within the
answer_positionrange (if given as a single cell, confirm it matches exactly). - [ ] If a target range was specified (e.g., between 994108 and 994112), verify that the sum written to C2 lies within that inclusive range.
- [ ] The highlighted subset does not include any header rows or non-numeric cells. Ensure only numeric cells are highlighted.
- [ ] The output file path exists and the workbook can be reopened without errors.
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
- SKILL.md in the repositoryCheckingprompt_optimizer/runs/example/spreadsheet/task_skills/254-34/SKILL.md
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
[](https://verified-skill.com/skills/hydr0pon1c/skills-on-the-fly/254-34)