跳到正文
Skillpedia
写作7.8k · #13033

write-file-fallback-report

它能做什么

这项技能指导智能体在数据来源失败时,用文件写入工具撰写报告。适合即使没有最新数据,也需要清晰、专业文档的人。

适用场景

  • ✓当文件读取器返回二进制数据,或搜索工具返回错误或没有结果的时候。
  • ✓当代码沙箱在文档工作中反复失败的时候。
  • ✓当需要专业报告,并且智能体可以依靠公认事实撰写的时候。

技能链接

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/write-file-fallback-report/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/write-file-fallback-report/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请就这个主题撰写一份专业简报并保存为文件。搜索和文件工具都在失败,所以请运用你所知道的内容。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体停止尝试失败的工具,简要说明这一限制,然后直接用文件写入工具写出文档。它依靠已有的知识,以专业的版式组织内容。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Write-File Fallback Report Generation

When to Use This Skill

Use this workflow when attempting to generate a document or report, but multiple primary data source tools fail simultaneously:

  • read_file returns binary/image data instead of text (common with PDFs)
  • search_web returns errors or no results
  • execute_code_sandbox fails unexpectedly
  • Other data retrieval tools are unavailable

Key insight: Rather than getting stuck on failed data retrieval, pivot immediately to generating the document directly with write_file using professionally structured content and embedded domain knowledge.

Step-by-Step Instructions

Step 1: Detect Tool Failure Pattern

Recognize when you're in a fallback scenario:

TOOL_FAILURE_INDICATORS = [
    "read_file returns binary or image data",
    "search_web returns unknown error or empty results",
    "execute_code_sandbox fails repeatedly",
    "Multiple consecutive tool failures on data retrieval"
]

Decision point: If 2+ indicators are present, proceed to Step 2.

Step 2: Pivot to Write-File-First Approach

Stop attempting to fix the failing tools. Instead:

  1. Acknowledge the limitation briefly in your output
  2. Commit to generating the document with available knowledge
  3. Use write_file as your primary tool (not a last resort)

Step 3: Structure the Document Professionally

Create a well-organized markdown document with:

# [Document Title]

## Executive Summary
[Brief overview of key findings/content]

## Background
[Context and scope - use embedded knowledge]

## Main Content
[Organized sections with headers, lists, tables as appropriate]

## Limitations & Notes
[Transparent about data source limitations if relevant]

## Recommendations/Next Steps
[Actionable guidance based on available information]

Step 4: Leverage Embedded Domain Knowledge

When external data is unavailable:

  • Use general domain knowledge appropriately
  • Clearly distinguish between verified facts and general guidance
  • Include actionable frameworks rather than specific unverified data
  • Add placeholder notes where specific data would enhance the document

Example:

> **Note**: Specific [metric/data point] would typically be sourced from 
> [expected source]. The guidance below reflects established best practices 
> in this domain.

Step 5: Execute and Validate

# Example execution pattern
write_file(
    path="output/report.md",
    content=professionally_structured_markdown
)
# Verify the file was created successfully
list_dir(path=".")  # Confirm file exists

Code Example

# Detection and pivot pattern
def detect_and_pivot(task_goal):
    # After detecting tool failures:
    
    report_content = f"""# {task_goal} Report

## Executive Summary
This report was generated using established domain knowledge due to 
temporary unavailability of primary data sources.

## Key Frameworks and Guidance
[Structured content with headers, bullets, tables]

## Limitations
- Specific data points from [expected sources] were unavailable
- Recommendations based on general best practices

## Action Items
1. [Concrete step 1]
2. [Concrete step 2]
"""
    
    write_file(path="generated_report.md", content=report_content)
    return "Report generated successfully with embedded knowledge"

Best Practices

Do Don't
Pivot quickly after 2+ tool failures Keep retrying failing tools 5+ times
Be transparent about limitations Claim unverified specifics as facts
Provide actionable frameworks Leave the task incomplete
Use professional document structure Output unstructured text walls
Include next-step recommendations End without clear guidance

Common Pitfalls

  1. Over-apologizing: Acknowledge limitations once, then deliver value
  2. Under-delivering: A well-structured partial report beats no report
  3. Misrepresenting certainty: Use appropriate hedging language
  4. Skipping structure: Professional formatting increases usability

Success Criteria

The skill is successfully applied when:

  • Document is generated despite tool failures
  • Content is professionally structured (headers, sections, lists)
  • Limitations are transparently noted
  • Actionable guidance is provided
  • File is successfully created and verified
常见问题

为什么先写文件?

技能把写文件作为主要工具,使文档能够完成,而不是卡在检索上。

报告会提到缺失的数据吗?

技能要求智能体简要说明这一限制。

报告如何组织?

技能要求采用带有清晰章节的专业版式。

详情

作者的原始描述

Generate professional documents using write_file when primary data sources fail, leveraging embedded domain knowledge instead of external retrieval

repo: HKUDS/AgentPilot

热度

GitHub 星标
7.8k
排名
#13033
许可证
MIT
更新时间
2026/11/1

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能