diff --git a/docs/docs.json b/docs/docs.json index b0f0ee802..8cac897dc 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -1038,6 +1038,7 @@ "tools/reactions", "tools/skills", "tools/skills-config", + "tools/build-your-first-skill", "tools/clawdhub" ] }, @@ -1115,4 +1116,4 @@ } ] } -} +} \ No newline at end of file diff --git a/docs/tools/build-your-first-skill.md b/docs/tools/build-your-first-skill.md new file mode 100644 index 000000000..6017ec3e8 --- /dev/null +++ b/docs/tools/build-your-first-skill.md @@ -0,0 +1,46 @@ +# Build Your First Extension (Skill) + +This guide walk you through creating a simple **System Dashboard** skill for Clawdbot on Windows. Skills are located in the `extensions/` directory and can use PowerShell commands to interact with your system. + +## Step 1: Create the Skill Directory +First, create a folder for your new skill within the `extensions` directory. + +```powershell +# Navigate to your clawdbot folder +cd ~\Desktop\clawdbot\clawdbot + +# Create the folder for your new skill +mkdir extensions\system-stats +``` + +## Step 2: Create the Skill File +Create a new file named `SKILL.md` inside `extensions\system-stats\` and paste the Following content: + +```markdown +--- +name: system-status +description: Reports current CPU, Memory, and Disk usage on Windows. +--- +# Procedure +1. Run the PowerShell command: `Get-CimInstance Win32_OperatingSystem | Select-Object @{Name='FreeGB';Expression={[math]::round($_.FreePhysicalMemory/1MB,2)}}, @{Name='TotalGB';Expression={[math]::round($_.TotalVisibleMemorySize/1MB,2)}}` +2. Run the PowerShell command: `Get-CimInstance Win32_Processor | Select-Object LoadPercentage` +3. Run the PowerShell command: `Get-CimInstance Win32_LogicalDisk | Where-Object { $_.DeviceID -eq 'C:' } | Select-Object @{Name='FreeGB';Expression={[math]::round($_.FreeSpace/1GB,2)}}, @{Name='TotalGB';Expression={[math]::round($_.Size/1GB,2)}}` +4. Display a clean summary table showing: + - **CPU Usage:** [LoadPercentage]% + - **Memory:** [UsedGB] / [TotalGB] GB + - **Disk (C:):** [FreeGB] GB Free of [TotalGB] GB +5. If CPU > 80% or Memory < 1GB, add a warning: "⚠️ System is under heavy load!" +``` + +## Step 3: Run and Test +Start the "Dev" mode of the bot to load your new extension: + +```powershell +pnpm gateway:watch +``` + +Once it's running, talk to Clawdbot and say: +- "system-status" +- "Run system stats" + +Clawdbot will execute the PowerShell commands and display your computer's live stats! 🦞🎉 diff --git a/extensions/system-stats/SKILL.md b/extensions/system-stats/SKILL.md new file mode 100644 index 000000000..a8cd3c112 --- /dev/null +++ b/extensions/system-stats/SKILL.md @@ -0,0 +1,13 @@ +--- +name: system-status +description: Reports current CPU, Memory, and Disk usage on Windows. +--- +# Procedure +1. Run the PowerShell command: `Get-CimInstance Win32_OperatingSystem | Select-Object @{Name='FreeGB';Expression={[math]::round($_.FreePhysicalMemory/1MB,2)}}, @{Name='TotalGB';Expression={[math]::round($_.TotalVisibleMemorySize/1MB,2)}}` +2. Run the PowerShell command: `Get-CimInstance Win32_Processor | Select-Object LoadPercentage` +3. Run the PowerShell command: `Get-CimInstance Win32_LogicalDisk | Where-Object { $_.DeviceID -eq 'C:' } | Select-Object @{Name='FreeGB';Expression={[math]::round($_.FreeSpace/1GB,2)}}, @{Name='TotalGB';Expression={[math]::round($_.Size/1GB,2)}}` +4. Display a clean summary table showing: + - **CPU Usage:** [LoadPercentage]% + - **Memory:** [UsedGB] / [TotalGB] GB + - **Disk (C:):** [FreeGB] GB Free of [TotalGB] GB +5. If CPU > 80% or Memory < 1GB, add a warning: "⚠️ System is under heavy load!"