kit/plugins/social-media-tools/skills/share-scan/SKILL.md
Scans git history or a codebase path for shareable code. Drafts social media prompts for share-code or digest generation. Use when the user asks to find commits worth sharing or create a digest.
npx skillsauth add shawn-sandy/agentics share-scanInstall 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.
Discover shareable code, scrub for secrets, and draft share-code prompts. Writes a digest file the user reviews before posting.
| Arguments | Mode | Source |
|-----------|------|--------|
| (default) | History | git log on current branch |
| --codebase <path> | Codebase | Read/Glob on given 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.
Check for SOCIAL.md at the project root:
SOCIAL_CONFIG=""
GIT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null)"
if [ -f "$PWD/SOCIAL.md" ]; then
SOCIAL_CONFIG="$PWD/SOCIAL.md"
elif [ -n "$GIT_ROOT" ] && [ -f "$GIT_ROOT/SOCIAL.md" ]; then
SOCIAL_CONFIG="$GIT_ROOT/SOCIAL.md"
fi
If found, Read it silently. Extract:
FOCUS_AREAS — bullet list from ## Focus; boost candidate scores in Step 3AVOID_PATTERNS — bullet list from ## Avoid; filter candidates in Step 2Parse $ARGUMENTS:
--days=N — how far back to scan (default: 7, history mode only)--base=BRANCH — base branch for diff (auto-detect main or master if omitted, history mode only)--max=N — max candidates before scoring (default: 20)--codebase <path> — activates codebase mode; value is the path to scanGuard (history mode only): run git rev-parse --git-dir 2>/dev/null — if it fails, output:
Not a git repository. Run from a git repo root or use --codebase <path> for codebase mode.
Then stop.
# By time window
git log --oneline --after="N days ago" --format="%H %s" HEAD
# By branch delta (deduplicate with above)
git log --oneline [base]..HEAD --format="%H %s"
Deduplicate by hash. For each unique hash get stats:
git show --stat --format="" [hash]
(git show handles root commits safely; git diff [hash]~1 fails when there is no parent.)
Limit to --max candidates before scoring.
Use Glob to find source files under the given path (exclude: node_modules, .git, dist, build, *.min.js, *.map, lock files).
For each file use Read to load content. Collect {file_path, excerpt} as the candidate unit (excerpt = first 100 lines or the most interesting block).
If AVOID_PATTERNS was loaded from SOCIAL.md, remove candidates whose commit
subject, changed file path, or file path matches any avoid pattern (case-insensitive
substring or glob match). Log filtered count silently.
Read the references/interesting-patterns.md file adjacent to this SKILL.md to load the current scoring table.
Focus boost: If FOCUS_AREAS was loaded from SOCIAL.md, add +1 to the score
of any candidate whose subject or path matches a focus keyword (case-insensitive).
Include candidates with score ≥ 2. If fewer than 3 qualify, fill up with score ≥ 1 candidates until you have 3 (or exhaust the list).
For each candidate:
git show --format="" -U3 [hash]security-scrub skill on the content.SCRUB RESULT: BLOCKED or ALLOWLIST verdict: BLOCKED → remove candidate, note reasonSCRUB RESULT: WARN → keep but flag as ⚠ WARN in the digestCandidates that were BLOCKED are excluded from the digest entirely. WARN candidates appear with a warning label.
Before building digest entries, check docs/media/social/ for already-saved posts that match each candidate. This prevents surfacing content that has already been shared.
MEDIA_DIR="${PWD}/docs/media/social"
For each candidate:
tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g') and check if any file in $MEDIA_DIR contains those tokens: ls "$MEDIA_DIR" 2>/dev/null | grep -i "<slug-tokens>"If a match is found, mark the candidate with SAVED=true and the matching file path SAVED_PATH.
Include SAVED candidates but tag them with [SAVED] in the review gate options and in the digest output.
For each surviving candidate, build a structured entry using the card-type decision tree and platform heuristics from references/interesting-patterns.md:
### [N]. <subject>
- **Source:** `<commit hash>` or `<file path>`
- **Card type:** <feature-card | diff-card | quote-card>
- **Platform:** <one of the platforms from `$PLUGIN_DIR/references/platforms.md`>
- **Summary:** <one sentence describing what makes this shareable>
- **Key change / highlight:** <the most interesting line or pattern>
- **Security:** PASS ✓ (or ⚠ WARN — <reason>)
- **Already saved:** [SAVED: `docs/media/social/{filename}`] (omit this line if not saved)
- **share-code prompt:**
/social-media-tools:share-code <card-type> for <platform>: <description>
Present all PASS and WARN candidates in a single AskUserQuestion call with multiSelect: true. Options list each candidate by number and subject. Include a note on any WARN entry.
Ask: "Which entries should go into the digest?" — options are the candidates, plus "None — discard all".
Use only the user-selected entries in the final digest.
mkdir -p .claude/digests
Write the digest to .claude/digests/code-digest-YYYY-MM-DD.md using today's date. The file contains the selected entries from Step 5 plus a header:
# Code Digest — YYYY-MM-DD
Mode: <history (last N days) | codebase (path)>
Generated: <timestamp>
Entries: <count>
---
<entries>
Report the output path and entry count to the user.
STOP. Do not invoke share-code automatically. The user reviews the digest and picks which prompts to run.
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.