fix: guide agent to a real public link instead of dead-ending on apps__create_app

Diagnosed via production session logs (RDS + shared goose PG) that some
users' page-generation attempts drifted: the agent used apps__create_app
(no public URL) then fabricated a placeholder domain when asked for a
link, and separately burned many turns scraping unreachable/anti-bot
search engines. Steer both flows toward the already-working path instead
of banning tools outright:

- apps__create_app is fine for designing/previewing a page, but the
  agent must still write_file the result into public/*.html per the
  static-page-publish skill and return a link built from the real
  public URL template (no invented domains)
- for real-world lookups, load_skill('web') first and prefer
  Bing/360 over retrying google.com or hammering anti-bot sites

Also folds in generate_docx guidance for Word-download attachments
(sandbox-fs tool) that landed in the same files during this pass.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
john
2026-07-01 14:11:09 +08:00
parent b273bb7aa2
commit 862824202f
4 changed files with 27 additions and 6 deletions
+4 -1
View File
@@ -14,6 +14,7 @@ description: 在专属 MindSpace 目录生成可公开访问的静态 HTML 报
## 规则摘要
0. 可以用 `apps__create_app` 设计/预览页面,但那一步只是在 Apps 窗口内生成交互式 App,**还没有公网链接**;只要用户要「可访问的链接」「分享出去」,最后必须把内容 `write_file` 落到 `public/*.html`,按下方「回复格式」给出真实链接,不要停在 App 阶段就回复链接
1. 只在**当前用户工作区**(会话 `working_dir`)内读写与搜索,从 `.` 开始
2. 查找 CSV/文档时只用相对路径(如 `oa/report.csv`),**禁止**去上级目录、MindSpace 根目录、其它用户目录或主机路径搜索
3. 读 CSV/列目录:用工作区内的 `shell``ls oa/``cat file.csv`)或 `tree`**禁止**用公网 URL 代替
@@ -32,12 +33,13 @@ description: 在专属 MindSpace 目录生成可公开访问的静态 HTML 报
3.`<head>` 写入 **mindspace-cover**(必须与页面主题一致,见下文)
4. 保存后服务端**立即**生成 `<文件名>.thumbnail.svg`Agent 交互阶段即生效)
5. 按「回复格式」返回**可点击**公网链接
6. 若页面含下载按钮,确认 `public/<同名>.docx`(或链接中的相对路径)已落盘
6. 若页面含下载按钮,必须用 `generate_docx`sandbox-fs 工具)生成 `public/<同名>.docx`,再确认链接目标已落盘
## 伴生下载文件(必须)
- `<a href="report.docx" download>` 等相对下载链接,目标文件必须已在 HTML 同目录或子目录
- 推荐 `public/report.html` + `public/report.docx`;**禁止** HTML 链接名与磁盘文件名不一致
- 生成 Word 时必须调用 sandbox-fs 的 `generate_docx`**禁止**用 `computercontroller` / shell 生成生产下载文件作为交付依据
-`oa/` 引用文档时,先 **复制**`public/` 再写链接
- 交付前 `list_dir public/` 自检;可跑 `npm run check:mindspace-public-links`
@@ -53,6 +55,7 @@ description: 在专属 MindSpace 目录生成可公开访问的静态 HTML 报
- **必须**使用 `[页面标题](完整URL)`,不要只给裸 URL 或「点这里」
- 页面写入 `public/` 时,URL **必须**包含 `/public/` 路径段(与磁盘路径一致)
- 域名严格按本节模板拼接(`https://goo.tkmind.cn/MindSpace/<用户ID>/public/...`);拿不到真实前缀时,先给相对路径 `public/xxx.html` 说明,不要自己猜一个域名
- 标题用页面真实主题名
- 可同时给出相对路径(如 `public/malaysia-travel-guide.html`
- 说明:保存即生效,无需重启
+6
View File
@@ -26,3 +26,9 @@ description: 网页抓取与搜索技能:访问网页、查阅文档、搜索
2. `extract_text: true`(默认)获取可读文本,`false` 获取原始 HTML
3. 不要访问不明来源的链接,向用户确认后再访问
4. 官方文档优先于第三方博客
## 国内网络环境(建议)
- 生产环境访问不了 `google.com`,优先用本技能的 `web_search`DuckDuckGo/`fetch_url`,避免直接拿 `computercontroller__web_scrape` 抓 Google 页面来回重试
- `web_search` 连续几次没有可用结果时,改用 `fetch_url` 直接访问 `https://cn.bing.com/search?q=...``https://www.so.com/s?q=...` 这类国内可达的搜索入口
- 百度/知乎/大众点评等站点有反爬拦截,遇到跳转或空结果就换个搜索源,不必在同一个来源上反复硬抓