|
| 1 | +--- |
| 2 | +name: clipboard |
| 3 | +description: Copy track content (lyrics, style prompts) to system clipboard |
| 4 | +argument-hint: <content-type> <album-name> <track-number> |
| 5 | +model: claude-haiku-4-5-20251001 |
| 6 | +allowed-tools: |
| 7 | + - Read |
| 8 | + - Bash |
| 9 | +--- |
| 10 | + |
| 11 | +## Your Task |
| 12 | + |
| 13 | +**Input**: $ARGUMENTS |
| 14 | + |
| 15 | +Copy content from track files to the system clipboard for pasting into Suno or other tools. |
| 16 | + |
| 17 | +--- |
| 18 | + |
| 19 | +# Clipboard Skill |
| 20 | + |
| 21 | +Copy specific sections from track files directly to your clipboard. |
| 22 | + |
| 23 | +## Step 1: Detect Platform & Check Clipboard Tool |
| 24 | + |
| 25 | +Run detection: |
| 26 | + |
| 27 | +```bash |
| 28 | +if command -v pbcopy >/dev/null 2>&1; then |
| 29 | + echo "macOS" |
| 30 | +elif command -v clip.exe >/dev/null 2>&1; then |
| 31 | + echo "WSL" |
| 32 | +elif command -v xclip >/dev/null 2>&1; then |
| 33 | + echo "Linux-xclip" |
| 34 | +elif command -v xsel >/dev/null 2>&1; then |
| 35 | + echo "Linux-xsel" |
| 36 | +else |
| 37 | + echo "NONE" |
| 38 | +fi |
| 39 | +``` |
| 40 | + |
| 41 | +**If NONE:** |
| 42 | + |
| 43 | +``` |
| 44 | +Error: No clipboard utility found. |
| 45 | +
|
| 46 | +Install instructions: |
| 47 | +- macOS: pbcopy (built-in) |
| 48 | +- Linux: sudo apt install xclip |
| 49 | +- WSL: clip.exe (built-in) |
| 50 | +``` |
| 51 | + |
| 52 | +## Step 2: Parse Arguments |
| 53 | + |
| 54 | +Expected format: `<content-type> <album-name> <track-number>` |
| 55 | + |
| 56 | +**Content types:** |
| 57 | +- `lyrics` - Suno Lyrics Box |
| 58 | +- `style` - Suno Style Box |
| 59 | +- `streaming-lyrics` - Streaming Lyrics (for distributors) |
| 60 | +- `all` - All Suno inputs (Style + Lyrics combined) |
| 61 | + |
| 62 | +Examples: |
| 63 | +- `/clipboard lyrics shell-no 03` |
| 64 | +- `/clipboard style shell-no 05` |
| 65 | +- `/clipboard streaming-lyrics shell-no 02` |
| 66 | +- `/clipboard all shell-no 01` |
| 67 | + |
| 68 | +If arguments are missing: |
| 69 | +``` |
| 70 | +Usage: /clipboard <content-type> <album-name> <track-number> |
| 71 | +
|
| 72 | +Content types: lyrics, style, streaming-lyrics, all |
| 73 | +
|
| 74 | +Example: /clipboard lyrics shell-no 03 |
| 75 | +``` |
| 76 | + |
| 77 | +## Step 3: Read Config (REQUIRED) |
| 78 | + |
| 79 | +```bash |
| 80 | +cat ~/.bitwize-music/config.yaml |
| 81 | +``` |
| 82 | + |
| 83 | +Extract: |
| 84 | +- `paths.content_root` → Base content directory |
| 85 | +- `artist.name` → Artist name |
| 86 | + |
| 87 | +## Step 4: Find Track File |
| 88 | + |
| 89 | +Search for track file matching the number: |
| 90 | + |
| 91 | +```bash |
| 92 | +find {content_root}/artists/{artist}/albums/*/{{album}}/tracks/ -name "{track-number}-*.md" 2>/dev/null |
| 93 | +``` |
| 94 | + |
| 95 | +Example: For track `03`, finds `03-t-day-beach.md` or `03-whatever.md` |
| 96 | + |
| 97 | +**If not found:** |
| 98 | +``` |
| 99 | +Error: Track {track-number} not found in album {album} |
| 100 | +``` |
| 101 | + |
| 102 | +## Step 5: Extract Content |
| 103 | + |
| 104 | +Read the track file and extract the requested section. |
| 105 | + |
| 106 | +### For "lyrics" (Suno Lyrics Box) |
| 107 | + |
| 108 | +Extract everything between: |
| 109 | +```markdown |
| 110 | +#### Lyrics Box (Suno) |
| 111 | +``` |
| 112 | +and the next `###` or `####` heading. |
| 113 | + |
| 114 | +### For "style" (Suno Style Box) |
| 115 | + |
| 116 | +Extract everything between: |
| 117 | +```markdown |
| 118 | +#### Style Box (Suno) |
| 119 | +``` |
| 120 | +and the next `###` or `####` heading. |
| 121 | + |
| 122 | +### For "streaming-lyrics" (Streaming Lyrics) |
| 123 | + |
| 124 | +Extract everything between: |
| 125 | +```markdown |
| 126 | +## Streaming Lyrics |
| 127 | +``` |
| 128 | +and the next `##` heading. |
| 129 | + |
| 130 | +### For "all" (Combined Suno Inputs) |
| 131 | + |
| 132 | +Combine both Style Box and Lyrics Box with a separator: |
| 133 | +``` |
| 134 | +[Style Box content] |
| 135 | +
|
| 136 | +--- |
| 137 | +
|
| 138 | +[Lyrics Box content] |
| 139 | +``` |
| 140 | + |
| 141 | +## Step 6: Copy to Clipboard |
| 142 | + |
| 143 | +Use the detected platform's clipboard command: |
| 144 | + |
| 145 | +| Platform | Command | |
| 146 | +|----------|---------| |
| 147 | +| macOS | `pbcopy` | |
| 148 | +| WSL | `clip.exe` | |
| 149 | +| Linux (xclip) | `xclip -selection clipboard` | |
| 150 | +| Linux (xsel) | `xsel --clipboard --input` | |
| 151 | + |
| 152 | +Example: |
| 153 | +```bash |
| 154 | +echo "content" | pbcopy # macOS |
| 155 | +echo "content" | xclip -selection clipboard # Linux |
| 156 | +``` |
| 157 | + |
| 158 | +## Step 7: Confirm |
| 159 | + |
| 160 | +Report: |
| 161 | +``` |
| 162 | +✓ Copied to clipboard: {content-type} from track {track-number} |
| 163 | + Album: {album} |
| 164 | + Track: {track-filename} |
| 165 | +``` |
| 166 | + |
| 167 | +## Error Handling |
| 168 | + |
| 169 | +**Track file not found:** |
| 170 | +``` |
| 171 | +Error: Track {track-number} not found in album {album} |
| 172 | +
|
| 173 | +Available tracks: |
| 174 | +- 01-track-name.md |
| 175 | +- 02-track-name.md |
| 176 | +``` |
| 177 | + |
| 178 | +**Content section not found:** |
| 179 | +``` |
| 180 | +Error: {content-type} section not found in track {track-number} |
| 181 | +
|
| 182 | +The track file may not have this section yet. |
| 183 | +``` |
| 184 | + |
| 185 | +**Config missing:** |
| 186 | +``` |
| 187 | +Error: Config not found at ~/.bitwize-music/config.yaml |
| 188 | +Run /configure to set up. |
| 189 | +``` |
| 190 | + |
| 191 | +--- |
| 192 | + |
| 193 | +## Examples |
| 194 | + |
| 195 | +### Copy Suno Lyrics |
| 196 | + |
| 197 | +``` |
| 198 | +/clipboard lyrics shell-no 03 |
| 199 | +``` |
| 200 | + |
| 201 | +Output: |
| 202 | +``` |
| 203 | +✓ Copied to clipboard: lyrics from track 03 |
| 204 | + Album: shell-no |
| 205 | + Track: 03-t-day-beach.md |
| 206 | +``` |
| 207 | + |
| 208 | +### Copy Style Prompt |
| 209 | + |
| 210 | +``` |
| 211 | +/clipboard style shell-no 05 |
| 212 | +``` |
| 213 | + |
| 214 | +### Copy Streaming Lyrics |
| 215 | + |
| 216 | +``` |
| 217 | +/clipboard streaming-lyrics shell-no 02 |
| 218 | +``` |
| 219 | + |
| 220 | +### Copy All Suno Inputs |
| 221 | + |
| 222 | +``` |
| 223 | +/clipboard all shell-no 01 |
| 224 | +``` |
| 225 | + |
| 226 | +Output: |
| 227 | +``` |
| 228 | +✓ Copied to clipboard: all suno inputs from track 01 |
| 229 | + Album: shell-no |
| 230 | + Track: 01-intro.md |
| 231 | +
|
| 232 | +Contents: |
| 233 | +- Style Box |
| 234 | +- Lyrics Box |
| 235 | +``` |
| 236 | + |
| 237 | +--- |
| 238 | + |
| 239 | +## Implementation Notes |
| 240 | + |
| 241 | +**Clipboard Detection:** |
| 242 | +- Check multiple tools in order of preference |
| 243 | +- WSL has `clip.exe` which works from Linux subsystem |
| 244 | +- Linux users may have either `xclip` or `xsel` |
| 245 | + |
| 246 | +**Content Extraction:** |
| 247 | +- Use sed/awk to extract sections between markdown headings |
| 248 | +- Trim leading/trailing whitespace |
| 249 | +- Preserve internal formatting (blank lines, indentation) |
| 250 | + |
| 251 | +**Multiple Matches:** |
| 252 | +- If track number matches multiple files (shouldn't happen), use the first match |
| 253 | +- Warn user if directory structure looks wrong |
0 commit comments