Unified workflow that delegates failed web searches to shell_agent for resilient data gathering, then applies anchored spreadsheet proof gates for verified Excel output
60
68%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Low
Low-risk findings worth noting
Fix and improve this skill with Tessl
tessl review fix ./benchmarks/gdpval/skills/spreadsheet-proof-gate-merged/SKILL.mdUse this skill when you must gather web-based information AND produce verified Excel workbooks, with particular emphasis on handling tool failures gracefully and proving final outputs against explicit criteria.
This skill combines:
This is an end-to-end workflow skill. It requires:
Use this skill when ANY of the following are true:
When search_web returns errors like:
Immediately delegate to shell_agent rather than retrying the same failing tool.
A spreadsheet task is only complete when:
PASS, FAIL, or UNAVAILABLE-IN-SOURCEAll discovery, reads, writes, and verification must be anchored to the exact workspace path provided for the task.
The data you gather in Phase A becomes part of the verification criteria in Phase C. Track:
Your output should be based on proof, not inference.
For every task using this workflow, maintain these artifacts internally:
The post-write proof checklist is decisive for spreadsheet claims. The research inventory is decisive for data coverage claims.
First, try search_web with your primary query:
search_web(query="your specific query with date/context")Monitor for these failure signals:
Failure threshold: If search_web fails 2+ times on the same or related queries, escalate to shell_agent.
When failure threshold is reached, create a comprehensive shell_agent task:
shell_agent(
task="""
Gather [SPECIFIC DATA TYPE] for [SPECIFIC PURPOSE].
Required information:
1. [Item 1 with specificity - e.g., "Current WTI crude oil price as of today"]
2. [Item 2]
3. [Item 3]
Success criteria:
- Data from at least 2 independent sources
- Timestamp for when data was collected
- Source URLs for verification
Handle errors by trying alternative approaches (different APIs, direct URL fetching, etc.)
Provide structured output with source citations.
""",
timeout=300
)Key task formulation principles:
Check shell_agent output for:
Gate A: Do not proceed to Phase B until you have verified research results OR have explicitly documented what data could not be obtained and why.
Before using research data in spreadsheet work, validate it:
For each required data point:
PASS. If no, mark UNAVAILABLE-IN-SOURCE with reason.If multiple sources were used:
Translate research data into explicit spreadsheet criteria:
Gate B: Do not proceed to Phase C until you have a clear mapping from research data to spreadsheet criteria.
Search under the exact workspace root for plausible Excel files:
.xlsx, .xlsm, .xlsPrefer files that:
If several files are plausible, inspect all before choosing.
Before editing, convert requirements into checkable criteria:
Possible criterion types:
required-sheet: <name> existsrequired-column: Sheet <name> has column "<column>"data-populated: Column <X> in Sheet <Y> has values for all data rowsformula: Column <Z> contains formulas for all populated rowsrow-count: Sheet <name> has exactly N data rowspreservation: Source sheet <name> still existsresearch-derived: Data from <source> appears in <location>Good examples:
required-sheet: Summary existsrequired-column: Sheet Sample has column "Selected"row-count: exactly 25 marked rows in Sampleresearch-derived: WTI price from shell_agent appears in Summary!B2Bad examples:
workbook looks rightsampling seems okaymost tabs presentBefore any write, inspect the workbook structure:
Identity consistency check: If you inspect the workbook multiple times or with multiple tools, the inspections must agree on path, sheet names, row counts, and headers. If they disagree, treat workbook identity as unconfirmed.
Proceed only if ALL are true:
Otherwise, stop and report the mismatch.
Only after the workbook passes pre-edit audit:
Record at minimum:
This phase is mandatory.
After saving, directly inspect the saved workbook from disk with Python and openpyxl. Do not finalize from memory, delegated prose, or a generic success message.
from pathlib import Path
from openpyxl import load_workbook
WORKBOOK = Path("TARGET.xlsx")
TRUTHY = {"x", "yes", "true", "1", "y"}
def norm(v):
if v is None:
return ""
return str(v).strip()
def lower(v):
return norm(v).lower()
def first_nonempty_row(ws, max_scan=20):
for r in ws.iter_rows(min_row=1, max_row=min(ws.max_row, max_scan), values_only=True):
vals = list(r)
if any(norm(v) != "" for v in vals):
return vals
return []
def data_rows(ws, header_row_idx=1):
count = 0
for row in ws.iter_rows(min_row=header_row_idx + 1, values_only=True):
if any(norm(v) != "" for v in row):
count += 1
return count
criteria = []
print(f"WORKBOOK: {WORKBOOK}")
print(f"EXISTS: {WORKBOOK.exists()}")
if not WORKBOOK.exists():
print("CRITERION|output-exists|FAIL|Workbook file missing")
raise SystemExit(0)
wb = load_workbook(WORKBOOK, data_only=False)
print(f"SHEETS: {wb.sheetnames}")
# Add your criterion checks here
# Example:
# required_sheets = ["Summary", "Data"]
# for sheet in required_sheets:
# status = "PASS" if sheet in wb.sheetnames else "FAIL"
# print(f"CRITERION|required-sheet-{sheet}|{status}|Sheet {sheet} {'found' if status == 'PASS' else 'missing'}")
for ws in wb.worksheets:
headers = first_nonempty_row(ws)
print(f"SHEET|{ws.title}|HEADERS|{headers}")
print(f"SHEET|{ws.title}|DATA_ROWS|{data_rows(ws)}")
# Print final criterion summary
for criterion_line in criteria:
print(criterion_line)The verification must report:
Each criterion must end in exactly one status:
PASS — requirement satisfied by direct inspectionFAIL — requirement not satisfiedUNAVAILABLE-IN-SOURCE — requirement could not be satisfied because required source information was absentDo not replace these with softer wording like "looks okay", "appears complete", "probably satisfied", etc.
You may finalize only when EVERY required criterion is either:
PASS, orUNAVAILABLE-IN-SOURCE with explicit reconciliationYou must NOT finalize when:
FAILIf direct proof says the workbook is incomplete, that proof is authoritative.
UNAVAILABLE-IN-SOURCEIf the task environment shows signs of tool instability (multiple tools failing with "unknown error"):
execute_code_sandbox for custom data processing after shell_agent gathers raw datacreate_file to persist collected research data for downstream tasksread_webpage with shell_agent for targeted extraction when specific URLs are identifiedResearch criteria:
Spreadsheet criteria derived:
required-sheet: Competitor_Prices existsrequired-column: Sheet Competitor_Prices has columns "Competitor", "Product", "Price"data-populated: Competitor_Prices has 6 rows (3 products × 2 competitors)research-derived: Competitor A data appears in rows 2-4Research criteria:
Spreadsheet criteria derived:
required-sheet: Market_Data existsrequired-column: Sheet Market_Data has columns "Metric", "Value", "Source", "Timestamp"row-count: Market_Data has exactly 4 data rowsresearch-derived: WTI price from shell_agent appears in Market_Data!B2research-derived: Source URLs are recorded in Market_Data!Column Dc5a9c4b
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.