audit-infra
Infrastructure-first security audit โ secrets, supply chain, CI/CD, LLM/skill security, OWASP, STRIDE. Complements /audit-solana (program-level)
Build Unity project (WebGL, Desktop, or PSG1)
> /plugin marketplace add solanabr/solana-ai-kit > /plugin install solana-ai-kit@stbr
How it fires
How this command gets triggered: by you, by Claude, or both.
/build-unityContext preview
What this command does when you run it.
Build Unity project (WebGL, Desktop, or PSG1)
description: "Build Unity project (WebGL, Desktop, or PSG1)"
You are building a Unity project for Solana game development. Follow these steps:
echo "๐ฎ Unity Build Process"
echo "====================="
# Check for Unity project
if [ ! -f "ProjectSettings/ProjectVersion.txt" ]; then
echo "โ Not a Unity project (no ProjectSettings/ProjectVersion.txt)"
exit 1
fi
# Display Unity version
echo "๐ Unity Version:"
cat ProjectSettings/ProjectVersion.txt
# Check build targets
echo ""
echo "๐ Available Build Targets:"
echo " - WebGL (default)"
echo " - StandaloneWindows64"
echo " - StandaloneOSX"
echo " - Android (for PSG1/mobile)"echo "๐ Running pre-build checks..."
# Check for Solana.Unity-SDK
if grep -q "com.solana.unity-sdk" Packages/manifest.json 2>/dev/null; then
echo "โ
Solana.Unity-SDK found"
else
echo "โ ๏ธ Solana.Unity-SDK not found in manifest.json"
fi
# Check for PlaySolana SDK (optional)
if grep -q "com.playsolana" Packages/manifest.json 2>/dev/null; then
echo "โ
PlaySolana SDK found - PSG1 target supported"
fi
# Check for compilation errors by refreshing assets
echo "๐ Checking for compilation errors..."echo "๐ Building WebGL..."
# Standard WebGL build
unity-editor -quit -batchmode -nographics \
-projectPath . \
-buildTarget WebGL \
-executeMethod BuildScript.BuildWebGL \
-logFile build.log
# Check result
if [ $? -eq 0 ]; then
echo "โ
WebGL build successful!"
echo "๐ Output: Build/WebGL/"
else
echo "โ Build failed. Check build.log for details"
tail -50 build.log
fiecho "๐ฅ๏ธ Building Windows Standalone..."
unity-editor -quit -batchmode -nographics \
-projectPath . \
-buildTarget Win64 \
-executeMethod BuildScript.BuildWindows \
-logFile build.log
if [ $? -eq 0 ]; then
echo "โ
Windows build successful!"
echo "๐ Output: Build/Windows/"
else
echo "โ Build failed. Check build.log"
tail -50 build.log
fiecho "๐ Building macOS..."
unity-editor -quit -batchmode -nographics \
-projectPath . \
-buildTarget OSXUniversal \
-executeMethod BuildScript.BuildMacOS \
-logFile build.log
if [ $? -eq 0 ]; then
echo "โ
macOS build successful!"
echo "๐ Output: Build/macOS/"
else
echo "โ Build failed. Check build.log"
tail -50 build.log
fiecho "๐ฑ Building Android..."
# Note: Requires Android SDK and NDK configured
unity-editor -quit -batchmode -nographics \
-projectPath . \
-buildTarget Android \
-executeMethod BuildScript.BuildAndroid \
-logFile build.log
if [ $? -eq 0 ]; then
echo "โ
Android build successful!"
echo "๐ Output: Build/Android/"
else
echo "โ Build failed. Check build.log"
tail -50 build.log
fiIf no build script exists, create one:
// Assets/Editor/BuildScript.cs
using UnityEditor;
using UnityEditor.Build.Reporting;
using UnityEngine;
using System.Linq;
public static class BuildScript
{
private static readonly string[] Scenes = GetEnabledScenes();
private static string[] GetEnabledScenes()
{
return EditorBuildSettings.scenes
.Where(s => s.enabled)
.Select(s => s.path)
.ToArray();
}
[MenuItem("Build/WebGL")]
public static void BuildWebGL()
{
var options = new BuildPlayerOptions
{
scenes = Scenes,
locationPathName = "Build/WebGL",
target = BuildTarget.WebGL,
options = BuildOptions.None
};
Build(options);
}
[MenuItem("Build/Windows")]
public static void BuildWindows()
{
var options = new BuildPlayerOptions
{
scenes = Scenes,
locationPathName = "Build/Windows/Game.exe",
target = BuildTarget.StandaloneWindows64,
options = BuildOptions.None
};
Build(options);
}
[MenuItem("Build/macOS")]
public static void BuildMacOS()
{
var options = new BuildPlayerOptions
{
scenes = Scenes,
locationPathName = "Build/macOS/Game.app",
target = BuildTarget.StandaloneOSX,
options = BuildOptions.None
};
Build(options);
}
[MenuItem("Build/Android")]
public static void BuildAndroid()
{
var options = new BuildPlayerOptions
{
scenes = Scenes,
locationPathName = "Build/Android/Game.apk",
target = BuildTarget.Android,
options = BuildOptions.None
};
Build(options);
}
private static void Build(BuildPlayerOptions options)
{
Debug.Log($"Building for {options.target}...");
Debug.Log($"Scenes: {string.Join(", ", options.scenes)}");
var report = BuildPipeline.BuildPlayer(options);
if (report.summary.result == BuildResult.Succeeded)
{
Debug.Log($"Build succeeded: {report.summary.totalSize / 1024 / 1024} MB");
Debug.Log($"Output: {options.locationPathName}");
}
else
{
Debug.LogError($"Build failed with {report.summary.totalErrors} errors");
foreach (var step in report.steps)
{
foreach (var message in step.messages)
{
if (message.type == LogType.Error)
{
Debug.LogError(message.content);
}
}
}
EditorApplication.Exit(1);
}
}
}Production-ready Claude Code configuration for full-stack Solana development. Combines best practices from multiple sources into an agent-optimized, token-efficient config you can install and adapt to your specific project.
Repo: solanabr/solana-ai-kit
Infrastructure-first security audit โ secrets, supply chain, CI/CD, LLM/skill security, OWASP, STRIDE. Complements /audit-solana (program-level)
Benchmark CU usage and compare against baseline for regression detection