bundle
Bundle and share code as gists or markdown. Use to create shareable code bundles, extract imports, and create GitHub gists.
What this skill does
# Code Bundler
Bundle code for sharing via gists or markdown.
## Prerequisites
```bash
# GitHub CLI for gists
brew install gh
gh auth login
```
## CLI Reference
### GitHub Gists
#### Create Gist
```bash
# Single file gist (public)
gh gist create file.ts
# Private gist
gh gist create --private file.ts
# Multiple files
gh gist create file1.ts file2.ts file3.ts
# With description
gh gist create -d "My code snippet" file.ts
# From stdin
echo "console.log('hello')" | gh gist create -f hello.js
# Public with description
gh gist create -d "Utility functions" --public utils.ts helpers.ts
```
#### List Gists
```bash
# Your gists
gh gist list
# With limit
gh gist list --limit 20
# Public only
gh gist list --public
# Secret only
gh gist list --secret
```
#### View Gist
```bash
# View gist content
gh gist view <gist-id>
# View specific file
gh gist view <gist-id> --filename utils.ts
# Get raw content
gh gist view <gist-id> --raw
```
#### Edit Gist
```bash
# Edit in editor
gh gist edit <gist-id>
# Add file to gist
gh gist edit <gist-id> --add newfile.ts
# Remove file
gh gist edit <gist-id> --remove oldfile.ts
```
#### Clone Gist
```bash
# Clone as repo
gh gist clone <gist-id>
# Clone to specific directory
gh gist clone <gist-id> my-snippet
```
#### Delete Gist
```bash
gh gist delete <gist-id>
```
## Bundle Patterns
### Bundle File with Dependencies
```bash
#!/bin/bash
# bundle-file.sh - Bundle a file with its local imports
FILE=$1
OUTPUT=${2:-bundle.md}
echo "# Code Bundle" > $OUTPUT
echo "" >> $OUTPUT
echo "## Main File: $FILE" >> $OUTPUT
echo '```typescript' >> $OUTPUT
cat $FILE >> $OUTPUT
echo '```' >> $OUTPUT
# Extract and include imports
grep -E "^import.*from ['\"]\./" $FILE | while read import; do
# Extract path
path=$(echo $import | sed -E "s/.*from ['\"](.+)['\"].*/\1/")
resolved="${path}.ts"
if [ -f "$resolved" ]; then
echo "" >> $OUTPUT
echo "## $resolved" >> $OUTPUT
echo '```typescript' >> $OUTPUT
cat "$resolved" >> $OUTPUT
echo '```' >> $OUTPUT
fi
done
echo "Bundle created: $OUTPUT"
```
### Create CLAUDE.md for Project
```bash
#!/bin/bash
# Generate project context file
OUTPUT="CLAUDE.md"
echo "# Project Context" > $OUTPUT
echo "" >> $OUTPUT
# Package info
if [ -f "package.json" ]; then
echo "## Dependencies" >> $OUTPUT
echo '```json' >> $OUTPUT
jq '.dependencies' package.json >> $OUTPUT
echo '```' >> $OUTPUT
fi
# Key files
echo "" >> $OUTPUT
echo "## Key Files" >> $OUTPUT
for f in src/index.ts src/main.ts app.ts; do
if [ -f "$f" ]; then
echo "" >> $OUTPUT
echo "### $f" >> $OUTPUT
echo '```typescript' >> $OUTPUT
head -100 "$f" >> $OUTPUT
echo '```' >> $OUTPUT
fi
done
```
### Share Code Snippet
```bash
# Quick share a file as gist
share-code() {
local file=$1
local desc=${2:-"Code snippet"}
gh gist create -d "$desc" --public "$file" | tail -1
}
# Usage
share-code src/utils.ts "Utility functions"
```
## Import Extraction
### Find All Imports
```bash
# Extract import statements
grep -h "^import" src/**/*.ts | sort -u
# External imports only
grep -h "^import" src/**/*.ts | grep -v "from '\.\." | sort -u
# Local imports only
grep -h "^import" src/**/*.ts | grep "from '\.\." | sort -u
```
### Dependency Graph
```bash
# Show what imports what
for f in src/**/*.ts; do
echo "=== $f ==="
grep "^import" "$f" | sed 's/.*from / <- /'
done
```
## Gist Workflow
### Code Review Share
```bash
# Share specific function for review
FILE=src/auth.ts
START=$(grep -n "export function login" $FILE | cut -d: -f1)
END=$(tail -n +$START $FILE | grep -n "^}" | head -1 | cut -d: -f1)
sed -n "${START},$((START+END-1))p" $FILE | \
gh gist create -d "Login function for review" -f login.ts
```
### Quick Demo
```bash
# Create runnable demo
cat > /tmp/demo.ts << 'EOF'
// Demo: Array utilities
const nums = [1, 2, 3, 4, 5];
console.log(nums.filter(n => n % 2 === 0));
EOF
gh gist create -d "Quick demo" --public /tmp/demo.ts
```
### Documentation Gist
```bash
# Bundle docs with code
gh gist create \
-d "My utility library" \
README.md \
src/utils.ts \
examples/usage.ts
```
## Best Practices
1. **Add descriptions** - Use `-d` for context
2. **Use private by default** - Unless intentionally sharing
3. **Include README** - Explain what the code does
4. **Version important gists** - Clone and commit changes
5. **Clean before sharing** - Remove secrets, comments
6. **Bundle dependencies** - Include necessary context
Related in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.