Skip to content

Commit 530a94b

Browse files
bitwize-musicclaude
andcommitted
feat: add /clipboard skill for cross-platform content copying
Add /clipboard skill to copy track content (lyrics, style prompts) directly to system clipboard for pasting into Suno or other tools. Features: - Cross-platform support: macOS (pbcopy), Linux (xclip/xsel), WSL (clip.exe) - Content types: lyrics, style, streaming-lyrics, all (combined Suno inputs) - Auto-detects platform and clipboard utility - Config-aware path resolution to find track files - Clear error handling with install instructions Usage: /clipboard <content-type> <album-name> <track-number> Also updated: - CHANGELOG.md with feature description - CLAUDE.md skills table - README.md skills table and count (31 → 32) - Test suite with 3 clipboard-specific tests Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent e93338c commit 530a94b

5 files changed

Lines changed: 287 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ This project uses [Conventional Commits](https://conventionalcommits.org/) and [
77
## [Unreleased]
88

99
### Added
10+
- `/clipboard` skill - Copy track content (lyrics, style prompts) to system clipboard
11+
- Cross-platform support: macOS (pbcopy), Linux (xclip/xsel), WSL (clip.exe)
12+
- Content types: lyrics, style, streaming-lyrics, all (combined Suno inputs)
13+
- Auto-detects platform and clipboard utility
14+
- Config-aware path resolution
15+
- Usage: `/clipboard <content-type> <album-name> <track-number>`
1016

1117
### Changed
1218

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ Specialized skills are available as slash commands. Type `/` to see the menu.
310310
| `/bitwize-music:import-audio` | Move audio files to correct album location (always reads config) |
311311
| `/bitwize-music:import-track` | Move track .md files to correct album location (always reads config) |
312312
| `/bitwize-music:import-art` | Place album art in both audio and content locations (always reads config) |
313+
| `/bitwize-music:clipboard` | Copy track content (lyrics, style prompts) to system clipboard - works on macOS/Linux/WSL |
313314
| `/bitwize-music:new-album` | Create album directory structure with templates (always reads config) |
314315
| `/bitwize-music:release-director` | Album release coordination, QA, distribution, platform uploads |
315316
| `/bitwize-music:validate-album` | Validate album structure, file locations, catch path issues |

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ A complete AI music production workflow for Suno. Install as a Claude Code plugi
99
1010
## What Is This?
1111

12-
This is a collection of **31 specialized skills** that turn Claude Code into a full music production assistant. It handles everything from album concept development to lyrics, Suno prompts, mastering, and release.
12+
This is a collection of **32 specialized skills** that turn Claude Code into a full music production assistant. It handles everything from album concept development to lyrics, Suno prompts, mastering, and release.
1313

1414
**What you get:**
1515
- Structured workflow from idea to released album
@@ -316,6 +316,7 @@ For documentary or true-story albums:
316316
| Skill | Description |
317317
|-------|-------------|
318318
| `/bitwize-music:configure` | Set up or edit plugin configuration |
319+
| `/bitwize-music:clipboard` | Copy track content to clipboard (macOS/Linux/WSL) |
319320
| `/bitwize-music:test` | Run automated tests to validate plugin integrity |
320321
| `/bitwize-music:skill-model-updater` | Update Claude model references |
321322
| `/bitwize-music:about` | About bitwize and this plugin |

skills/clipboard/SKILL.md

Lines changed: 253 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
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

skills/test/SKILL.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,31 @@ Read skills/album-ideas/SKILL.md and verify these commands are documented:
195195
- `show` - Show details for specific idea
196196
- `edit` - Edit existing idea
197197

198+
### TEST: /clipboard skill exists
199+
```
200+
Glob: skills/clipboard/SKILL.md
201+
```
202+
203+
### TEST: /clipboard skill has platform detection
204+
Read skills/clipboard/SKILL.md and verify:
205+
1. Documents platform detection (macOS, Linux, WSL)
206+
2. Lists clipboard tools: pbcopy, xclip, xsel, clip.exe
207+
3. Has error handling for missing clipboard utility
208+
4. Provides install instructions for each platform
209+
210+
### TEST: /clipboard skill has all content types documented
211+
Read skills/clipboard/SKILL.md and verify these content types are documented:
212+
- `lyrics` - Suno Lyrics Box
213+
- `style` - Suno Style Box
214+
- `streaming-lyrics` - Streaming Lyrics for distributors
215+
- `all` - Combined Style + Lyrics
216+
217+
### TEST: /clipboard skill has correct argument format
218+
Read skills/clipboard/SKILL.md and verify:
219+
1. `argument-hint` matches format: `<content-type> <album-name> <track-number>`
220+
2. Examples show correct usage pattern
221+
3. Error handling for missing arguments is documented
222+
198223
### TEST: Override support documented in skills
199224
Verify these skills have "Override Support" section in their SKILL.md:
200225
- `skills/explicit-checker/SKILL.md` → loads `explicit-words.md`

0 commit comments

Comments
 (0)