SkillClaw

repository·main·Indexed 24 days ago

https://github.com/amap-ml/skillclaw

A system for collective skill evolution in AI agents that intercepts interactions to automatically extract, deduplicate, and improve reusable skills stored as SKILL.md. It features a Client Proxy for intercepting requests and an optional Evolve Server for automating skill creation via workflow or agent engines. SkillClaw supports shared storage (OSS, S3, local) for team collaboration and integrates with frameworks like Hermes, Codex, Claude Code, and any OpenAI-compatible API.

Tokens
27.1K
Snippets
43
Records
171
Agent score
81%

What's inside skillclaw

  1. Supported Agent Integrations

    main

    SkillClaw is designed for broad compatibility and natively integrates with several agent frameworks and OpenAI-compatible APIs, including:

    • Hermes
    • Codex
    • Claude Code
    • OpenClaw
    • QwenPaw
    • IronClaw
    • PicoClaw
    • ZeroClaw
    • NanoClaw
    • NemoClaw
    • Any OpenAI-compatible API.
  2. Understand the SkillClaw Workspace Layout

    main

    The SkillClaw workspace is a structured environment where agent session data is analyzed to evolve a skill library. All file operations must stay within this directory.

    • sessions/: Contains JSON files of pre-processed agent sessions (input).
    • skills/: The skill library containing skill bundles (input/output).
      • SKILL.md: The entrypoint for a skill.
      • references/, scripts/, assets/: Optional supporting files.
      • history/: Persistent snapshots of previous skill versions and evidence.
    • manifest.json: Read-only reference for the current skill manifest.
    • skill_registry.json: Read-only reference for skill IDs and versions.
    workspace/
    ├── EVOLVE_AGENTS.md       ← this file (read-only)
    ├── sessions/              ← input: agent session JSON files to analyze
    │   └── <session_id>.json
    ├── skills/                ← input+output: current skill library
    │   └── <skill-name>/
    │       ├── SKILL.md       ← current version
    │       ├── references/    ← optional reference docs / prompts / notes
    │       ├── scripts/       ← optional helper scripts / tooling
    │       ├── assets/        ← optional templates / binaries / other assets
    │       └── history/       ← persistent across rounds
    │           ├── v1.md      ← previous SKILL.md snapshot
    │           └── v1_evidence.md
    ├── manifest.json          ← current skill manifest (read-only)
    └── skill_registry.json    ← skill ID & version info (read-only)
  3. How SkillClaw works: Client Proxy vs. Evolve Server

    main

    SkillClaw operates using two main components that interact via a shared storage layer (Alibaba OSS, S3, or local filesystem):

    1. Client Proxy: A local API proxy (implementing /v1/chat/completions and /v1/messages) that intercepts agent requests, records session artifacts, and manages your local skill library. This is the primary component required for basic usage.
    2. Evolve Server (evolve_server): An optional service that automates skill evolution. It reads session data from shared storage, evolves or creates skills, and writes them back. It supports two engines:
      • workflow: A fixed 3-stage LLM pipeline (Summarize → Aggregate → Execute).
      • agent: An OpenClaw-driven agent workspace that allows for direct skill editing.

    Deployment Strategies:

    • Single User + Auto-evolution: Install the client proxy and run an evolve server on the same machine (or any machine with access to your storage) to refine skills in the background.
    • Team / Shared Group: Multiple clients point to the same shared storage, and a single skillclaw-evolve-server is run for the group to create a collective evolution loop.
  4. Principles for improving and creating skills

    main

    When evolving skills, follow these core principles to ensure stability and utility:

    Conservative Editing (improve_skill)

    • Source of Truth: Treat the current SKILL.md as the source of truth, not a draft.
    • Targeted Edits: Default to small, targeted changes rather than full rewrites. Preserve original structure, headings, and terminology.
    • Evidence-Driven: Only rewrite sections if evidence shows they are materially wrong. If a section supports a successful session, leave it untouched.
    • Avoid Bloat: Do not add generic best practices (retry logic, caching) or agent-runtime advice (context overflow handling). Distinguish between Skill problems (missing guidance) and Agent problems (misuse of existing guidance).

    Skill Writing (create_skill)

    • Compress Environment Info: Focus on API endpoints, ports, payload formats, and tool quirks. Avoid generic best practices.
    • Naming: Use a short, action-oriented, lowercase-hyphenated slug. Ensure the name is unique by checking manifest.json.
    • Triggering: Use the description field as the main triggering mechanism, including explicit exclusion conditions (e.g., "NOT for: ...").
    • Content: Use imperative instructions and include concrete API/command patterns and payload examples.
  5. Understand the SkillClaw architecture and deployment models

    main

    SkillClaw consists of two main components that interact via a shared storage layer (supporting local, oss, or s3):

    1. Client Proxy: A local API proxy (intercepting /v1/chat/completions and /v1/messages) that intercepts Agent requests, records session outputs, and manages your local skill library. This is the minimum requirement to use SkillClaw.
    2. Evolve Server (evolve_server): An optional service that automates skill evolution by reading session data from shared storage, evolving/creating skills, and writing them back. It supports two engines:
      • workflow: A fixed three-stage LLM process (Summarize $\rightarrow$ Aggregate $\rightarrow$ Execute).
      • agent: An autonomous agent workspace based on OpenClaw that directly edits skill files.

    Deployment Scenarios

    • Single User + Auto-Evolution: Install the Client Proxy and run an Evolve Server on the same machine (or any machine with access to the shared storage).
    • Team / Shared Group: Multiple Clients point to the same shared storage, and the group runs a single skillclaw-evolve-server. All members' experiences contribute to a single evolution loop.
  6. Understand the SkillClaw operational model

    main

    SkillClaw operates on a decentralized client-server model designed for collective skill evolution:

    • Client Side: Every user runs their own skillclaw process and maintains a local configuration at ~/.skillclaw/config.yaml. Users belong to groups identified by a group_id.
    • Server Side: An evolve_server watches specific namespaces (groups). It monitors user sessions, converts them into reusable skills, and writes them back to the shared namespace.
    • Collaboration: Joining a group is handled via sharing configurations on the client side, allowing multiple agents and devices to access a unified, evolving skill library.
  7. Start and verify the SkillClaw client proxy

    main

    Once configured, start the client proxy in daemon mode and verify its health using the configured port.

    1. Start the proxy:
    skillclaw start --daemon
    1. Check status:
    skillclaw status
    1. Verify health via curl (using the configured port):
    PROXY_PORT="$(skillclaw config proxy.port | awk '{print $2}')"
    curl "http://127.0.0.1:${PROXY_PORT}/healthz"

    Note: The default port is 30000. You can inspect active settings with skillclaw config show.

    skillclaw start --daemon
    skillclaw status
  8. Install SkillClaw (Client Side)

    main

    To use SkillClaw as a local proxy for your agent, install it from the repository. Choose the command based on your operating system.

    macOS / Linux

    git clone https://github.com/AMAP-ML/SkillClaw.git && cd SkillClaw
    bash scripts/install_skillclaw.sh
    source .venv/bin/activate

    Windows (PowerShell)

    Since there is no native .ps1 script, perform a manual installation:

    git clone https://github.com/AMAP-ML/SkillClaw.git
    Set-Location SkillClaw
    python -m venv .venv
    .\.venv\Scripts\Activate.ps1
    python -m pip install -U pip
    python -m pip install -e ".[evolve,sharing,server]"
    bash
    git clone https://github.com/AMAP-ML/SkillClaw.git && cd SkillClaw
    bash scripts/install_skillclaw.sh
    source .venv/bin/activate
  9. Configure SkillClaw via the setup wizard

    main

    Run the skillclaw setup command to initialize your configuration. The wizard will prompt you for:

    • Provider & Model: Your LLM provider and specific model.
    • Local Skills Directory: Default is ~/.skillclaw/skills. Note that if using Hermes, Codex, or Claude Code, the default changes to ~/.hermes/skills, ~/.codex/skills, or ~/.claude/skills respectively.
    • PRM Settings: Preference for Process Reward Models.
    • CLI Agent Integration: Optional integration with external agents.
    • Shared Storage:
      • Disable for local-only use.
      • Enable local shared storage if you plan to run an evolve server on the same machine (e.g., using ~/.skillclaw/local-share).
      • Enable remote storage (OSS/S3) to join a shared group.
    skillclaw setup
  10. Enable Client-Side Skill Validation

    main

    You can optionally turn your client into a background validation node. This allows the group to use a "validated" publishing mode where candidate skills are reviewed by clients before being officially added to the shared directory.

    Configuration:

    skillclaw config validation.enabled true
    skillclaw config validation.idle_after_seconds 300
    skillclaw config validation.poll_interval_seconds 60
    skillclaw config validation.max_jobs_per_day 5

    Commands:

    • skillclaw validation status: Check validation status.
    • skillclaw validation run-once --force: Manually trigger a validation run immediately.

    Once configured, the validator runs automatically when you execute skillclaw start --daemon and the client is idle.

    skillclaw config validation.enabled true
    skillclaw config validation.idle_after_seconds 300
    skillclaw config validation.poll_interval_seconds 60
    skillclaw config validation.max_jobs_per_day 5
    
    skillclaw validation status
    skillclaw validation run-once --force
  11. Maintain skill evolution history

    main

    Every action taken to evolve a skill (create_skill, improve_skill, or optimize_description) must leave a history trail in the skills/<skill-name>/history/ directory. This acts as an evolution ledger to prevent reverting past improvements or contradicting previous evidence-based decisions.

    Mandatory Workflow for improve_skill and optimize_description:

    1. Check History: List skills/<skill-name>/history/. If it exists, you must read every v*.md and v*_evidence.md file to understand the full change trajectory.
    2. Snapshot Current State: Copy the current SKILL.md content verbatim to history/v<N>.md (where N is the current round number).
    3. Write Evidence: Create history/v<N>_evidence.md documenting the decision drivers (session IDs, PRM scores, failure patterns, etc.).
    4. Edit Skill: Modify the actual SKILL.md file.

    Mandatory Workflow for create_skill:

    1. Write Initial Evidence: Since no previous version exists, create history/v0_evidence.md explaining the motivation for creation (session IDs, failure patterns, and why no existing skill covers this pattern).
    2. Create Skill: Write the new SKILL.md.

    History Naming Rules

    • Use only version-based filenames: v<N>.md and v<N>_evidence.md.
    • Do NOT use dates, timestamps, or ad-hoc names (e.g., 2026-04-04.md or notes.md).
    • If no history exists for an existing skill, the first snapshot is v1.md and its evidence is v1_evidence.md.
    skills/<skill-name>/history/
    ├── v0_evidence.md ← why this skill was created (for create_skill)
    ├── v1.md          ← SKILL.md snapshot before round 1 edit
    ├── v1_evidence.md ← sessions/feedback that drove the v1→v2 change
    ├── v2.md          ← SKILL.md snapshot before round 2 edit
    ├── v2_evidence.md
    └── ...
  12. Quick Install SkillClaw

    main

    SkillClaw provides a shell installer for macOS and Linux. For Windows users, a manual Python installation path is required. After installation, you must initialize the setup and start the daemon to begin intercepting agent requests.

    To get started, run:

    skillclaw setup
    skillclaw start --daemon