You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: improve cross-platform compatibility for SKILL.md and setup.sh
SKILL.md:
- Add "Resolving Script Paths" section — Agent must cd to skill dir
before running scripts (fixes path issues in OpenClaw/Docker)
- Widen allowed-tools patterns to support absolute paths
- Step 4: require cd <skill_directory> before running checkup-report.js
- Step 6: always output MEDIA:<filepath> for Telegram/Discord file
delivery via OpenClaw sendDocument, in addition to channel-specific
setup.sh:
- Auto-detect platform: Claude Code (~/.claude) vs OpenClaw (~/.openclaw)
- Copy scripts/ directory + node_modules to skill install target
- Install npm dependencies in the target (avoids symlink issues)
- Support --uninstall across all platform locations
- Show platform-specific next-step instructions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
You are a security auditor powered by the GoPlus AgentGuard framework. Route the user's request based on the first argument.
18
18
19
+
## Important: Resolving Script Paths
20
+
21
+
All commands in this skill reference `scripts/` as a relative path. You **MUST** resolve this to the absolute path of this skill's directory before running any command. To find the skill directory:
22
+
23
+
1. This SKILL.md file's parent directory **is** the skill directory
24
+
2. If this file is at `/path/to/agentguard/SKILL.md`, then scripts are at `/path/to/agentguard/scripts/`
25
+
3. Before running any `node scripts/...` command, **always `cd` into the skill directory first**, or use the full absolute path
26
+
27
+
Example: if this SKILL.md is at `~/.openclaw/skills/agentguard/SKILL.md`, run:
The script outputs the HTML file path to stdout and opens it in the browser automatically.
742
+
The script outputs the HTML file path to stdout (e.g. `/tmp/agentguard-checkup-1234567890.html`). Capture this path — you will need it for delivery in Step 6.
730
743
731
744
### Step 5: Terminal Summary
732
745
@@ -754,28 +767,34 @@ After the report generates, output a brief summary in the terminal:
754
767
755
768
### Step 6: Deliver the Report to the User
756
769
757
-
After printing the terminal summary, deliver the HTML report file to the user. Detect the current channel and use the most appropriate method:
770
+
After printing the terminal summary, deliver the HTML report file. You **MUST** always output the `MEDIA:` token, and then also deliver via the appropriate channel method.
771
+
772
+
#### 6a. MEDIA token (required — always do this)
773
+
774
+
Output the following line on its **own line** in your response:
775
+
776
+
```
777
+
MEDIA:<file_path>
778
+
```
779
+
780
+
For example: `MEDIA:/tmp/agentguard-checkup-1234567890.html`
758
781
759
-
**Detection logic** — infer from context clues:
760
-
- If the `Write` tool is available and you can write to `~/Desktop` or `~/Downloads` → you are in **Claude Code (local)**
761
-
- If you can produce artifact/file outputs (rich UI, download button) → you are in **Claude.ai web**
762
-
- If neither is clearly available → you are in **API / headless mode**
782
+
This is how platforms like OpenClaw automatically deliver the file as a Telegram/Discord/WhatsApp attachment via `sendDocument`. The platform strips this line from visible text — the user won't see it. **Always output this regardless of what channel you think you're in.**
763
783
764
-
**Delivery by channel:**
784
+
#### 6b. Channel-specific delivery (in addition to MEDIA token)
765
785
766
-
1.**Claude Code (local desktop)**
767
-
- Use the `Write` tool to copy the HTML to `~/Desktop/agentguard-checkup-<YYYY-MM-DD>.html`
768
-
- Tell the user: "✅ Report saved to your Desktop: `agentguard-checkup-<date>.html` — double-click to open it in your browser."
769
-
- The browser should already be open from Step 4. If not, run `open ~/Desktop/agentguard-checkup-<date>.html` (macOS) or `xdg-open` (Linux).
786
+
**Claude Code (local desktop)**
787
+
- The browser should already be open from Step 4.
788
+
- Also copy to Desktop: `cp <file_path> ~/Desktop/agentguard-checkup-$(date +%Y-%m-%d).html`
789
+
- Tell the user: "✅ Report saved to your Desktop and opened in browser."
770
790
771
-
2.**Claude.ai web**
772
-
- Read the generated HTML file using the `Read` tool, then output the full HTML content as a **code artifact** (language: `html`) so the user can preview it inline or download it.
773
-
- Tell the user: "✅ Your report is attached above — click the download icon to save it."
791
+
**Claude.ai web**
792
+
- Read the generated HTML file and output it as a **code artifact** (language: `html`).
793
+
- Tell the user: "✅ Your report is attached above — click the download icon to save it."
774
794
775
-
3.**API / headless / MCP**
776
-
- Read the generated HTML file and return the full content inline, prefixed with:
0 commit comments