{
  "schemaVersion": "1.0",
  "item": {
    "slug": "doc-accurate-codegen",
    "name": "Documentation-Accurate Code Generation",
    "source": "tencent",
    "type": "skill",
    "category": "效率提升",
    "sourceUrl": "https://clawhub.ai/tobisamaa/doc-accurate-codegen",
    "canonicalUrl": "https://clawhub.ai/tobisamaa/doc-accurate-codegen",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/doc-accurate-codegen",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=doc-accurate-codegen",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md"
    ],
    "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-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.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/doc-accurate-codegen"
    },
    "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/doc-accurate-codegen",
    "agentPageUrl": "https://openagent3.xyz/skills/doc-accurate-codegen/agent",
    "manifestUrl": "https://openagent3.xyz/skills/doc-accurate-codegen/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/doc-accurate-codegen/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": "Documentation-Accurate Code Generation",
        "body": "CRITICAL: This skill prevents LLM hallucination by enforcing documentation reference."
      },
      {
        "title": "When to Use",
        "body": "ALWAYS when generating code\nALWAYS when using APIs\nALWAYS when creating configurations\nALWAYS when implementing features"
      },
      {
        "title": "Core Philosophy",
        "body": "NEVER generate code from memory. ALWAYS reference documentation."
      },
      {
        "title": "The Problem",
        "body": "LLMs hallucinate APIs that don't exist\nMethods get renamed or removed\nParameters change or get deprecated\nReturn types shift unexpectedly\nConfiguration formats evolve"
      },
      {
        "title": "The Solution",
        "body": "Load documentation FIRST — Before writing any code\nExtract API signatures — Get actual method signatures\nGenerate from docs — Use real API data\nValidate against docs — Check generated code matches\nReference tracking — Document which docs were used"
      },
      {
        "title": "Workflow",
        "body": "1. IDENTIFY → What code/API/tool is needed?\n2. LOCATE → Find documentation source\n3. LOAD → Fetch and parse documentation\n4. EXTRACT → Pull API signatures, parameters, examples\n5. GENERATE → Create code using actual docs\n6. VALIDATE → Check code matches documentation\n7. REFERENCE → Track what docs were used"
      },
      {
        "title": "1. OpenClaw Internal Docs",
        "body": "Location: C:\\Users\\clipp\\AppData\\Roaming\\npm\\node_modules\\openclaw\\docs\nAccess: read tool\nUse: For OpenClaw-specific APIs, tools, skills"
      },
      {
        "title": "2. Tool Documentation",
        "body": "Tool help: --help flags\nMan pages: man <command>\nOfficial docs: Use web_fetch to get docs"
      },
      {
        "title": "3. API Documentation",
        "body": "Official docs: Use web_fetch\nOpenAPI specs: Parse and reference\nPackage docs: npm, pip, cargo docs"
      },
      {
        "title": "4. Code Examples",
        "body": "Existing code: Read similar implementations\nTests: Check test files for usage patterns\nExamples: Find working code samples"
      },
      {
        "title": "Step 1: Documentation Discovery",
        "body": "# For OpenClaw tools\nread(\"openclaw-docs-path/tool-name.md\")\n\n# For external tools\nweb_fetch(\"https://docs.tool.com/api\")\n\n# For local tools\nexec(\"tool --help\")"
      },
      {
        "title": "Step 2: API Signature Extraction",
        "body": "# Extract:\n- Method names\n- Parameters (names, types, required/optional)\n- Return types\n- Error handling\n- Examples\n- Version information"
      },
      {
        "title": "Step 3: Code Generation",
        "body": "# Generate code using actual API data\ndef generate_from_docs(api_docs):\n    # Use real method names\n    # Use real parameter names\n    # Use real return types\n    # Include error handling from docs\n    # Add docstrings from docs\n    pass"
      },
      {
        "title": "Step 4: Validation",
        "body": "def validate_against_docs(code, api_docs):\n    # Check method names match\n    # Check parameter names match\n    # Check types match\n    # Check return types match\n    # Verify no hallucinated methods\n    pass"
      },
      {
        "title": "Quick Actions",
        "body": "codegen <api> — Generate code with doc reference\nvalidate <code> — Check code against docs\ndoc-lookup <api> — Load and display documentation\napi-extract <tool> — Extract API signatures"
      },
      {
        "title": "Usage Examples",
        "body": "\"Generate code to use the OpenClaw sessions_spawn tool\"\n# Process: Load docs → Extract API → Generate → Validate\n\n\"Create a Python script using the requests library\"\n# Process: Fetch requests docs → Extract API → Generate → Validate\n\n\"Write configuration for OpenClaw channels\"\n# Process: Load config docs → Extract format → Generate → Validate"
      },
      {
        "title": "1. Method Name Validation",
        "body": "Check method exists in docs\nVerify spelling matches exactly\nConfirm method is not deprecated"
      },
      {
        "title": "2. Parameter Validation",
        "body": "All required parameters present\nParameter names match docs exactly\nParameter types match docs\nOptional parameters marked correctly"
      },
      {
        "title": "3. Return Type Validation",
        "body": "Return type matches docs\nError types match docs\nEdge cases handled"
      },
      {
        "title": "4. Configuration Validation",
        "body": "Keys match documentation\nValue types match schema\nRequired fields present\nFormat matches specification"
      },
      {
        "title": "Common Hallucination Patterns",
        "body": "Non-existent methods — Methods that don't exist\nWrong parameter names — Hallucinated parameter names\nWrong types — Incorrect parameter/return types\nMissing error handling — Ignoring documented errors\nWrong configuration format — Incorrect config structure"
      },
      {
        "title": "Prevention Strategies",
        "body": "Always load docs first — Never generate from memory\nExtract actual signatures — Don't guess API shape\nValidate everything — Check against real docs\nReference tracking — Know which docs were used\nTest with real APIs — Verify code actually works"
      },
      {
        "title": "With Other Skills",
        "body": "Coding skill: Use this for doc-accurate code\nSelf-evolution: Update skills with doc validation\nContent generation: Generate accurate code examples\nResearch: Research APIs from actual docs"
      },
      {
        "title": "With OpenClaw Tools",
        "body": "read: Load internal documentation\nweb_fetch: Fetch external documentation\nexec: Run tools with --help for docs\nedit/write: Create validated code"
      },
      {
        "title": "Format",
        "body": "# Code Generation Reference\n\n## Generated Code\n- File: path/to/file.py\n- Generated: 2026-02-23\n- Tool: doc-accurate-codegen\n\n## Documentation Sources\n1. OpenClaw Tool Docs: /docs/tools/exec.md\n2. API Reference: https://docs.example.com/api\n3. Examples: /examples/exec-usage.py\n\n## Validation\n- ✅ Method names validated\n- ✅ Parameters validated\n- ✅ Return types validated\n- ✅ Error handling validated\n\n## Notes\n- Using exec tool with sandbox mode\n- All parameters from official docs\n- Error handling from API reference"
      },
      {
        "title": "Output Template",
        "body": "When generating code, always include:\n\n# Code generated with documentation reference\n# Source: [documentation URL or path]\n# Validated: [timestamp]\n# API Version: [version if available]\n\ndef function_name():\n    \"\"\"\n    [Docstring from actual documentation]\n    \n    Source: [link to docs]\n    Parameters: [from docs]\n    Returns: [from docs]\n    \"\"\"\n    # Implementation using actual API\n    pass"
      },
      {
        "title": "Best Practices",
        "body": "Docs First, Always — Never generate without loading docs\nExact Matches — Use exact names, types, formats from docs\nValidate Everything — Check all generated code\nTrack References — Document which docs were used\nTest Real APIs — Actually run the code to verify\nUpdate Regularly — Re-check docs as APIs evolve\nError Handling — Include all documented errors\nExamples — Reference working examples from docs"
      },
      {
        "title": "Common Pitfalls",
        "body": "Assuming API stability — APIs change, always re-check docs\nMemory over docs — Trust docs, not memory\nPartial loading — Load complete documentation\nNo validation — Always validate generated code\nMissing references — Always track doc sources"
      },
      {
        "title": "Success Metrics",
        "body": "Hallucination rate: 0% (all code references actual docs)\nValidation rate: 100% (all code validated)\nReference tracking: 100% (all code has doc sources)\nError rate: 0% (no API misuse)\nTest pass rate: 100% (all generated code works)"
      },
      {
        "title": "1. Automatic Doc Loading",
        "body": "Detect what APIs are needed\nAutomatically fetch relevant docs\nCache for future use"
      },
      {
        "title": "2. API Change Detection",
        "body": "Monitor docs for changes\nAlert when APIs change\nSuggest code updates"
      },
      {
        "title": "3. Multi-Source Validation",
        "body": "Cross-reference multiple doc sources\nDetect conflicts between sources\nUse most authoritative source"
      },
      {
        "title": "4. Example Extraction",
        "body": "Extract working examples from docs\nAdapt examples to specific needs\nTest examples before using"
      },
      {
        "title": "Tool Documentation",
        "body": "# Get tool help\nexec(\"tool --help\")\n\n# Read tool docs\nread(\"openclaw/docs/tools/tool-name.md\")\n\n# Check tool examples\nread(\"openclaw/examples/tool-usage.md\")"
      },
      {
        "title": "Skill Documentation",
        "body": "# Read skill docs\nread(\"skills/skill-name/SKILL.md\")\n\n# Check skill examples\nread(\"skills/skill-name/examples/\")"
      },
      {
        "title": "Configuration Documentation",
        "body": "# Read config docs\nread(\"openclaw/docs/configuration.md\")\n\n# Check config examples\nread(\"openclaw/examples/config/\")\n\nRemember: This skill exists because LLMs hallucinate. ALWAYS use it for code generation. The only way to prevent bugs is to reference actual documentation."
      }
    ],
    "body": "Documentation-Accurate Code Generation\n\nCRITICAL: This skill prevents LLM hallucination by enforcing documentation reference.\n\nWhen to Use\nALWAYS when generating code\nALWAYS when using APIs\nALWAYS when creating configurations\nALWAYS when implementing features\nCore Philosophy\n\nNEVER generate code from memory. ALWAYS reference documentation.\n\nThe Problem\nLLMs hallucinate APIs that don't exist\nMethods get renamed or removed\nParameters change or get deprecated\nReturn types shift unexpectedly\nConfiguration formats evolve\nThe Solution\nLoad documentation FIRST — Before writing any code\nExtract API signatures — Get actual method signatures\nGenerate from docs — Use real API data\nValidate against docs — Check generated code matches\nReference tracking — Document which docs were used\nWorkflow\n1. IDENTIFY → What code/API/tool is needed?\n2. LOCATE → Find documentation source\n3. LOAD → Fetch and parse documentation\n4. EXTRACT → Pull API signatures, parameters, examples\n5. GENERATE → Create code using actual docs\n6. VALIDATE → Check code matches documentation\n7. REFERENCE → Track what docs were used\n\nDocumentation Sources\n1. OpenClaw Internal Docs\nLocation: C:\\Users\\clipp\\AppData\\Roaming\\npm\\node_modules\\openclaw\\docs\nAccess: read tool\nUse: For OpenClaw-specific APIs, tools, skills\n2. Tool Documentation\nTool help: --help flags\nMan pages: man <command>\nOfficial docs: Use web_fetch to get docs\n3. API Documentation\nOfficial docs: Use web_fetch\nOpenAPI specs: Parse and reference\nPackage docs: npm, pip, cargo docs\n4. Code Examples\nExisting code: Read similar implementations\nTests: Check test files for usage patterns\nExamples: Find working code samples\nProcess for Code Generation\nStep 1: Documentation Discovery\n# For OpenClaw tools\nread(\"openclaw-docs-path/tool-name.md\")\n\n# For external tools\nweb_fetch(\"https://docs.tool.com/api\")\n\n# For local tools\nexec(\"tool --help\")\n\nStep 2: API Signature Extraction\n# Extract:\n- Method names\n- Parameters (names, types, required/optional)\n- Return types\n- Error handling\n- Examples\n- Version information\n\nStep 3: Code Generation\n# Generate code using actual API data\ndef generate_from_docs(api_docs):\n    # Use real method names\n    # Use real parameter names\n    # Use real return types\n    # Include error handling from docs\n    # Add docstrings from docs\n    pass\n\nStep 4: Validation\ndef validate_against_docs(code, api_docs):\n    # Check method names match\n    # Check parameter names match\n    # Check types match\n    # Check return types match\n    # Verify no hallucinated methods\n    pass\n\nQuick Actions\ncodegen <api> — Generate code with doc reference\nvalidate <code> — Check code against docs\ndoc-lookup <api> — Load and display documentation\napi-extract <tool> — Extract API signatures\nUsage Examples\n\"Generate code to use the OpenClaw sessions_spawn tool\"\n# Process: Load docs → Extract API → Generate → Validate\n\n\"Create a Python script using the requests library\"\n# Process: Fetch requests docs → Extract API → Generate → Validate\n\n\"Write configuration for OpenClaw channels\"\n# Process: Load config docs → Extract format → Generate → Validate\n\nValidation Rules\n1. Method Name Validation\nCheck method exists in docs\nVerify spelling matches exactly\nConfirm method is not deprecated\n2. Parameter Validation\nAll required parameters present\nParameter names match docs exactly\nParameter types match docs\nOptional parameters marked correctly\n3. Return Type Validation\nReturn type matches docs\nError types match docs\nEdge cases handled\n4. Configuration Validation\nKeys match documentation\nValue types match schema\nRequired fields present\nFormat matches specification\nError Prevention\nCommon Hallucination Patterns\nNon-existent methods — Methods that don't exist\nWrong parameter names — Hallucinated parameter names\nWrong types — Incorrect parameter/return types\nMissing error handling — Ignoring documented errors\nWrong configuration format — Incorrect config structure\nPrevention Strategies\nAlways load docs first — Never generate from memory\nExtract actual signatures — Don't guess API shape\nValidate everything — Check against real docs\nReference tracking — Know which docs were used\nTest with real APIs — Verify code actually works\nIntegration Points\nWith Other Skills\nCoding skill: Use this for doc-accurate code\nSelf-evolution: Update skills with doc validation\nContent generation: Generate accurate code examples\nResearch: Research APIs from actual docs\nWith OpenClaw Tools\nread: Load internal documentation\nweb_fetch: Fetch external documentation\nexec: Run tools with --help for docs\nedit/write: Create validated code\nReference Tracking\nFormat\n# Code Generation Reference\n\n## Generated Code\n- File: path/to/file.py\n- Generated: 2026-02-23\n- Tool: doc-accurate-codegen\n\n## Documentation Sources\n1. OpenClaw Tool Docs: /docs/tools/exec.md\n2. API Reference: https://docs.example.com/api\n3. Examples: /examples/exec-usage.py\n\n## Validation\n- ✅ Method names validated\n- ✅ Parameters validated\n- ✅ Return types validated\n- ✅ Error handling validated\n\n## Notes\n- Using exec tool with sandbox mode\n- All parameters from official docs\n- Error handling from API reference\n\nOutput Template\n\nWhen generating code, always include:\n\n# Code generated with documentation reference\n# Source: [documentation URL or path]\n# Validated: [timestamp]\n# API Version: [version if available]\n\ndef function_name():\n    \"\"\"\n    [Docstring from actual documentation]\n    \n    Source: [link to docs]\n    Parameters: [from docs]\n    Returns: [from docs]\n    \"\"\"\n    # Implementation using actual API\n    pass\n\nBest Practices\nDocs First, Always — Never generate without loading docs\nExact Matches — Use exact names, types, formats from docs\nValidate Everything — Check all generated code\nTrack References — Document which docs were used\nTest Real APIs — Actually run the code to verify\nUpdate Regularly — Re-check docs as APIs evolve\nError Handling — Include all documented errors\nExamples — Reference working examples from docs\nCommon Pitfalls\nAssuming API stability — APIs change, always re-check docs\nMemory over docs — Trust docs, not memory\nPartial loading — Load complete documentation\nNo validation — Always validate generated code\nMissing references — Always track doc sources\nSuccess Metrics\nHallucination rate: 0% (all code references actual docs)\nValidation rate: 100% (all code validated)\nReference tracking: 100% (all code has doc sources)\nError rate: 0% (no API misuse)\nTest pass rate: 100% (all generated code works)\nAdvanced Features\n1. Automatic Doc Loading\nDetect what APIs are needed\nAutomatically fetch relevant docs\nCache for future use\n2. API Change Detection\nMonitor docs for changes\nAlert when APIs change\nSuggest code updates\n3. Multi-Source Validation\nCross-reference multiple doc sources\nDetect conflicts between sources\nUse most authoritative source\n4. Example Extraction\nExtract working examples from docs\nAdapt examples to specific needs\nTest examples before using\nIntegration with OpenClaw\nTool Documentation\n# Get tool help\nexec(\"tool --help\")\n\n# Read tool docs\nread(\"openclaw/docs/tools/tool-name.md\")\n\n# Check tool examples\nread(\"openclaw/examples/tool-usage.md\")\n\nSkill Documentation\n# Read skill docs\nread(\"skills/skill-name/SKILL.md\")\n\n# Check skill examples\nread(\"skills/skill-name/examples/\")\n\nConfiguration Documentation\n# Read config docs\nread(\"openclaw/docs/configuration.md\")\n\n# Check config examples\nread(\"openclaw/examples/config/\")\n\n\nRemember: This skill exists because LLMs hallucinate. ALWAYS use it for code generation. The only way to prevent bugs is to reference actual documentation."
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/tobisamaa/doc-accurate-codegen",
    "publisherUrl": "https://clawhub.ai/tobisamaa/doc-accurate-codegen",
    "owner": "tobisamaa",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/doc-accurate-codegen",
    "downloadUrl": "https://openagent3.xyz/downloads/doc-accurate-codegen",
    "agentUrl": "https://openagent3.xyz/skills/doc-accurate-codegen/agent",
    "manifestUrl": "https://openagent3.xyz/skills/doc-accurate-codegen/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/doc-accurate-codegen/agent.md"
  }
}