kit/plugins/social-media-tools/skills/share-github/SKILL.md
Fetches a GitHub file and generates a syntax-highlighted social card with copy. Scrubs, fills snippet-card.html, and screenshots via Playwright. Use when asked to share a code snippet from GitHub.
npx skillsauth add shawn-sandy/agentics share-githubInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Fetch a specific file or snippet from a public GitHub repository, security-scrub it, draft platform-aware copy, and generate a syntax-highlighted dark-mode card image.
Public repositories only. A 4xx from the raw URL means the repo is private or the path is wrong — stop with a clear error.
| Phase | Action |
|-------|--------|
| 0 — Locate | Locate templates/ and derive PLUGIN_DIR |
| 1 — Parse URL | Extract owner/repo/branch/path + parse #L fragment before any WebFetch |
| 1c — Reuse check | Scan docs/media/social/ for existing snippet posts; offer reuse |
| 2 — Fetch Raw Code | WebFetch raw URL; extract line range; cap at 80 lines |
| 3 — Security Scrub | Write to temp file; call security-scrub skill with explicit args |
| 4 — Draft Copy | Write platform-aware copy |
| 5 — Populate Template | HTML-escape code; fill snippet-card.html; save to docs/media/social/ |
| 6 — Deliver | Copy in fenced block + PNG card + saved path |
ExitPlanMode is a deferred tool. Only call it if currently in plan mode — skip this step entirely when not in plan mode. When calling: use ToolSearch with select:ExitPlanMode first, then call ExitPlanMode silently.
Run silently:
[ -n "${CLAUDE_PLUGIN_ROOT}" ] && [ -d "${CLAUDE_PLUGIN_ROOT}/templates" ] && \
echo "${CLAUDE_PLUGIN_ROOT}/templates"
find ~/.claude/plugins -path "*/social-media-tools/templates" -type d 2>/dev/null | head -1
find ~/.claude -path "*/social-media-tools/templates" -type d 2>/dev/null | head -1
Use the first non-empty result as TEMPLATES_DIR. Derive:
PLUGIN_DIR=$(dirname "$TEMPLATES_DIR")
If not found: output "Templates not found. Install the plugin or load it with --plugin-dir." and STOP.
https://github.com/{owner}/{repo}/blob/{branch}/{path} — standard file viewhttps://raw.githubusercontent.com/{owner}/{repo}/{branch}/{path} — raw URL#L: split on #, parse the right side:
L10 → LINE_START=10, LINE_END=10L10-L25 → LINE_START=10, LINE_END=25#... fragment from the URL — do not include it in any subsequent step.OWNER, REPO, BRANCH, FILE_PATHFILENAME = basename of FILE_PATHREPO_SLUG = OWNER/REPOLANGUAGE and LANGUAGE_COLOR from file extension — look up in $PLUGIN_DIR/references/language-map.mdHLJS_CLASS = lowercase language alias (e.g., typescript, python; C# → csharp; C++ → cpp; Shell → bash)Use AskUserQuestion to collect:
PLATFORM — see Platform Options in $PLUGIN_DIR/references/platforms.mdHOOK_ANGLE (optional)FILE_PREFIX=snippet
Read $PLUGIN_DIR/references/reuse-check.md and follow its procedure.
Use ToolSearch with select:WebFetch first (silent, no user output), then call WebFetch.
github.com/.../blob/...: convert to raw URL:
https://raw.githubusercontent.com/{OWNER}/{REPO}/{BRANCH}/{FILE_PATH}raw.githubusercontent.com/...: use as-is.Call WebFetch on the raw URL. Store the response body as RAW_CONTENT.
4xx response:
"This repository may be private or the file path is incorrect. This skill only supports public repositories." Then STOP.
Extract lines from RAW_CONTENT: if LINE_START/LINE_END set, use those (1-indexed); otherwise use lines 1–80.
Write the extracted snippet to a temp file:
Write to: ~/.claude/tmp/scrub-input.txt
Content: the extracted code snippet (plain text, no HTML escaping yet)
Then invoke:
Skill(skill: "social-media-tools:security-scrub", args: "Scan the file at ~/.claude/tmp/scrub-input.txt for secrets before sharing.")
Check the returned GATE RESULT line (the gate runs inside security-scrub):
GATE RESULT: BLOCKED or GATE RESULT: CANCELLED → STOP. Do not proceed to Phase 4.GATE RESULT: APPROVED → proceed to Phase 4.GATE RESULT → STOP and report an error (treat as gate failure).Read $PLUGIN_DIR/references/platforms.md for character limits, the Instructional Voice
doctrine, Learn-More CTA rule, Default Per-Platform Copy Formats, and Draft Copy —
Standard Procedure.
Takeaway-first: every post must surface a concrete, applicable takeaway — what the reader can learn or apply from this code (a pattern, technique, or design principle). The code is evidence for the lesson, not the headline.
Content-specific guidance for this skill:
Read the code snippet before drafting.
Apply in this exact order:
& → & ← must be first (prevents double-escaping)< → <> → >" → "Store the result as CODE_LINES_ESCAPED.
For variable reference, read $PLUGIN_DIR/references/variables.md.
| Template variable | Value |
|-------------------|-------|
| {{FILENAME}} | FILENAME (HTML-escaped) |
| {{LANGUAGE}} | HLJS_CLASS (lowercase alias, e.g. typescript) |
| {{LANGUAGE_COLOR}} | LANGUAGE_COLOR hex (from $PLUGIN_DIR/references/language-map.md only) |
| {{CODE_LINES}} | CODE_LINES_ESCAPED |
| {{LINE_RANGE}} | e.g., "L10–L25" or "lines 1–80" |
| {{REPO_SLUG}} | "OWNER/REPO" (HTML-escaped) |
| {{GITHUB_URL}} | Fragment-stripped original URL |
Read $PLUGIN_DIR/references/copy-panels.md for markup and escaping rules.
Write the populated HTML to ~/.claude/tmp/share-github-card.html:
mkdir -p ~/.claude/tmp
TEMP_HTML=share-github-card.html
FILE_PREFIX=snippet
SLUG_INPUT=$FILENAME
Read $PLUGIN_DIR/references/saving-and-delivery.md — Persistent Save section.
Read $PLUGIN_DIR/references/rendering-pipeline.md and follow the full pipeline.
Read $PLUGIN_DIR/references/saving-and-delivery.md — Deliver section.
development
Checks whether the branch's PR is ready and merges it when green. Runs the readiness gate, lint, and an approval prompt. Use when the user asks "merge?" or if a PR is ready to merge.
development
Implements a plan file that already exists. Walks its steps, ticks the spec, re-renders, and runs the completion gates. Use when asked to implement an existing plan.
development
Audits and optimizes CLAUDE.md project memory files. Checks adherence to Claude Code best practices and produces actionable fixes. Use when the user asks to audit, optimize, or diagnose a CLAUDE.md.
development
Converts an HTML artifact or Markdown file into a draft post for a static site. Scopes CSS to keep interactive blocks alive and escapes prose for MDX. Use when asked to turn an artifact into a post.