模极社社区 - 制造业全产业链交流平台

    • 登录
    • 版块
    • 最新
    • 话题
    • 热门
    • 用户
    • 群组

    OpenClaw Integration——模具行业从业者必备知识手册

    社区公告
    1
    1
    0
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • S
      system 2 最后由 编辑

      <h2>OpenClaw Integration</h2>

      <p>Complete setup and usage guide for integrating the self-improvement skill with OpenClaw.</p>

      <h3>Overview</h3>

      <p>OpenClaw uses workspace-based prompt injection combined with event-driven hooks. Context is injected from workspace files at session start, and hooks can trigger on lifecycle events.</p>

      <h3>Workspace Structure</h3>

      <pre><code>
      ~/.openclaw/
      ├── workspace/ # Working directory
      │ ├── AGENTS.md # Multi-agent coordination patterns
      │ ├── SOUL.md # Behavioral guidelines and personality
      │ ├── TOOLS.md # Tool capabilities and gotchas
      │ ├── MEMORY.md # Long-term memory (main session only)
      │ └── memory/ # Daily memory files
      │ └── YYYY-MM-DD.md
      ├── skills/ # Installed skills
      │ └── <skill-name>/
      │ └── SKILL.md
      └── hooks/ # Custom hooks
      └── <hook-name>/
      ├── HOOK.md
      └── handler.ts
      </code></pre>

      <h3>Quick Setup</h3>

      <h4>1. Install the Skill</h4>

      <pre><code>
      clawdhub install self-improving-agent
      </code></pre>

      <p>Or copy manually:</p>

      <pre><code>
      cp -r self-improving-agent ~/.openclaw/skills/
      </code></pre>

      <h4>2. Install the Hook (Optional)</h4>

      <p>Copy the hook to OpenClaw's hooks directory:</p>

      <pre><code>
      cp -r hooks/openclaw ~/.openclaw/hooks/self-improvement
      </code></pre>

      <p>Enable the hook:</p>

      <pre><code>
      openclaw hooks enable self-improvement
      </code></pre>

      <h4>3. Create Learning Files</h4>

      <p>Create the <code>.learnings/</code> directory in your workspace:</p>

      <pre><code>
      mkdir -p ~/.openclaw/workspace/.learnings
      </code></pre>

      <p>Or in the skill directory:</p>

      <pre><code>
      mkdir -p ~/.openclaw/skills/self-improving-agent/.learnings
      </code></pre>

      <h3>Injected Prompt Files</h3>

      <h4>AGENTS.md</h4>

      <p>Purpose: Multi-agent workflows and delegation patterns.</p>

      <pre><code>

      Agent Coordination

      Delegation Rules

      • Use explore agent for open-ended codebase questions
      • Spawn sub-agents for long-running tasks
      • Use sessions_send for cross-session communication

      Session Handoff

      When delegating to another session:

      1. Provide full context in the handoff message
      2. Include relevant file paths
      3. Specify expected output format
        </code></pre>

      <h4>SOUL.md</h4>

      <p>Purpose: Behavioral guidelines and communication style.</p>

      <pre><code>

      Behavioral Guidelines

      Communication Style

      • Be direct and concise
      • Avoid unnecessary caveats and disclaimers
      • Use technical language appropriate to context

      Error Handling

      • Admit mistakes promptly
      • Provide corrected information immediately
      • Log significant errors to learnings
        </code></pre>

      <h4>TOOLS.md</h4>

      <p>Purpose: Tool capabilities, integration gotchas, local configuration.</p>

      <pre><code>

      Tool Knowledge

      Self-Improvement Skill

      Log learnings to .learnings/ for continuous improvement.

      Local Tools

      • Document tool-specific gotchas here
      • Note authentication requirements
      • Track integration quirks
        </code></pre>

      <h3>Learning Workflow</h3>

      <h4>Capturing Learnings</h4>

      <ol>
      <li><strong>In-session</strong>: Log to <code>.learnings/</code> as usual</li>
      <li><strong>Cross-session</strong>: Promote to workspace files</li>
      </ol>

      <h4>Promotion Decision Tree</h4>

      <pre><code>
      Is the learning project-specific?
      ├── Yes → Keep in .learnings/
      └── No → Is it behavioral/style-related?
      ├── Yes → Promote to SOUL.md
      └── No → Is it tool-related?
      ├── Yes → Promote to TOOLS.md
      └── No → Promote to AGENTS.md (workflow)
      </code></pre>

      <h4>Promotion Format Examples</h4>

      <p><strong>From learning:</strong></p>
      <blockquote>
      <p>Git push to GitHub fails without auth configured - triggers desktop prompt</p>
      </blockquote>

      <p><strong>To TOOLS.md:</strong></p>
      <pre><code>

      Git

      • Don't push without confirming auth is configured
      • Use gh auth status to check GitHub CLI a

      你在实际生产中遇到过类似问题吗?欢迎留言讨论。
      </code></pre>

      1 条回复 最后回复 回复 引用 0
      • First post
        Last post
      Powered by NodeBB | Contributors