You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Quick-reference catalog (name + first-line description) BEFORE
307
-
// the inline `<skills>` block. The full SKILL.md content can be
308
-
// 100+ KB total; a tiny name-only index up front lets the model
309
-
// match "the user said 'use skill X'" against the catalog in one
310
-
// pass instead of scanning the whole inline section. Catches the
311
-
// "我手头没有 X" hallucination that showed up in group chats where
312
-
// attention got diluted by the group_chat block — by the time the
313
-
// model reached `<skill name="X">`, it had already decided X
314
-
// didn't exist. Sorted (same order as the inline blocks below)
315
-
// for diff-friendly logs.
316
-
sb.WriteString("\n\n<skill_catalog>\nPre-installed skills available to this agent (full SKILL.md content follows below). Treat any user mention of one of these names as a request to invoke that skill via exec:\n")
307
+
alwaysLoad:=sl.alwaysLoadSet()
308
+
inline:=make([]Skill, 0)
309
+
310
+
sb.WriteString("\n\n<skill_catalog>\nPre-installed skills available to this agent. Treat any user mention of one of these names as a request to use that skill. Call `load_skill` with the skill name before following its detailed instructions:\n")
// rationalization ("this is one-shot, skip the ladder") that produced
361
385
// reflexive `pip install` calls for tasks a published skill would handle.
362
386
constskillsDirective=`<skill_usage_rules>
363
-
The skills listed below are pre-installed for this agent. Each skill's full SKILL.md is included inline. To invoke one, run its main script via the exec tool and pass arguments on stdin as JSON; the SKILL.md describes args and return shape.
387
+
The skills listed below are pre-installed for this agent. Only the catalog is always in context. Before using a skill, call the "load_skill" tool with its name to load the full SKILL.md instructions, then follow those instructions exactly. If an always-loaded skill is included inline below, you may use those inline instructions directly.
364
388
365
389
The sandbox image already has: python3 + pip, uv + uvx, node + npm + npx, the camoufox-cli anti-detect browser (run as `+"`camoufox-cli open <url>`"+` then `+"`camoufox-cli snapshot -i`"+` for refs; Camoufox/Firefox is pre-downloaded), git, curl, requests / pillow / beautifulsoup4 / lxml. DO NOT reinstall any of these — wasted tool calls and timeouts. If you see "command not found", check the spelling before reaching for npm/pip.
366
390
367
391
HTML preview: when the user asks to see / preview a web artifact, write the final HTML into the workspace and tell them the filename — the chat UI auto-renders .html files in a sandboxed iframe (CSS, JS, images, fonts work; cross-origin fetch from null origin does not). For source projects with a package.json (React, Vue, Vite, Next, …), run the project's build first (`+"`pnpm i && pnpm build`"+` or the documented command) and point at the resulting `+"`dist/index.html`"+` (or equivalent). Live dev servers (`+"`vite dev`"+`, `+"`next dev`"+`, `+"`npm run dev`"+`) are NOT reachable from the browser — do not start them; they will hang and waste turns.
368
392
369
-
When the inline skills don't cover what the user asked for, follow this order BEFORE running any package install (pip / npm / apt / brew / cargo / gem / go install / …) via exec:
393
+
When the listed skills don't cover what the user asked for, follow this order BEFORE running any package install (pip / npm / apt / brew / cargo / gem / go install / …) via exec:
370
394
371
395
1. If a "find-skills" skill is listed above, run it FIRST to search the open skill ecosystem. If a credible match exists, surface it and offer to install it instead of installing the package yourself.
372
396
2. If no published skill fits, use "skill-creator" (if listed) to scaffold a new skill under skills/<name>/, then invoke it. Prefer this over inline scripts whenever the user might ask the same kind of thing again.
r.Register("load_skill", "Load the full content of a skill by name. Use this when you need detailed instructions for a specific skill.", map[string]interface{}{
0 commit comments