{
  "schemaVersion": "1.0",
  "item": {
    "slug": "context-builder",
    "name": "Context Builder",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/igorls/context-builder",
    "canonicalUrl": "https://clawhub.ai/igorls/context-builder",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/context-builder",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=context-builder",
    "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",
      "slug": "context-builder",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-02T03:18:31.222Z",
      "expiresAt": "2026-05-09T03:18:31.222Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=context-builder",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=context-builder",
        "contentDisposition": "attachment; filename=\"context-builder-0.8.3-1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "context-builder"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/context-builder"
    },
    "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/context-builder",
    "agentPageUrl": "https://openagent3.xyz/skills/context-builder/agent",
    "manifestUrl": "https://openagent3.xyz/skills/context-builder/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/context-builder/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": "Context Builder — Agentic Skill",
        "body": "Generate a single, structured markdown file from any codebase directory. The output is optimized for LLM consumption with relevance-based file ordering, AST-aware code signatures, automatic token budgeting, and smart defaults."
      },
      {
        "title": "Installation",
        "body": "# Requires Rust toolchain. Builds from source with cryptographic verification via crates.io.\ncargo install context-builder --features tree-sitter-all\n\nPre-built binaries with SHA256 checksums are also available for manual download from GitHub Releases.\n\nVerify: context-builder --version (expected: 0.8.3)"
      },
      {
        "title": "Security & Path Scoping",
        "body": "IMPORTANT: This tool reads file contents from the specified directory. Agents MUST follow these rules:\n\nOnly target explicit project directories — always pass the exact project root (e.g., /home/user/projects/myapp). Never point at home directories, system paths, or credential stores (~/.ssh, ~/.aws, /etc, ~, /)\nUse scoped filters — use -f to limit to known source extensions (e.g., -f rs,toml,md), reducing exposure surface\nOutput to project-local paths — write output to the project's docs/ folder or /tmp/, never to shared or public locations\nReview before sharing — the output may contain API keys, secrets, or credentials embedded in source files; always review or use .gitignore patterns to exclude sensitive files\n\nBuilt-in protections (always active, no configuration needed):\n\nExcludes .git/, node_modules/, and 19 other heavy/sensitive directories at any depth\nRespects .gitignore rules when a .git directory is present\nBinary files are auto-detected and skipped via UTF-8 sniffing\nOutput file and cache directory are auto-excluded to prevent self-ingestion"
      },
      {
        "title": "When to Use",
        "body": "Deep code review — Feed an entire codebase to an LLM for architecture analysis or bug hunting\nOnboarding — Generate a project snapshot for understanding unfamiliar codebases\nDiff-based updates — After code changes, generate only the diffs to update an LLM's understanding\nAST signatures — Extract function/class signatures for token-efficient structural understanding\nCross-project research — Quickly package a dependency's source for analysis"
      },
      {
        "title": "1. Quick Context (whole project)",
        "body": "context-builder -d /path/to/project -y -o context.md\n\n-y skips confirmation prompts (recommended for agent workflows when path is explicitly scoped)\nOutput includes: header → file tree → files sorted by relevance (config → source → tests → docs)"
      },
      {
        "title": "2. Scoped Context (specific file types)",
        "body": "context-builder -d /path/to/project -f rs,toml -i docs,assets -y -o context.md\n\n-f rs,toml includes only Rust and TOML files\n-i docs,assets excludes directories by name"
      },
      {
        "title": "3. AST Signatures Mode (minimal tokens)",
        "body": "context-builder -d /path/to/project --signatures -f rs,ts,py -y -o signatures.md\n\nReplaces full file content with extracted function/class signatures (~4K vs ~15K tokens per file)\nSupports 8 languages: Rust, JavaScript (.js/.jsx), TypeScript (.ts/.tsx), Python, Go, Java, C, C++\nRequires --features tree-sitter-all at install time"
      },
      {
        "title": "4. Signatures with Structural Summary",
        "body": "context-builder -d /path/to/project --signatures --structure -y -o context.md\n\n--structure appends a count summary (e.g., \"6 functions, 2 structs, 1 impl block\")\nCombine with --visibility public to show only public API surface"
      },
      {
        "title": "5. Budget-Constrained Context",
        "body": "context-builder -d /path/to/project --max-tokens 100000 -y -o context.md\n\nCaps output to ~100K tokens (estimated)\nFiles are included in relevance order until budget is exhausted\nAutomatically warns if output exceeds 128K tokens"
      },
      {
        "title": "6. Token Count Preview",
        "body": "context-builder -d /path/to/project --token-count\n\nPrints estimated token count without generating output\nUse this first to decide if filtering or --signatures is needed"
      },
      {
        "title": "7. Incremental Diffs",
        "body": "First, ensure context-builder.toml exists with:\n\ntimestamped_output = true\nauto_diff = true\n\nThen run twice:\n\n# First run: baseline snapshot\ncontext-builder -d /path/to/project -y\n\n# After code changes: generates diff annotations\ncontext-builder -d /path/to/project -y\n\nFor minimal output (diffs only, no full file bodies):\n\ncontext-builder -d /path/to/project -y --diff-only"
      },
      {
        "title": "Smart Defaults",
        "body": "These behaviors require no configuration:\n\nFeatureBehaviorAuto-ignorenode_modules, dist, build, __pycache__, .venv, vendor, and 12 more heavy dirs are excluded at any depthSelf-exclusionOutput file, cache dir, and context-builder.toml are auto-excluded.gitignoreRespected automatically when .git directory existsBinary detectionBinary files are skipped via UTF-8 sniffingFile orderingConfig/docs first → source (entry points before helpers) → tests → build/CI → lockfiles"
      },
      {
        "title": "CLI Reference (Agent-Relevant Flags)",
        "body": "FlagPurposeAgent Guidance-d <PATH>Input directoryAlways use absolute paths for reliability-o <FILE>Output pathWrite to project docs/ or /tmp/-f <EXT>Filter by extensionComma-separated: -f rs,toml,md-i <NAME>Ignore dirs/filesComma-separated: -i tests,docs,assets--max-tokens <N>Token budget capUse 100000 for most models, 200000 for Gemini--token-countDry-run token estimateRun first to check if filtering is needed-ySkip all promptsUse only with explicit, scoped project paths--previewShow file tree onlyQuick exploration without generating output--diff-onlyOutput only diffsMinimizes tokens for incremental updates--signaturesAST signature extractionRequires tree-sitter-all feature at install--structureStructural summaryPair with --signatures for compact output--visibility <V>Filter by visibilityall (default), public (public API only)--truncate <MODE>Truncation strategysmart (AST-aware) or simple--initCreate config fileAuto-detects project file types--clear-cacheReset diff cacheUse if diff output seems stale"
      },
      {
        "title": "Recipe: Deep Think Code Review",
        "body": "Generate a scoped context file, then prompt an LLM for deep analysis:\n\n# Step 1: Generate focused context\ncontext-builder -d /path/to/project -f rs,toml --max-tokens 120000 -y -o docs/deep_think_context.md\n\n# Step 2: Feed to LLM with a review prompt\n# Attach docs/deep_think_context.md and ask for:\n# - Architecture review\n# - Bug hunting\n# - Performance analysis"
      },
      {
        "title": "Recipe: API Surface Review (signatures only)",
        "body": "# Extract only public signatures — typically 80-90% fewer tokens than full source\ncontext-builder -d /path/to/project --signatures --visibility public -f rs -y -o docs/api_surface.md"
      },
      {
        "title": "Recipe: Compare Two Versions",
        "body": "# Generate context for both versions\ncontext-builder -d ./v1 -f py -y -o /tmp/v1_context.md\ncontext-builder -d ./v2 -f py -y -o /tmp/v2_context.md\n\n# Feed both to an LLM for comparative analysis"
      },
      {
        "title": "Recipe: Monorepo Slice",
        "body": "# Focus on a specific package within a monorepo\ncontext-builder -d /path/to/monorepo/packages/core -f ts,tsx -i __tests__,__mocks__ -y -o core_context.md"
      },
      {
        "title": "Recipe: Quick Size Check Before Deciding Strategy",
        "body": "# Check if the project fits in context\ncontext-builder -d /path/to/project --token-count\n\n# If > 128K tokens, try signatures mode first:\ncontext-builder -d /path/to/project --signatures --token-count\n\n# Or scope it down:\ncontext-builder -d /path/to/project -f rs,toml --max-tokens 100000 --token-count"
      },
      {
        "title": "Configuration File (Optional)",
        "body": "Create context-builder.toml in the project root for persistent settings:\n\noutput = \"docs/context.md\"\noutput_folder = \"docs\"\nfilter = [\"rs\", \"toml\"]\nignore = [\"target\", \"benches\"]\ntimestamped_output = true\nauto_diff = true\nmax_tokens = 120000\nsignatures = true\nstructure = true\nvisibility = \"public\"\n\nInitialize one automatically with context-builder --init."
      },
      {
        "title": "Output Format",
        "body": "The generated markdown follows this structure:\n\n# Directory Structure Report\n[metadata: project name, filters, content hash]\n\n## File Tree\n[visual tree of included files]\n\n## Files\n### File: src/main.rs\n[code block with file contents, syntax-highlighted by extension]\n\n### File: src/lib.rs\n...\n\nFiles appear in relevance order (not alphabetical), prioritizing config and entry points so LLMs build understanding faster.\n\nWhen --signatures is active, file contents are replaced with extracted signatures:\n\n### File: src/lib.rs\n```rust\npub fn run_with_args(args: Args, config: Config, prompter: &dyn Prompter) -> Result<()>\npub fn generate_markdown_with_diff(...) -> Result<String>\n```"
      },
      {
        "title": "Error Handling",
        "body": "If context-builder is not installed, install with cargo install context-builder --features tree-sitter-all\nIf --signatures shows no output for a file, the language may not be supported or the feature was not enabled at install\nIf output exceeds token limits, add --max-tokens or narrow with -f / -i, or use --signatures\nIf the project has no .git directory, auto-ignores still protect against dependency flooding\nUse --clear-cache if diff output seems stale or incorrect"
      }
    ],
    "body": "Context Builder — Agentic Skill\n\nGenerate a single, structured markdown file from any codebase directory. The output is optimized for LLM consumption with relevance-based file ordering, AST-aware code signatures, automatic token budgeting, and smart defaults.\n\nInstallation\n# Requires Rust toolchain. Builds from source with cryptographic verification via crates.io.\ncargo install context-builder --features tree-sitter-all\n\n\nPre-built binaries with SHA256 checksums are also available for manual download from GitHub Releases.\n\nVerify: context-builder --version (expected: 0.8.3)\n\nSecurity & Path Scoping\n\nIMPORTANT: This tool reads file contents from the specified directory. Agents MUST follow these rules:\n\nOnly target explicit project directories — always pass the exact project root (e.g., /home/user/projects/myapp). Never point at home directories, system paths, or credential stores (~/.ssh, ~/.aws, /etc, ~, /)\nUse scoped filters — use -f to limit to known source extensions (e.g., -f rs,toml,md), reducing exposure surface\nOutput to project-local paths — write output to the project's docs/ folder or /tmp/, never to shared or public locations\nReview before sharing — the output may contain API keys, secrets, or credentials embedded in source files; always review or use .gitignore patterns to exclude sensitive files\n\nBuilt-in protections (always active, no configuration needed):\n\nExcludes .git/, node_modules/, and 19 other heavy/sensitive directories at any depth\nRespects .gitignore rules when a .git directory is present\nBinary files are auto-detected and skipped via UTF-8 sniffing\nOutput file and cache directory are auto-excluded to prevent self-ingestion\nWhen to Use\nDeep code review — Feed an entire codebase to an LLM for architecture analysis or bug hunting\nOnboarding — Generate a project snapshot for understanding unfamiliar codebases\nDiff-based updates — After code changes, generate only the diffs to update an LLM's understanding\nAST signatures — Extract function/class signatures for token-efficient structural understanding\nCross-project research — Quickly package a dependency's source for analysis\nCore Workflow\n1. Quick Context (whole project)\ncontext-builder -d /path/to/project -y -o context.md\n\n-y skips confirmation prompts (recommended for agent workflows when path is explicitly scoped)\nOutput includes: header → file tree → files sorted by relevance (config → source → tests → docs)\n2. Scoped Context (specific file types)\ncontext-builder -d /path/to/project -f rs,toml -i docs,assets -y -o context.md\n\n-f rs,toml includes only Rust and TOML files\n-i docs,assets excludes directories by name\n3. AST Signatures Mode (minimal tokens)\ncontext-builder -d /path/to/project --signatures -f rs,ts,py -y -o signatures.md\n\nReplaces full file content with extracted function/class signatures (~4K vs ~15K tokens per file)\nSupports 8 languages: Rust, JavaScript (.js/.jsx), TypeScript (.ts/.tsx), Python, Go, Java, C, C++\nRequires --features tree-sitter-all at install time\n4. Signatures with Structural Summary\ncontext-builder -d /path/to/project --signatures --structure -y -o context.md\n\n--structure appends a count summary (e.g., \"6 functions, 2 structs, 1 impl block\")\nCombine with --visibility public to show only public API surface\n5. Budget-Constrained Context\ncontext-builder -d /path/to/project --max-tokens 100000 -y -o context.md\n\nCaps output to ~100K tokens (estimated)\nFiles are included in relevance order until budget is exhausted\nAutomatically warns if output exceeds 128K tokens\n6. Token Count Preview\ncontext-builder -d /path/to/project --token-count\n\nPrints estimated token count without generating output\nUse this first to decide if filtering or --signatures is needed\n7. Incremental Diffs\n\nFirst, ensure context-builder.toml exists with:\n\ntimestamped_output = true\nauto_diff = true\n\n\nThen run twice:\n\n# First run: baseline snapshot\ncontext-builder -d /path/to/project -y\n\n# After code changes: generates diff annotations\ncontext-builder -d /path/to/project -y\n\n\nFor minimal output (diffs only, no full file bodies):\n\ncontext-builder -d /path/to/project -y --diff-only\n\nSmart Defaults\n\nThese behaviors require no configuration:\n\nFeature\tBehavior\nAuto-ignore\tnode_modules, dist, build, __pycache__, .venv, vendor, and 12 more heavy dirs are excluded at any depth\nSelf-exclusion\tOutput file, cache dir, and context-builder.toml are auto-excluded\n.gitignore\tRespected automatically when .git directory exists\nBinary detection\tBinary files are skipped via UTF-8 sniffing\nFile ordering\tConfig/docs first → source (entry points before helpers) → tests → build/CI → lockfiles\nCLI Reference (Agent-Relevant Flags)\nFlag\tPurpose\tAgent Guidance\n-d <PATH>\tInput directory\tAlways use absolute paths for reliability\n-o <FILE>\tOutput path\tWrite to project docs/ or /tmp/\n-f <EXT>\tFilter by extension\tComma-separated: -f rs,toml,md\n-i <NAME>\tIgnore dirs/files\tComma-separated: -i tests,docs,assets\n--max-tokens <N>\tToken budget cap\tUse 100000 for most models, 200000 for Gemini\n--token-count\tDry-run token estimate\tRun first to check if filtering is needed\n-y\tSkip all prompts\tUse only with explicit, scoped project paths\n--preview\tShow file tree only\tQuick exploration without generating output\n--diff-only\tOutput only diffs\tMinimizes tokens for incremental updates\n--signatures\tAST signature extraction\tRequires tree-sitter-all feature at install\n--structure\tStructural summary\tPair with --signatures for compact output\n--visibility <V>\tFilter by visibility\tall (default), public (public API only)\n--truncate <MODE>\tTruncation strategy\tsmart (AST-aware) or simple\n--init\tCreate config file\tAuto-detects project file types\n--clear-cache\tReset diff cache\tUse if diff output seems stale\nRecipes\nRecipe: Deep Think Code Review\n\nGenerate a scoped context file, then prompt an LLM for deep analysis:\n\n# Step 1: Generate focused context\ncontext-builder -d /path/to/project -f rs,toml --max-tokens 120000 -y -o docs/deep_think_context.md\n\n# Step 2: Feed to LLM with a review prompt\n# Attach docs/deep_think_context.md and ask for:\n# - Architecture review\n# - Bug hunting\n# - Performance analysis\n\nRecipe: API Surface Review (signatures only)\n# Extract only public signatures — typically 80-90% fewer tokens than full source\ncontext-builder -d /path/to/project --signatures --visibility public -f rs -y -o docs/api_surface.md\n\nRecipe: Compare Two Versions\n# Generate context for both versions\ncontext-builder -d ./v1 -f py -y -o /tmp/v1_context.md\ncontext-builder -d ./v2 -f py -y -o /tmp/v2_context.md\n\n# Feed both to an LLM for comparative analysis\n\nRecipe: Monorepo Slice\n# Focus on a specific package within a monorepo\ncontext-builder -d /path/to/monorepo/packages/core -f ts,tsx -i __tests__,__mocks__ -y -o core_context.md\n\nRecipe: Quick Size Check Before Deciding Strategy\n# Check if the project fits in context\ncontext-builder -d /path/to/project --token-count\n\n# If > 128K tokens, try signatures mode first:\ncontext-builder -d /path/to/project --signatures --token-count\n\n# Or scope it down:\ncontext-builder -d /path/to/project -f rs,toml --max-tokens 100000 --token-count\n\nConfiguration File (Optional)\n\nCreate context-builder.toml in the project root for persistent settings:\n\noutput = \"docs/context.md\"\noutput_folder = \"docs\"\nfilter = [\"rs\", \"toml\"]\nignore = [\"target\", \"benches\"]\ntimestamped_output = true\nauto_diff = true\nmax_tokens = 120000\nsignatures = true\nstructure = true\nvisibility = \"public\"\n\n\nInitialize one automatically with context-builder --init.\n\nOutput Format\n\nThe generated markdown follows this structure:\n\n# Directory Structure Report\n[metadata: project name, filters, content hash]\n\n## File Tree\n[visual tree of included files]\n\n## Files\n### File: src/main.rs\n[code block with file contents, syntax-highlighted by extension]\n\n### File: src/lib.rs\n...\n\n\nFiles appear in relevance order (not alphabetical), prioritizing config and entry points so LLMs build understanding faster.\n\nWhen --signatures is active, file contents are replaced with extracted signatures:\n\n### File: src/lib.rs\n```rust\npub fn run_with_args(args: Args, config: Config, prompter: &dyn Prompter) -> Result<()>\npub fn generate_markdown_with_diff(...) -> Result<String>\n```\n\nError Handling\nIf context-builder is not installed, install with cargo install context-builder --features tree-sitter-all\nIf --signatures shows no output for a file, the language may not be supported or the feature was not enabled at install\nIf output exceeds token limits, add --max-tokens or narrow with -f / -i, or use --signatures\nIf the project has no .git directory, auto-ignores still protect against dependency flooding\nUse --clear-cache if diff output seems stale or incorrect"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/igorls/context-builder",
    "publisherUrl": "https://clawhub.ai/igorls/context-builder",
    "owner": "igorls",
    "version": "0.8.3-1",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/context-builder",
    "downloadUrl": "https://openagent3.xyz/downloads/context-builder",
    "agentUrl": "https://openagent3.xyz/skills/context-builder/agent",
    "manifestUrl": "https://openagent3.xyz/skills/context-builder/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/context-builder/agent.md"
  }
}