← 返回 Skills 市场
jeromestein

Code Share

作者 Jiayi Wang · GitHub ↗ · v0.2.0
cross-platform ✓ 安全检测通过
811
总下载
2
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install code-share
功能描述
Share code via GitHub Gist instead of inline chat blocks. Use when code output exceeds 10 lines, when the user asks for copy-friendly code sharing in Discord...
使用说明 (SKILL.md)

Gist Code Share

When returning code:

  1. If code is 10 lines or fewer, inline code block is allowed.
  2. If code is over 10 lines, prefer GitHub Gist.
  3. Default to secret gist unless user asks for public.
  4. Return a short summary + gist URL; avoid pasting long duplicate code in chat.
  5. Never publish secrets in shared code. If sensitive values are needed, use placeholders and tell user to fill them locally.

Required checks

  • Verify GitHub CLI auth: gh auth status
  • If not authenticated (or missing gist scope), ask user to run: gh auth login
  • Keep behavior simple: do not auto-fallback to alternate sharing backends by default; prefer guiding user to configure GitHub properly.

Sensitive data policy (mandatory)

Before sharing code, scan for sensitive data and remove it.

  • Never include API keys, tokens, passwords, private keys, cookies, session IDs, webhook secrets, phone/email PII, or absolute local secret paths.
  • If code requires secrets, replace with placeholders, for example:
    • API_KEY="\x3CFILL_ME>"
    • TOKEN="\x3CYOUR_TOKEN_HERE>"
    • .env entry with empty value
  • Add a short note telling the user to fill placeholders locally after copying.

Update mode (same URL)

When user asks to modify previously shared code, prefer updating the same gist link (new revision) instead of creating a new gist.

Use:

./scripts/update_gist.sh \x3Cgist_url_or_id> \x3Cfile> "\x3Cshort description>" [public|secret] [lang]

Behavior:

  • Keep the same gist URL.
  • Save changes as a new revision.
  • Return the same fixed 3-line response format.

Create a new gist only when:

  • user explicitly asks for a new link, or
  • existing gist is not editable by current GitHub account.

Create gist

Use:

gh gist create \x3Cfile> --desc "\x3Cshort description>"

If code is generated in-session, write it to a temp file in workspace first. Use language-appropriate extension (.py, .js, .ts, etc.) so Gist syntax highlighting works well.

With bundled script:

./scripts/create_gist.sh \x3Cfile> "\x3Cshort description>" [public|secret] [lang]

If \x3Cfile> has no extension, pass [lang] (for example python, typescript) so the script can upload with a proper extension.

Default behavior: do not use --web (automation-friendly). Optional: use --web only when the user explicitly asks to open the gist in browser immediately.

Response format (fixed)

Always use exactly this 3-line format:

  1. One sentence on what was shared.
  2. Gist URL (separate line).
  3. File: \x3Cfilename> · Lines: \x3Cline_count>

Example:

Shared the full script as a secret Gist for clean copy/paste. https://gist.github.com/... File: lc761_solution.py · Lines: 42

安全使用建议
This skill appears to do what it says: create and update GitHub Gists via the gh CLI. Before installing or using it: 1) Ensure the GitHub CLI (gh) is installed and authenticated with gist scope — SKILL.md expects gh but registry metadata omitted that requirement. 2) Review and be comfortable with gh's stored authentication on your machine (gh uses your GitHub token); the scripts call gh api/gh gist which operate with that account. 3) Remember that 'secret' gists are unlisted but not private to GitHub — anyone with the link can view them. 4) The skill includes a sensible sensitive-data policy; nevertheless, avoid uploading real secrets and verify placeholders are used. If you need stronger guarantees (audit logs, org-owned gists, or access controls), modify workflow to use an org/service account with appropriate governance rather than a personal gh token.
功能分析
Type: OpenClaw Skill Name: code-share Version: 0.2.0 The skill is designed to share code via GitHub Gist, with explicit instructions in SKILL.md for the AI agent to prioritize secret gists and strictly remove sensitive data (API keys, tokens, PII) before sharing. The accompanying shell scripts (`create_gist.sh`, `update_gist.sh`) implement this functionality using the standard `gh` CLI, employing safe practices like `mktemp` for temporary files and quoting arguments. There is no evidence of malicious intent, data exfiltration beyond the stated purpose, persistence mechanisms, or prompt injection attempts to subvert the agent's security directives.
能力评估
Purpose & Capability
Name/description (share code via Gist) align with the scripts and SKILL.md. However, the registry metadata lists no required binaries while the instructions and scripts require the GitHub CLI (gh). This is likely a metadata omission rather than malicious, but it is an inconsistency.
Instruction Scope
SKILL.md restricts behavior to creating/updating GitHub Gists via gh, scanning for secrets, and writing temp files for upload. It does not instruct reading unrelated system files or transmitting data to unexpected endpoints. The sensitive-data policy is explicit and appropriate.
Install Mechanism
There is no install spec (instruction-only), and the included shell scripts are simple wrappers around the gh CLI. No remote downloads or archive extraction are present. Low install risk.
Credentials
The skill does not request environment variables or credentials itself. It relies on the user's gh CLI authentication (stored/managed by gh). That is proportionate for a GitHub Gist integration.
Persistence & Privilege
always is false, no requests to modify other skills or global agent settings, and the scripts only operate on files passed to them and temporary files they create. No elevated persistence requested.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install code-share
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /code-share 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.2.0
Add update mode, security policy, language-extension hinting, and concise sharing workflow docs.
元数据
Slug code-share
版本 0.2.0
许可证
累计安装 1
当前安装数 1
历史版本数 1
常见问题

Code Share 是什么?

Share code via GitHub Gist instead of inline chat blocks. Use when code output exceeds 10 lines, when the user asks for copy-friendly code sharing in Discord... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 811 次。

如何安装 Code Share?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install code-share」即可一键安装,无需额外配置。

Code Share 是免费的吗?

是的,Code Share 完全免费(开源免费),可自由下载、安装和使用。

Code Share 支持哪些平台?

Code Share 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Code Share?

由 Jiayi Wang(@jeromestein)开发并维护,当前版本 v0.2.0。

💬 留言讨论