code-share for Openclaw

A professional utility for AI agents to share large code blocks via GitHub Gists instead of cluttered chat messages.

jeromestein
v0.2.0
Feb 21, 2026
2
1.6k
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install code-share

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 code-share 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 code-share?

The code-share skill is a specialized tool designed to optimize the developer experience when working with AI agents. Instead of flooding chat interfaces with long code blocks, this skill automatically transitions snippets longer than 10 lines into GitHub Gists. This maintains a clean workspace and provides a copy-friendly, syntax-highlighted URL for the user. By integrating this into your Openclaw Skills library, you ensure that code formatting is preserved and that generated scripts are easily accessible outside of the immediate chat history.

Built with a focus on security and efficiency, code-share defaults to creating secret gists to protect developer privacy. It leverages the GitHub CLI to handle authenticated requests, making it a robust choice for developers who need to manage code revisions and sharing seamlessly. This skill is particularly valuable in environments like Discord or Slack where large text blocks can break the flow of communication.

code-share Use Cases

  • Sharing generated scripts or solutions that exceed 10 lines of code.
  • Providing persistent, copy-paste friendly URLs for code reviews and collaboration.
  • Reducing chat clutter in community environments like Discord using Openclaw Skills.
  • Updating existing code snippets with new revisions while maintaining the same URL.
  • Ensuring syntax highlighting is correctly applied to shared files through proper extension handling.

How code-share Works

  1. The AI agent evaluates the length of the code output; if it exceeds 10 lines, it triggers the code-share workflow.
  2. The skill performs a mandatory security scan to identify and replace sensitive data like API keys or PII with placeholders.
  3. It verifies the local GitHub CLI authentication status to ensure the user is logged in.
  4. The code is written to a temporary file with the correct language extension to support Gist syntax highlighting.
  5. The skill executes either a creation script for new snippets or an update script for existing Gists.
  6. A standardized three-line response is returned to the user containing a summary, the Gist URL, and file metadata.

code-share Setup

To use this skill, ensure you have the GitHub CLI installed on your machine. First, verify your authentication status:

gh auth status

If you are not authenticated or need to set up a new account, run:

gh auth login

Ensure that the provided shell scripts (create_gist.sh and update_gist.sh) are located in your ./scripts/ directory and have the necessary execution permissions to allow the Openclaw Skills agent to interact with the GitHub API.

code-share Data Schema & Taxonomy

The code-share skill manages data through a combination of local temporary files and GitHub's Gist metadata.

Attribute Description
Gist ID Unique identifier for the shared code snippet
Visibility Defaulted to 'secret' to ensure privacy
Description A short, descriptive string explaining the snippet's purpose
File Extension Determined by the language (e.g., .py, .ts) for proper rendering
Line Count Tracked to determine if the 10-line sharing threshold is met
Sensitive Data Map Internal logic to identify and replace PII with <FILL_ME> placeholders

code-share Advanced Features

  • Smart Update Mode: Automatically updates the same Gist URL with new revisions instead of creating duplicate links.
  • Automated Sensitive Data Scrubbing: Proactively removes tokens, secrets, and private keys before the code leaves the local environment.
  • Custom Script Integration: Uses specialized wrapper scripts to handle language detection and public/private visibility toggles.
  • Standardized UI Response: Enforces a strict 3-line output format to maintain consistency across different Openclaw Skills implementations.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*