{
  "schemaVersion": "1.0",
  "item": {
    "slug": "agent-self-governance",
    "name": "agent-self-governance",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/bowen31337/agent-self-governance",
    "canonicalUrl": "https://clawhub.ai/bowen31337/agent-self-governance",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/agent-self-governance",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=agent-self-governance",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "scripts/adl.py",
      "scripts/vbr.py",
      "scripts/vfm.py",
      "scripts/wal.py",
      "skill.toml"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/agent-self-governance"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/agent-self-governance",
    "agentPageUrl": "https://openagent3.xyz/skills/agent-self-governance/agent",
    "manifestUrl": "https://openagent3.xyz/skills/agent-self-governance/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/agent-self-governance/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Agent Self-Governance",
        "body": "Five protocols that prevent agent failure modes: losing context, false completion claims, persona drift, wasteful spending, and infrastructure amnesia."
      },
      {
        "title": "1. WAL (Write-Ahead Log)",
        "body": "Rule: Write before you respond. If something is worth remembering, WAL it first.\n\nTriggerAction TypeExampleUser corrects youcorrection\"No, use Podman not Docker\"Key decisiondecision\"Using CogVideoX-2B for text-to-video\"Important analysisanalysis\"WAL patterns should be core infra not skills\"State changestate_change\"GPU server SSH key auth configured\"\n\n# Write before responding\npython3 scripts/wal.py append <agent_id> correction \"Use Podman not Docker\"\n\n# Working buffer (batch, flush before compaction)\npython3 scripts/wal.py buffer-add <agent_id> decision \"Some decision\"\npython3 scripts/wal.py flush-buffer <agent_id>\n\n# Session start: replay lost context\npython3 scripts/wal.py replay <agent_id>\n\n# After incorporating a replayed entry\npython3 scripts/wal.py mark-applied <agent_id> <entry_id>\n\n# Maintenance\npython3 scripts/wal.py status <agent_id>\npython3 scripts/wal.py prune <agent_id> --keep 50"
      },
      {
        "title": "Integration Points",
        "body": "Session start → replay to recover lost context\nUser correction → append BEFORE responding\nPre-compaction flush → flush-buffer then write daily memory\nDuring conversation → buffer-add for less critical items"
      },
      {
        "title": "2. VBR (Verify Before Reporting)",
        "body": "Rule: Don't say \"done\" until verified. Run a check before claiming completion.\n\n# Verify a file exists\npython3 scripts/vbr.py check task123 file_exists /path/to/output.py\n\n# Verify a file was recently modified\npython3 scripts/vbr.py check task123 file_changed /path/to/file.go\n\n# Verify a command succeeds\npython3 scripts/vbr.py check task123 command \"cd /tmp/repo && go test ./...\"\n\n# Verify git is pushed\npython3 scripts/vbr.py check task123 git_pushed /tmp/repo\n\n# Log verification result\npython3 scripts/vbr.py log <agent_id> task123 true \"All tests pass\"\n\n# View pass/fail stats\npython3 scripts/vbr.py stats <agent_id>"
      },
      {
        "title": "When to VBR",
        "body": "After code changes → check command \"go test ./...\"\nAfter file creation → check file_exists /path\nAfter git push → check git_pushed /repo\nAfter sub-agent task → verify the claimed output exists"
      },
      {
        "title": "3. ADL (Anti-Divergence Limit)",
        "body": "Rule: Stay true to your persona. Track behavioral drift from SOUL.md.\n\n# Analyze a response for anti-patterns\npython3 scripts/adl.py analyze \"Great question! I'd be happy to help you with that!\"\n\n# Log a behavioral observation\npython3 scripts/adl.py log <agent_id> anti_sycophancy \"Used 'Great question!' in response\"\npython3 scripts/adl.py log <agent_id> persona_direct \"Shipped fix without asking permission\"\n\n# Calculate divergence score (0=aligned, 1=fully drifted)\npython3 scripts/adl.py score <agent_id>\n\n# Check against threshold\npython3 scripts/adl.py check <agent_id> --threshold 0.7\n\n# Reset after recalibration\npython3 scripts/adl.py reset <agent_id>"
      },
      {
        "title": "Anti-Patterns Tracked",
        "body": "Sycophancy — \"Great question!\", \"I'd be happy to help!\"\nPassivity — \"Would you like me to\", \"Shall I\", \"Let me know if\"\nHedging — \"I think maybe\", \"It might be possible\"\nVerbosity — Response length exceeding expected bounds"
      },
      {
        "title": "Persona Signals (Positive)",
        "body": "Direct — \"Done\", \"Fixed\", \"Ship\", \"Built\"\nOpinionated — \"I'd argue\", \"Better to\", \"The right call\"\nAction-oriented — \"Spawning\", \"On it\", \"Kicking off\""
      },
      {
        "title": "4. VFM (Value-For-Money)",
        "body": "Rule: Track cost vs value. Don't burn premium tokens on budget tasks.\n\n# Log a completed task with cost\npython3 scripts/vfm.py log <agent_id> monitoring glm-4.7 37000 0.03 0.8\n\n# Calculate VFM scores\npython3 scripts/vfm.py score <agent_id>\n\n# Cost breakdown by model and task\npython3 scripts/vfm.py report <agent_id>\n\n# Get optimization suggestions\npython3 scripts/vfm.py suggest <agent_id>"
      },
      {
        "title": "Task → Tier Guidelines",
        "body": "Task TypeRecommended TierModelsMonitoring, formatting, summarizationBudgetGLM, DeepSeek, HaikuCode generation, debugging, creativeStandardSonnet, Gemini ProArchitecture, complex analysisPremiumOpus, Sonnet+thinking"
      },
      {
        "title": "When to Check VFM",
        "body": "After spawning sub-agents → log cost and outcome\nDuring heartbeat → run suggest for optimization tips\nWeekly review → run report for cost breakdown"
      },
      {
        "title": "5. IKL (Infrastructure Knowledge Logging)",
        "body": "Rule: Log infrastructure facts immediately. When you discover hardware specs, service configs, or network topology, write it down BEFORE continuing."
      },
      {
        "title": "Triggers",
        "body": "Discovery TypeLog ToExampleHardware specsTOOLS.md\"GPU server has 3 GPUs: RTX 3090 + 3080 + 2070 SUPER\"Service configsTOOLS.md\"ComfyUI runs on port 8188, uses /data/ai-stack\"Network topologyTOOLS.md\"Pi at 192.168.99.25, GPU server at 10.0.0.44\"Credentials/authmemory/encrypted/\"SSH key: ~/.ssh/id_ed25519_alexchen\"API endpointsTOOLS.md or skill\"Moltbook API: POST /api/v1/posts\""
      },
      {
        "title": "Commands to Run on Discovery",
        "body": "# Hardware discovery\nnvidia-smi --query-gpu=index,name,memory.total --format=csv\nlscpu | grep -E \"Model name|CPU\\(s\\)|Thread\"\nfree -h\ndf -h\n\n# Service discovery  \nsystemctl list-units --type=service --state=running\ndocker ps  # or podman ps\nss -tlnp | grep LISTEN\n\n# Network discovery\nip addr show\ncat /etc/hosts"
      },
      {
        "title": "The IKL Protocol",
        "body": "SSH to new server → Run hardware/service discovery commands\nBefore responding → Update TOOLS.md with specs\nNew service discovered → Log port, path, config location\nCredentials obtained → Encrypt and store in memory/encrypted/"
      },
      {
        "title": "Anti-Pattern: \"I'll Remember\"",
        "body": "❌ \"The GPU server has 3 GPUs\" (only in conversation)\n✅ \"The GPU server has 3 GPUs\" → Update TOOLS.md → then continue\n\nMemory is limited. Files are permanent. IKL before you forget."
      }
    ],
    "body": "Agent Self-Governance\n\nFive protocols that prevent agent failure modes: losing context, false completion claims, persona drift, wasteful spending, and infrastructure amnesia.\n\n1. WAL (Write-Ahead Log)\n\nRule: Write before you respond. If something is worth remembering, WAL it first.\n\nTrigger\tAction Type\tExample\nUser corrects you\tcorrection\t\"No, use Podman not Docker\"\nKey decision\tdecision\t\"Using CogVideoX-2B for text-to-video\"\nImportant analysis\tanalysis\t\"WAL patterns should be core infra not skills\"\nState change\tstate_change\t\"GPU server SSH key auth configured\"\n# Write before responding\npython3 scripts/wal.py append <agent_id> correction \"Use Podman not Docker\"\n\n# Working buffer (batch, flush before compaction)\npython3 scripts/wal.py buffer-add <agent_id> decision \"Some decision\"\npython3 scripts/wal.py flush-buffer <agent_id>\n\n# Session start: replay lost context\npython3 scripts/wal.py replay <agent_id>\n\n# After incorporating a replayed entry\npython3 scripts/wal.py mark-applied <agent_id> <entry_id>\n\n# Maintenance\npython3 scripts/wal.py status <agent_id>\npython3 scripts/wal.py prune <agent_id> --keep 50\n\nIntegration Points\nSession start → replay to recover lost context\nUser correction → append BEFORE responding\nPre-compaction flush → flush-buffer then write daily memory\nDuring conversation → buffer-add for less critical items\n2. VBR (Verify Before Reporting)\n\nRule: Don't say \"done\" until verified. Run a check before claiming completion.\n\n# Verify a file exists\npython3 scripts/vbr.py check task123 file_exists /path/to/output.py\n\n# Verify a file was recently modified\npython3 scripts/vbr.py check task123 file_changed /path/to/file.go\n\n# Verify a command succeeds\npython3 scripts/vbr.py check task123 command \"cd /tmp/repo && go test ./...\"\n\n# Verify git is pushed\npython3 scripts/vbr.py check task123 git_pushed /tmp/repo\n\n# Log verification result\npython3 scripts/vbr.py log <agent_id> task123 true \"All tests pass\"\n\n# View pass/fail stats\npython3 scripts/vbr.py stats <agent_id>\n\nWhen to VBR\nAfter code changes → check command \"go test ./...\"\nAfter file creation → check file_exists /path\nAfter git push → check git_pushed /repo\nAfter sub-agent task → verify the claimed output exists\n3. ADL (Anti-Divergence Limit)\n\nRule: Stay true to your persona. Track behavioral drift from SOUL.md.\n\n# Analyze a response for anti-patterns\npython3 scripts/adl.py analyze \"Great question! I'd be happy to help you with that!\"\n\n# Log a behavioral observation\npython3 scripts/adl.py log <agent_id> anti_sycophancy \"Used 'Great question!' in response\"\npython3 scripts/adl.py log <agent_id> persona_direct \"Shipped fix without asking permission\"\n\n# Calculate divergence score (0=aligned, 1=fully drifted)\npython3 scripts/adl.py score <agent_id>\n\n# Check against threshold\npython3 scripts/adl.py check <agent_id> --threshold 0.7\n\n# Reset after recalibration\npython3 scripts/adl.py reset <agent_id>\n\nAnti-Patterns Tracked\nSycophancy — \"Great question!\", \"I'd be happy to help!\"\nPassivity — \"Would you like me to\", \"Shall I\", \"Let me know if\"\nHedging — \"I think maybe\", \"It might be possible\"\nVerbosity — Response length exceeding expected bounds\nPersona Signals (Positive)\nDirect — \"Done\", \"Fixed\", \"Ship\", \"Built\"\nOpinionated — \"I'd argue\", \"Better to\", \"The right call\"\nAction-oriented — \"Spawning\", \"On it\", \"Kicking off\"\n4. VFM (Value-For-Money)\n\nRule: Track cost vs value. Don't burn premium tokens on budget tasks.\n\n# Log a completed task with cost\npython3 scripts/vfm.py log <agent_id> monitoring glm-4.7 37000 0.03 0.8\n\n# Calculate VFM scores\npython3 scripts/vfm.py score <agent_id>\n\n# Cost breakdown by model and task\npython3 scripts/vfm.py report <agent_id>\n\n# Get optimization suggestions\npython3 scripts/vfm.py suggest <agent_id>\n\nTask → Tier Guidelines\nTask Type\tRecommended Tier\tModels\nMonitoring, formatting, summarization\tBudget\tGLM, DeepSeek, Haiku\nCode generation, debugging, creative\tStandard\tSonnet, Gemini Pro\nArchitecture, complex analysis\tPremium\tOpus, Sonnet+thinking\nWhen to Check VFM\nAfter spawning sub-agents → log cost and outcome\nDuring heartbeat → run suggest for optimization tips\nWeekly review → run report for cost breakdown\n5. IKL (Infrastructure Knowledge Logging)\n\nRule: Log infrastructure facts immediately. When you discover hardware specs, service configs, or network topology, write it down BEFORE continuing.\n\nTriggers\nDiscovery Type\tLog To\tExample\nHardware specs\tTOOLS.md\t\"GPU server has 3 GPUs: RTX 3090 + 3080 + 2070 SUPER\"\nService configs\tTOOLS.md\t\"ComfyUI runs on port 8188, uses /data/ai-stack\"\nNetwork topology\tTOOLS.md\t\"Pi at 192.168.99.25, GPU server at 10.0.0.44\"\nCredentials/auth\tmemory/encrypted/\t\"SSH key: ~/.ssh/id_ed25519_alexchen\"\nAPI endpoints\tTOOLS.md or skill\t\"Moltbook API: POST /api/v1/posts\"\nCommands to Run on Discovery\n# Hardware discovery\nnvidia-smi --query-gpu=index,name,memory.total --format=csv\nlscpu | grep -E \"Model name|CPU\\(s\\)|Thread\"\nfree -h\ndf -h\n\n# Service discovery  \nsystemctl list-units --type=service --state=running\ndocker ps  # or podman ps\nss -tlnp | grep LISTEN\n\n# Network discovery\nip addr show\ncat /etc/hosts\n\nThe IKL Protocol\nSSH to new server → Run hardware/service discovery commands\nBefore responding → Update TOOLS.md with specs\nNew service discovered → Log port, path, config location\nCredentials obtained → Encrypt and store in memory/encrypted/\nAnti-Pattern: \"I'll Remember\"\n\n❌ \"The GPU server has 3 GPUs\" (only in conversation) ✅ \"The GPU server has 3 GPUs\" → Update TOOLS.md → then continue\n\nMemory is limited. Files are permanent. IKL before you forget."
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/bowen31337/agent-self-governance",
    "publisherUrl": "https://clawhub.ai/bowen31337/agent-self-governance",
    "owner": "bowen31337",
    "version": "1.1.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/agent-self-governance",
    "downloadUrl": "https://openagent3.xyz/downloads/agent-self-governance",
    "agentUrl": "https://openagent3.xyz/skills/agent-self-governance/agent",
    "manifestUrl": "https://openagent3.xyz/skills/agent-self-governance/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/agent-self-governance/agent.md"
  }
}