$npx -y skills add opendatahub-io/ai-helpers --skill gist-uploadUse this skill to upload a summary or plan from the current conversation as a GitHub Gist using the gh CLI.
| 1 | # Upload to GitHub Gist |
| 2 | |
| 3 | Upload content from the current conversation (a plan, summary, analysis, or other output) as a GitHub Gist using the `gh` CLI. |
| 4 | |
| 5 | ## Prerequisites |
| 6 | |
| 7 | - `gh` CLI must be installed and authenticated (`gh auth status` should succeed) |
| 8 | |
| 9 | ## Usage |
| 10 | |
| 11 | This skill triggers when the user asks to upload conversation content to a gist, for example: |
| 12 | - "Upload the plan to gist" |
| 13 | - "Upload the summary of our conversation as a gist" |
| 14 | - "Create a gist with the analysis above" |
| 15 | - "Share this as a gist" |
| 16 | |
| 17 | ## Implementation |
| 18 | |
| 19 | ### Step 1: Identify the Content |
| 20 | |
| 21 | 1. Look at the conversation history to identify what the user wants uploaded |
| 22 | 2. If the user says "the plan", "the summary", "the analysis", etc., find that specific content in the conversation |
| 23 | 3. If ambiguous, ask the user: "Which part of our conversation should I upload? For example, the plan, summary, or a specific section?" |
| 24 | |
| 25 | ### Step 2: Format the Content |
| 26 | |
| 27 | 1. Take the identified content and format it as clean markdown |
| 28 | 2. Choose a descriptive filename based on the content type, e.g. `plan.md`, `summary.md`, `analysis.md` |
| 29 | 3. If the content relates to a specific project or topic, include that in the filename, e.g. `migration-plan.md` |
| 30 | |
| 31 | ### Step 3: Upload via `gh gist create` |
| 32 | |
| 33 | 1. Write the content to a temporary file in `/tmp/` |
| 34 | 2. Upload using `gh`: |
| 35 | ```bash |
| 36 | gh gist create /tmp/<filename> |
| 37 | ``` |
| 38 | - Gists are created as **secret** by default. Note: secret gists are **unlisted, not private**, anyone with the URL can view them. Warn the user about this before uploading sensitive content. |
| 39 | - If the user explicitly asks for a public gist, add `--public` |
| 40 | 3. Capture the gist URL from the command output |
| 41 | |
| 42 | ### Step 4: Report and Clean Up |
| 43 | |
| 44 | 1. Show the user the gist URL |
| 45 | 2. Delete the temporary file |