Skip to content

Commit c3807e7

Browse files
authored
Merge pull request #17 from iPlug2/claude-code
Add initial support for developing with claude code
2 parents 8051212 + ef3b853 commit c3807e7

File tree

7 files changed

+239
-3
lines changed

7 files changed

+239
-3
lines changed

.claude/skills/build/SKILL.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
name: build
3+
description: Build an iPlug2 plugin project for different formats and platforms (macOS, iOS, Windows)
4+
---
5+
6+
# Build iPlug2 Plugin (iPlug2OOS)
7+
8+
Use this skill when the user wants to build their plugin project.
9+
10+
## Workflow
11+
12+
1. **Identify the project:**
13+
- If not specified, look for `.xcworkspace` files in the repo root (excluding TemplateProject)
14+
- Ask user to choose if multiple projects exist
15+
16+
2. **Build using the appropriate method below**
17+
18+
## macOS Build (xcodebuild)
19+
20+
```bash
21+
xcodebuild -workspace [Project]/[Project].xcworkspace -scheme "[SCHEME]" -configuration [CONFIG] build 2>&1 | tee build.log
22+
```
23+
24+
**Schemes:** `macOS-APP`, `macOS-AU`, `macOS-VST2`, `macOS-VST3`, `macOS-CLAP`, `macOS-AAX`, `macOS-AUv3`
25+
**Configurations:** `Debug`, `Release`, `Tracer`
26+
27+
### Build Locations
28+
- APP: `~/Applications/[PluginName].app`
29+
- VST3: `~/Library/Audio/Plug-Ins/VST3/`
30+
- AU: `~/Library/Audio/Plug-Ins/Components/`
31+
- CLAP: `~/Library/Audio/Plug-Ins/CLAP/`
32+
33+
### Open in Xcode (recommended for debugging)
34+
```bash
35+
open [Project]/[Project].xcworkspace
36+
```
37+
38+
## iOS Build
39+
40+
```bash
41+
xcodebuild -workspace [Project]/[Project].xcworkspace -scheme "iOS-APP with AUv3" -configuration Debug -destination 'platform=iOS Simulator,name=iPhone 16 Pro' build
42+
```
43+
44+
For running in Simulator, use the `run-ios-simulator` skill.
45+
46+
## Windows Build
47+
48+
Open the `.sln` file in Visual Studio:
49+
```
50+
[Project]/[Project].sln
51+
```
52+
53+
Build from IDE or command line:
54+
```cmd
55+
msbuild [Project]/[Project].sln /p:Configuration=Release /p:Platform=x64
56+
```
57+
58+
## Tips
59+
60+
- Build one scheme at a time; building all may fail if SDKs are missing
61+
- Check `build.log` for issues
62+
- If Skia backend is configured, run `iPlug2/Dependencies/download-prebuilt-libs.sh mac` first
63+
- AUv3 requires code signing; use `macOS-AU` (AUv2) for simpler local testing
64+
- Use `xcodebuild -workspace [Project]/[Project].xcworkspace -list` to see all available schemes
65+
66+
## Example
67+
68+
```bash
69+
# Build standalone app (Debug)
70+
xcodebuild -workspace MySynth/MySynth.xcworkspace -scheme "macOS-APP" -configuration Debug build
71+
72+
# Open the built app
73+
open ~/Applications/MySynth.app
74+
75+
# Build AU plugin (Release)
76+
xcodebuild -workspace MySynth/MySynth.xcworkspace -scheme "macOS-AU" -configuration Release build
77+
```

.claude/skills/new-plugin/SKILL.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
name: new-plugin
3+
description: Create a new iPlug2 plugin project by duplicating TemplateProject in the iPlug2OOS repository
4+
---
5+
6+
# Create New Plugin (iPlug2OOS)
7+
8+
Use this skill when the user wants to create a new plugin project in this out-of-source repository.
9+
10+
## Workflow
11+
12+
1. **Gather project details:**
13+
- **Plugin name** (required): No spaces or special characters
14+
- **Manufacturer name** (required): No spaces
15+
16+
2. **Check for existing projects:**
17+
- If other project folders exist besides TemplateProject, ask if user wants to continue with existing work or create new
18+
19+
3. **Run duplicate script:**
20+
```bash
21+
./duplicate.py TemplateProject [PluginName] [ManufacturerName]
22+
```
23+
24+
4. **Offer config.h customization:**
25+
- `PLUG_UNIQUE_ID` - Verify the auto-generated 4-char ID
26+
- `PLUG_MFR_ID` - Set manufacturer's 4-char ID
27+
- Copyright, URLs - allow skipping for later
28+
29+
5. **Ask about committing:**
30+
```bash
31+
git add [PluginName]/*
32+
git add .vscode/*
33+
git add .github/*
34+
git add bump_version.py
35+
git commit -m "created [PluginName] based on TemplateProject"
36+
```
37+
38+
6. **Next steps:**
39+
- Open in Xcode: `open [PluginName]/[PluginName].xcworkspace`
40+
- Build: Use the `build` skill from iPlug2
41+
- Setup SDKs: Use the `setup-deps` skill if needed
42+
43+
## Example
44+
45+
```bash
46+
./duplicate.py TemplateProject MySynth MyBrand
47+
```
48+
49+
Creates `MySynth/` with all project files configured and ready to build.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
name: run-ios-simulator
3+
description: Build and run an iPlug2 iOS app in the iOS Simulator
4+
---
5+
6+
# Run iOS App in Simulator
7+
8+
Use this skill when the user wants to run an iPlug2 iOS project in the iOS Simulator.
9+
10+
## Workflow
11+
12+
1. **Identify the project:**
13+
- If not specified, look for `.xcworkspace` files in the repo root
14+
- Ask user to choose if multiple projects exist
15+
16+
2. **Check available simulators and get UDID:**
17+
```bash
18+
xcrun simctl list devices available | grep -E "iPhone|iPad"
19+
```
20+
Extract the UDID from the output (the value in parentheses, e.g., `9E866BC3-9E64-4608-B4D0-D20F1DE3E980`)
21+
22+
Or programmatically:
23+
```bash
24+
xcrun simctl list devices available -j | jq -r '.devices[] | .[] | select(.name=="[DeviceName]") | .udid'
25+
```
26+
27+
3. **Build for Simulator:**
28+
```bash
29+
xcodebuild -workspace [Project]/[Project].xcworkspace \
30+
-scheme "iOS-APP with AUv3" \
31+
-configuration Debug \
32+
-destination 'platform=iOS Simulator,name=[DeviceName]' \
33+
build
34+
```
35+
36+
4. **Find the built app:**
37+
```bash
38+
find ~/Library/Developer/Xcode/DerivedData -name "[Project].app" -path "*Debug-iphonesimulator*" -type d 2>/dev/null | head -1
39+
```
40+
41+
5. **Boot simulator and install (use UDID, not "booted"):**
42+
```bash
43+
open -a Simulator
44+
xcrun simctl boot [UDID] 2>/dev/null || true
45+
xcrun simctl install [UDID] "[path/to/Project.app]"
46+
```
47+
Using the UDID ensures the correct simulator is targeted even when multiple are running.
48+
49+
6. **Launch the app (use UDID):**
50+
```bash
51+
# Get bundle ID from Info.plist
52+
/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" "[path/to/Project.app]/Info.plist"
53+
xcrun simctl launch [UDID] [bundle.identifier]
54+
```
55+
56+
## Notes
57+
58+
- **No code signing required** for Simulator builds
59+
- **Always use UDID** to target a specific simulator, not `booted`
60+
- Default device: iPhone 17 Pro (or latest available)
61+
- The AUv3 plugin is embedded in the app and will be available to host apps in the Simulator
62+
- Use `xcrun simctl list devices available` to see all device options
63+
- If `jq` is not installed, extract UDID manually from `xcrun simctl list devices available` output
64+
65+
## Example
66+
67+
For TemplateProject on iPhone 17 Pro:
68+
```bash
69+
# Get the UDID for iPhone 17 Pro
70+
UDID=$(xcrun simctl list devices available -j | jq -r '.devices[] | .[] | select(.name=="iPhone 17 Pro") | .udid')
71+
72+
# Build
73+
xcodebuild -workspace TemplateProject/TemplateProject.xcworkspace \
74+
-scheme "iOS-APP with AUv3" -configuration Debug \
75+
-destination "platform=iOS Simulator,id=$UDID" build
76+
77+
# Install and run using UDID
78+
open -a Simulator
79+
xcrun simctl boot $UDID 2>/dev/null || true
80+
xcrun simctl install $UDID ~/Library/Developer/Xcode/DerivedData/TemplateProject-*/Build/Products/Debug-iphonesimulator/TemplateProject.app
81+
xcrun simctl launch $UDID com.AcmeInc.TemplateProject
82+
```

CLAUDE.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# CLAUDE.md
2+
3+
## iPlug2OOS "Out of Source"
4+
5+
This repo keeps plugin projects separate from the iPlug2 framework. Structure:
6+
7+
- @iPlug2 - Framework as git submodule
8+
- @TemplateProject - Base template for new plugins
9+
- @duplicate.py - Script to create new projects
10+
11+
## Workflow
12+
13+
To create a new plugin, duplicate @TemplateProject using the `new-plugin` skill or:
14+
15+
```bash
16+
./duplicate.py TemplateProject [PluginName] [ManufacturerName]
17+
```
18+
19+
After duplication, optionally commit:
20+
```bash
21+
git add [PluginName]/* .vscode/* .github/* bump_version.py
22+
git commit -m "created [PluginName] based on TemplateProject"
23+
```
24+
25+
## Additional Context
26+
27+
- iPlug2 framework: @iPlug2/CLAUDE.md
28+
- Project structure: @iPlug2/Documentation/structure.md

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![Build WAM](https://github.com/iPlug2/iPlug2OOS/workflows/Build%20WAM/badge.svg)
22

3-
This is the iPlug2 template project and an example of how to set up an iPlug2 project to build "out of source", which is desirable when you need to keep all your project dependencies synchronised with version control and build on Cloud CI/CD. It set up for "containerized development" using [VSCode](https://code.visualstudio.com/docs/devcontainers/containers) and [github codespaces](https://github.com/features/codespaces).
3+
This repo contains an "out of source" iPlug2 template project, which is desirable when you need to keep all your project dependencies synchronised with version control and build it using CI/CD in the cloud. It set up for "containerized development" using [VSCode](https://code.visualstudio.com/docs/devcontainers/containers) and [github codespaces](https://github.com/features/codespaces).
44

55
Instead of using the common-mac.xcconfig and common-win.xcconfig in the iPlug2 folder, it uses copies of them at the top level of the iPlug2OOS repo. This means the iPlug2 submodule itself does not have to be modified.
66

duplicate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
# binary files that we don't want to do find and replace inside
4040
FILTERED_FILE_EXTENSIONS = [".ico",".icns", ".pdf", ".png", ".zip", ".exe", ".wav", ".aif", ".data", ".wasm", "mkcert"]
41-
FILTERED_FILE_NAMES = [".DS_Store"]
41+
FILTERED_FILE_NAMES = [".DS_Store", "CLAUDE.md", "duplicate.py"]
4242
# files that we don't want to duplicate
4343
DONT_COPY = (".vs", "*.exe", "*.dmg", "*.pkg", "*.mpkg", "*.svn", "*.ncb", "*.suo", "*sdf", "ipch", "*.layout", "*.depend", ".DS_Store", "xcuserdata", "*.aps")
4444

iPlug2

Submodule iPlug2 updated 100 files

0 commit comments

Comments
 (0)