โ† All skills
Tencent SkillHub ยท Productivity

Documentation-Accurate Code Generation

Generate code that references actual documentation, preventing hallucination bugs. ALWAYS loads docs first, validates against API signatures, and verifies co...

skill openclawclawhub Free
0 Downloads
0 Stars
0 Installs
0 Score
High Signal

Generate code that references actual documentation, preventing hallucination bugs. ALWAYS loads docs first, validates against API signatures, and verifies co...

โฌ‡ 0 downloads โ˜… 0 stars Unverified but indexed

Install for OpenClaw

Quick setup
  1. Download the package from Yavira.
  2. Extract the archive and review SKILL.md first.
  3. Import or place the package into your OpenClaw setup.

Requirements

Target platform
OpenClaw
Install method
Manual import
Extraction
Extract archive
Prerequisites
OpenClaw
Primary doc
SKILL.md

Package facts

Download mode
Yavira redirect
Package format
ZIP package
Source platform
Tencent SkillHub
What's included
SKILL.md

Validation

  • Use the Yavira download entry.
  • Review SKILL.md after the package is downloaded.
  • Confirm the extracted package contains the expected setup assets.

Install with your agent

Agent handoff

Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.

  1. Download the package from Yavira.
  2. Extract it into a folder your agent can access.
  3. Paste one of the prompts below and point your agent at the extracted folder.
New install

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.

Upgrade existing

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.

Trust & source

Release facts

Source
Tencent SkillHub
Verification
Indexed source record
Version
1.0.0

Documentation

ClawHub primary doc Primary doc: SKILL.md 36 sections Open source page

Documentation-Accurate Code Generation

CRITICAL: This skill prevents LLM hallucination by enforcing documentation reference.

When to Use

ALWAYS when generating code ALWAYS when using APIs ALWAYS when creating configurations ALWAYS when implementing features

Core Philosophy

NEVER generate code from memory. ALWAYS reference documentation.

The Problem

LLMs hallucinate APIs that don't exist Methods get renamed or removed Parameters change or get deprecated Return types shift unexpectedly Configuration formats evolve

The Solution

Load documentation FIRST โ€” Before writing any code Extract API signatures โ€” Get actual method signatures Generate from docs โ€” Use real API data Validate against docs โ€” Check generated code matches Reference tracking โ€” Document which docs were used

Workflow

1. IDENTIFY โ†’ What code/API/tool is needed? 2. LOCATE โ†’ Find documentation source 3. LOAD โ†’ Fetch and parse documentation 4. EXTRACT โ†’ Pull API signatures, parameters, examples 5. GENERATE โ†’ Create code using actual docs 6. VALIDATE โ†’ Check code matches documentation 7. REFERENCE โ†’ Track what docs were used

1. OpenClaw Internal Docs

Location: C:\Users\clipp\AppData\Roaming\npm\node_modules\openclaw\docs Access: read tool Use: For OpenClaw-specific APIs, tools, skills

2. Tool Documentation

Tool help: --help flags Man pages: man <command> Official docs: Use web_fetch to get docs

3. API Documentation

Official docs: Use web_fetch OpenAPI specs: Parse and reference Package docs: npm, pip, cargo docs

4. Code Examples

Existing code: Read similar implementations Tests: Check test files for usage patterns Examples: Find working code samples

Step 1: Documentation Discovery

# For OpenClaw tools read("openclaw-docs-path/tool-name.md") # For external tools web_fetch("https://docs.tool.com/api") # For local tools exec("tool --help")

Step 2: API Signature Extraction

  • # Extract:
  • Method names
  • Parameters (names, types, required/optional)
  • Return types
  • Error handling
  • Examples
  • Version information

Step 3: Code Generation

# Generate code using actual API data def generate_from_docs(api_docs): # Use real method names # Use real parameter names # Use real return types # Include error handling from docs # Add docstrings from docs pass

Step 4: Validation

def validate_against_docs(code, api_docs): # Check method names match # Check parameter names match # Check types match # Check return types match # Verify no hallucinated methods pass

Quick Actions

codegen <api> โ€” Generate code with doc reference validate <code> โ€” Check code against docs doc-lookup <api> โ€” Load and display documentation api-extract <tool> โ€” Extract API signatures

Usage Examples

"Generate code to use the OpenClaw sessions_spawn tool" # Process: Load docs โ†’ Extract API โ†’ Generate โ†’ Validate "Create a Python script using the requests library" # Process: Fetch requests docs โ†’ Extract API โ†’ Generate โ†’ Validate "Write configuration for OpenClaw channels" # Process: Load config docs โ†’ Extract format โ†’ Generate โ†’ Validate

1. Method Name Validation

Check method exists in docs Verify spelling matches exactly Confirm method is not deprecated

2. Parameter Validation

All required parameters present Parameter names match docs exactly Parameter types match docs Optional parameters marked correctly

3. Return Type Validation

Return type matches docs Error types match docs Edge cases handled

4. Configuration Validation

Keys match documentation Value types match schema Required fields present Format matches specification

Common Hallucination Patterns

Non-existent methods โ€” Methods that don't exist Wrong parameter names โ€” Hallucinated parameter names Wrong types โ€” Incorrect parameter/return types Missing error handling โ€” Ignoring documented errors Wrong configuration format โ€” Incorrect config structure

Prevention Strategies

Always load docs first โ€” Never generate from memory Extract actual signatures โ€” Don't guess API shape Validate everything โ€” Check against real docs Reference tracking โ€” Know which docs were used Test with real APIs โ€” Verify code actually works

With Other Skills

Coding skill: Use this for doc-accurate code Self-evolution: Update skills with doc validation Content generation: Generate accurate code examples Research: Research APIs from actual docs

With OpenClaw Tools

read: Load internal documentation web_fetch: Fetch external documentation exec: Run tools with --help for docs edit/write: Create validated code

Format

  • # Code Generation Reference
  • ## Generated Code
  • File: path/to/file.py
  • Generated: 2026-02-23
  • Tool: doc-accurate-codegen
  • ## Documentation Sources
  • 1. OpenClaw Tool Docs: /docs/tools/exec.md
  • 2. API Reference: https://docs.example.com/api
  • 3. Examples: /examples/exec-usage.py
  • ## Validation
  • โœ… Method names validated
  • โœ… Parameters validated
  • โœ… Return types validated
  • โœ… Error handling validated
  • ## Notes
  • Using exec tool with sandbox mode
  • All parameters from official docs
  • Error handling from API reference

Output Template

When generating code, always include: # Code generated with documentation reference # Source: [documentation URL or path] # Validated: [timestamp] # API Version: [version if available] def function_name(): """ [Docstring from actual documentation] Source: [link to docs] Parameters: [from docs] Returns: [from docs] """ # Implementation using actual API pass

Best Practices

Docs First, Always โ€” Never generate without loading docs Exact Matches โ€” Use exact names, types, formats from docs Validate Everything โ€” Check all generated code Track References โ€” Document which docs were used Test Real APIs โ€” Actually run the code to verify Update Regularly โ€” Re-check docs as APIs evolve Error Handling โ€” Include all documented errors Examples โ€” Reference working examples from docs

Common Pitfalls

Assuming API stability โ€” APIs change, always re-check docs Memory over docs โ€” Trust docs, not memory Partial loading โ€” Load complete documentation No validation โ€” Always validate generated code Missing references โ€” Always track doc sources

Success Metrics

Hallucination rate: 0% (all code references actual docs) Validation rate: 100% (all code validated) Reference tracking: 100% (all code has doc sources) Error rate: 0% (no API misuse) Test pass rate: 100% (all generated code works)

1. Automatic Doc Loading

Detect what APIs are needed Automatically fetch relevant docs Cache for future use

2. API Change Detection

Monitor docs for changes Alert when APIs change Suggest code updates

3. Multi-Source Validation

Cross-reference multiple doc sources Detect conflicts between sources Use most authoritative source

4. Example Extraction

Extract working examples from docs Adapt examples to specific needs Test examples before using

Tool Documentation

# Get tool help exec("tool --help") # Read tool docs read("openclaw/docs/tools/tool-name.md") # Check tool examples read("openclaw/examples/tool-usage.md")

Skill Documentation

# Read skill docs read("skills/skill-name/SKILL.md") # Check skill examples read("skills/skill-name/examples/")

Configuration Documentation

# Read config docs read("openclaw/docs/configuration.md") # Check config examples read("openclaw/examples/config/") Remember: This skill exists because LLMs hallucinate. ALWAYS use it for code generation. The only way to prevent bugs is to reference actual documentation.

Category context

Workflow acceleration for inboxes, docs, calendars, planning, and execution loops.

Source: Tencent SkillHub

Largest current source with strong distribution and engagement signals.

Package contents

Included in package
1 Docs
  • SKILL.md Primary doc