Convert GitHub Repository for Openclaw

A versatile skill designed to transform GitHub repository structures, code, issues, PRs, and metadata into cleanly formatted Markdown, JSON, CSV, or tree representations.

wangjipeng977
v1.0.0
May 21, 2026
1
692
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install convert-github-repository

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install convert-github-repository using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Convert GitHub Repository?

The convert-github-repository skill is an essential tool in the ecosystem of Openclaw Skills, enabling developers and AI agents to seamlessly transform GitHub repositories into highly digestible formats. Whether you need to export full codebases to Markdown, analyze issue trends via CSV, or extract structured metadata to JSON, this skill performs deep semantic translations instead of simple file copy operations.

By preserving structure and content fidelity, it converts complex GitHub data models (including repositories, directory trees, commits, issues, PRs, and releases) while respecting source formats and handling binary exclusions. This makes it incredibly powerful for documentation generation, codebase auditing, and feeding repository contexts into AI workflows.

Convert GitHub Repository Use Cases

  • Generating comprehensive Markdown documentation of a repository, including structured pages for directories, issues, PRs, and releases.
  • Exporting GitHub issue trackers and pull request history to CSV for project management, reporting, or data analysis.
  • Mapping repository layouts and file sizes into structured JSON directory trees to optimize LLM context loading.
  • Transforming a repository README.md into structured JSON schema (headings, code blocks, install instructions) for automated tooling.
  • Archiving code and metadata from remote or local Git repositories cleanly.

How Convert GitHub Repository Works

  1. Identify Repository Source: Evaluates the input URL or local path. For remote repositories, it extracts the owner and repository name, preparing to authenticate via the GitHub API using your GITHUB_TOKEN environment variable. For local repositories, it verifies the existence of a .git directory and utilizes the local git CLI to extract file lists and histories.
  2. Fetch Metadata: Queries the GitHub API or reads local git configuration to aggregate top-level repository details such as stars, license, description, default branches, and topics.
  3. Retrieve Repository Contents: Recursively traverses the repository structure. It filters out non-essential directories like node_modules, .git, or temporary caches, and flags large binary files to exclude them from content body generation while listing them in a manifest.
  4. Apply Target Format Transformations: Converts the gathered code and metadata using the specified flag: --markdown, --json, --csv, --tree, or --readme-to-json.
  5. Output Validation: Validates the newly generated format (verifying parseable JSON, aligned CSV columns, or clean UTF-8 encoded Markdown files) to guarantee strict schema compliance.
  6. Deliver Manifest: Outputs the converted files along with an audit manifest describing files successfully processed, files skipped, and reasons for exclusions.

Convert GitHub Repository Setup

Configure your environment with your GitHub access token to unlock full API rate limits and private repository scanning when using Openclaw Skills.

# Set your GitHub Personal Access Token
export GITHUB_TOKEN="your_github_token_here"

# Run the conversion to Markdown format
/convert-github-repository --markdown https://github.com/owner/repo

# Run the conversion to a structural JSON tree
/convert-github-repository --tree /path/to/local/repo

Convert GitHub Repository Data Schema & Taxonomy

Supported Target Formats and Structures

Depending on the chosen flag, the skill produces structural data categorized as follows:

Format Option Primary Output Component Target Schema Details
--markdown Documentation hierarchy Generates README.md pages for directories, writes issues as frontmatter-enabled markdown (issues/YYYY-MM-DD-{num}.md), and maps code with syntax-highlighted blocks.
--json Repository metadata & file array Export structure includes root repo meta (stars, license), a list of files with paths and SHAs, branches, and contributors.
--csv Issue & PR matrices Columns generated: number, title, state, author, created_at, updated_at, labels, assignees, milestone, body_preview.
--tree Hierarchical JSON map Nested representation listing file path, file type (file or directory), byte size, and detected programming language.
--readme-to-json Document parse tree Extracts root title, summary paragraphs, installation steps, code_examples array, and hyperlinked references.

Output Manifest Schema

At the end of every execution, a mandatory JSON audit manifest is generated:

  • format: The target format output (e.g., markdown, json).
  • files_converted: Numeric count of successfully structured files.
  • files_skipped: Count of ignored files.
  • skipped_reasons: An array of objects mapping path to reason (e.g., binary files, gitignored paths).
  • total_size_bytes: Combined footprint of the processed repository data.
  • output_path: The directory location where the results are stored.

Convert GitHub Repository Advanced Features

  • Robust Binary & Ignored File Protection: Automatic detection and safe handling of files larger than 5MB or matching gitignore directives, ensuring code repositories are converted cleanly without bloating outputs with binary junk.
  • Strict Encoding Normalization: Automatically decodes source text as UTF-8, cleanly swapping corrupt or invalid byte values with replacement characters to avoid breaking ingestion parsers.
  • High-Scale Repo Streaming: Safely chunks and streams output writes for massive codebases (up to 10,000+ files), maintaining a low memory profile (< 500MB) preventing process crashes.
  • GitHub API Smart Pagination: Seamlessly cycles through multi-page API queries (30 to 100 items per page) to retrieve all issues, pull requests, and releases completely.
  • Local Git CLI Fallback: Uses system git binary calls when inspecting local developer sandboxes, ensuring zero dependency on remote network availability when processing code on machines. This ensures high efficiency when running local agents using Openclaw Skills.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*