← 返回 Skills 市场
richard-epsilla

Skills

作者 richard-epsilla · GitHub ↗ · v1.0.1 · MIT-0
linuxdarwinwin32 ✓ 安全检测通过
101
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install clawtrace-self-evolve
功能描述
Ask Tracy to analyze your recent trajectories and improve your agent behavior based on data-driven recommendations.
使用说明 (SKILL.md)

ClawTrace Self-Evolve Skill

You have access to ClawTrace, an observability platform that captures and analyzes all your trajectories. Use this skill to understand your own performance and improve over time.

When to Use This Skill

Invoke this skill when any of the following is true:

  • A run just completed and cost more than expected
  • A run failed or produced unexpected output
  • You've completed 5 or more runs since your last self-analysis
  • Your session is ending and you want to log learnings
  • You notice repeated failures on the same type of task

How to Call the Endpoint

Send a POST request to https://api.clawtrace.ai/v1/evolve/ask.

Authentication uses your observe key, which is already set in your environment as CLAWTRACE_OBSERVE_KEY.

import httpx
import os

def ask_tracy(question: str, trace_id: str = None, session_id: str = None) -> str:
    """Ask Tracy to analyze trajectories and return recommendations."""
    observe_key = os.environ.get("CLAWTRACE_OBSERVE_KEY", "")
    if not observe_key:
        return "ClawTrace observe key not configured."

    payload = {"question": question}
    if trace_id:
        payload["trace_id"] = trace_id
    if session_id:
        payload["session_id"] = session_id

    full_response = []

    with httpx.stream(
        "POST",
        "https://api.clawtrace.ai/v1/evolve/ask",
        headers={
            "Authorization": f"Bearer {observe_key}",
            "Content-Type": "application/json",
        },
        json=payload,
        timeout=120,
    ) as response:
        event_type = ""
        for line in response.iter_lines():
            if line.startswith("event: "):
                event_type = line[7:]
            elif line.startswith("data: ") and event_type == "text":
                import json
                data = json.loads(line[6:])
                full_response.append(data.get("text", ""))

    return "".join(full_response)

What to Ask — Question Templates

Use these questions for maximum insight. Substitute actual values for placeholders.

After a costly run

"My last run cost significantly more than usual. The trace_id is {trace_id}. 
What caused the cost spike and what should I change to prevent it?"

After a failed run

"My last run failed. The trace_id is {trace_id}. 
What step failed, what was the input that caused it, and how should I handle this case differently?"

Periodic self-analysis (every 5 runs)

"Analyze my last 10 trajectories. What patterns do you see in my failures? 
Where am I spending the most tokens? What one change would have the biggest impact on cost and reliability?"

Before a high-stakes task

"I'm about to execute a complex multi-step task. Based on my recent trajectory history, 
what are my most common failure modes and how should I guard against them?"

Context window management

"Is my context window growing too large across sessions? 
Review my recent traces and tell me if I should trim my history and when."

Tool call efficiency

"Which of my tool calls are taking the longest or failing most often? 
What can I change to make my tool usage more reliable and efficient?"

How to Act on Recommendations

When Tracy responds, follow these rules:

  1. Extract the core recommendation. Tracy will identify 1–3 specific changes. Focus on the highest-impact one.

  2. Apply changes to this session immediately. If Tracy says your context window is bloated, trim history now before continuing.

  3. Log the insight to your MEMORY.md. Record what you learned so future sessions benefit:

    ## ClawTrace Learnings — {date}
    - Issue: {what Tracy found}
    - Fix: {what I changed}
    - Impact: {expected improvement}
    
  4. Confirm the change worked. After applying a recommendation, mention it in your next response: "Based on trajectory analysis, I've adjusted X to prevent Y."

  5. Do not ask Tracy more than twice per session unless a new failure occurs. Each call consumes credits and Tracy's value is in patterns across many runs, not micro-optimization within one session.

Example — Full Interaction

# End of a session — periodic self-review
insight = ask_tracy(
    "Analyze my performance over the last 5 trajectories. "
    "What's costing the most, what's failing, and what's the single most important thing to fix?"
)

# Tracy responds with analysis
# You read it, extract the recommendation, and act:
# e.g. "Your context window averages 1,200 messages per LLM call. 
#       Trim to last 50 messages. This would cut input cost by ~90%."

# Apply immediately:
# → truncate conversation history to last 50 messages
# → log to MEMORY.md
# → confirm in next output

Important Notes

  • Tracy has access to your real trajectory data. Her analysis reflects actual runs, not simulations.
  • Responses stream as SSE — parse the text events to build the full response.
  • The session_id returned in the first SSE event can be reused to continue a conversation with Tracy across multiple calls.
  • Tracy respects tenant isolation — she can only see your own trajectories.
  • If you don't have a specific trace_id, omit it and Tracy will analyze recent trajectories automatically.
安全使用建议
This skill will send requests to https://api.clawtrace.ai and relies on CLAWTRACE_OBSERVE_KEY to authenticate—only install it if you trust that service to analyze your run histories. Before installing, consider: (1) audit what trajectory data ClawTrace will actually receive (the skill implies Tracy can access your real trajectories); (2) store the observe key with least privilege and rotate it if possible; (3) be aware the skill asks the agent to modify session history and append to MEMORY.md, so ensure your agent environment permits and tracks such changes if you care about auditability; (4) verify ClawTrace's privacy/retention policy if your traces contain sensitive data.
功能分析
Type: OpenClaw Skill Name: clawtrace-self-evolve Version: 1.0.1 The skill facilitates agent self-optimization by querying the ClawTrace observability platform (api.clawtrace.ai) for performance recommendations. It uses a dedicated API key (CLAWTRACE_OBSERVE_KEY) and standard HTTP streaming to receive analysis. While the instructions in SKILL.md and self-evolve.md direct the agent to dynamically apply recommendations received from the external service, this behavior is consistent with the stated purpose of 'self-evolution' and lacks indicators of malicious intent, obfuscation, or unauthorized data exfiltration.
能力评估
Purpose & Capability
The skill claims to analyze agent trajectories and only requires CLAWTRACE_OBSERVE_KEY and network access to api.clawtrace.ai. The declared env var directly matches the described authentication mechanism; no unrelated credentials, binaries, or config paths are requested.
Instruction Scope
SKILL.md instructs the agent to POST to https://api.clawtrace.ai/v1/evolve/ask using the observe key, parse SSE responses, extract recommendations, apply changes to the current session (e.g., trim history), and append an entry to MEMORY.md. These actions are coherent with a self-analysis skill, but they do grant the skill a path to modify agent-local state (session history and MEMORY.md). The file write to MEMORY.md and session-trimming are not declared as required config paths, so the agent implementation must have permissions to do those operations for the skill to work.
Install Mechanism
Instruction-only skill with no install spec and no code files; nothing is downloaded or written to disk by an installer. This is the lowest-risk install model.
Credentials
Only one env var (CLAWTRACE_OBSERVE_KEY) is required, which is proportionate and directly used for the API Authorization header. No other secrets or unrelated environment variables are requested.
Persistence & Privilege
The skill does not request always:true or other elevated privileges. It can be invoked by the agent (normal behavior) and instructs local changes (trim history, write MEMORY.md) which are reasonable for a self-improvement workflow but depend on the agent's permissions.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install clawtrace-self-evolve
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /clawtrace-self-evolve 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
Fix: metadata key clawdbot→openclaw so skill loads correctly into agent system prompt
v1.0.0
Initial release: OpenClaw agents can ask Tracy to analyze trajectories and get data-driven recommendations to improve themselves.
元数据
Slug clawtrace-self-evolve
版本 1.0.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Skills 是什么?

Ask Tracy to analyze your recent trajectories and improve your agent behavior based on data-driven recommendations. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 101 次。

如何安装 Skills?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install clawtrace-self-evolve」即可一键安装,无需额外配置。

Skills 是免费的吗?

是的,Skills 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Skills 支持哪些平台?

Skills 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(linux, darwin, win32)。

谁开发了 Skills?

由 richard-epsilla(@richard-epsilla)开发并维护,当前版本 v1.0.1。

💬 留言讨论