返回顶部
c

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/chat, or when preserving formatting is important.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 0.2.0
安全检测
已通过
754
下载量
2
收藏
概述
安装方式
版本历史

code-share

# 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="<FILL_ME>"` - `TOKEN="<YOUR_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: ```bash ./scripts/update_gist.sh <gist_url_or_id> <file> "<short 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: ```bash gh gist create <file> --desc "<short 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: ```bash ./scripts/create_gist.sh <file> "<short description>" [public|secret] [lang] ``` If `<file>` 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: <filename> · Lines: <line_count>` Example: Shared the full script as a secret Gist for clean copy/paste. https://gist.github.com/... File: lc761_solution.py · Lines: 42

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 code-share-1776419979 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 code-share-1776419979 技能

通过命令行安装

skillhub install code-share-1776419979

下载 Zip 包

⬇ 下载 code-share v0.2.0

文件大小: 3.73 KB | 发布时间: 2026-4-17 18:29

v0.2.0 最新 2026-4-17 18:29
Add update mode, security policy, language-extension hinting, and concise sharing workflow docs.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部