一个skill解决塔拉啦偷懒搞外包导致幻觉!

05/2588 浏览开发心得 包含 AI 合成内容
最近使用的时候总是会出现幻觉现象,考虑到以前的塔拉啦并没有如此严重幻觉,所以针对这块做了些研究和总结,收集了各个幻觉的产生点,发现很多是task内出现的。
究其原因,就是
塔拉啦无脑转包了太多自己应该处理的任务给完全没有上下文的task新人
“如果把这个任务的 prompt 复制给一个刚入职的新人,他能完成吗?”
  • 能 → Task
  • 不能→ 需要自己处理
最后出了问题新人背锅。
最后写了个skill让 task-tool 的分配更加合理,减少因为缺少上下文导致的幻觉。
name: task-tool-rules
description: Rules and constraints for correct use of the Task tool. Use when you are about to call the Task tool to launch a sub-agent, or when deciding how to execute a task that involves running code, bash commands, or file operations. Prevents misuse of Task as a code execution environment.Task Tool RulesCore Principle: When to Use Task vs Handle DirectlyNeeds conversation context → Handle directly
Completely independent     → Task agent
The one-question test: “If I copy this prompt to a new agent with zero conversation history, can it complete the task?”
  • Yes → Task
  • No (needs background from earlier in the conversation) → Handle directly
  • Read, search, and write files (Read/Write/Edit/Grep/Glob)
  • Execute shell commands (Bash agent)
  • Browse the web, answer questions, plan implementations
Pass the file path as text; the agent calls Read/Grep/Glob on its own:✅ CORRECT:
Task("Read /workspace/scripts/main.lua and find all SubscribeToEvent calls")
❌ WASTEFUL:
Task("Here is the file content: [10000 tokens]... find all SubscribeToEvent calls")
What the Task Tool is NOTThe Task tool is NOT a code execution environment.❌ WRONG — using Task to run code:
Task("Run this Python script and return the output")
Task("Execute the build and check for errors")
✅ CORRECT — use Bash directly:
Bash("python3 script.py")
mcp__mkr__Bash(command="python3 script.py")
Agent PermissionsAll agent types share the same filesystem as the parent — no sandbox isolation. Sub-agents can write and delete files. Constrain behavior explicitly in the prompt if read-only is needed.AgentToolsCan write files?general-purposeAll (*)✅ YesExploreAll✅ Yes (but semantically read-oriented)PlanAll✅ YesBashBash only✅ Yes (via shell commands)Decision RuleNeedCorrect toolSearch for a function in the codebaseTask (Explore)Understand how a module worksTask (general-purpose)Plan an implementationTask (Plan)Read a specific known file pathRead tool directly (faster)Run a Python/Bash/shell commandBash directlyBuild/compile/test the projectBash or build tool directlyWrite a fileWrite/Edit directlyParallelism RuleWhen multiple Task calls are independent, launch them in a single message:✅ Parallel (one message, multiple tool calls):
[Task("Search file A"), Task("Search file B")]
❌ Sequential when parallel is possible:
Task("Search file A") → wait → Task("Search file B")
Result Storage
  • Foreground: Result returns as text into conversation context. No file written.
  • Background (run_in_background=true): Result written to a temp file; use Read or tail to retrieve.
  • Results are never auto-persisted — write explicitly with Write tool if needed.
10
4