-
Notifications
You must be signed in to change notification settings - Fork 24
SKILL.md triggers skill in infinite loop #52
Description
I have the following skill:
name: magick
description: With this tool you can manipulate images, including cropping it.
allowed-tools: # Optional (parsed but not enforced)
- read
- write
- bash
metadata: # Optional key-value pairs
version: "1.0"
magick skill
Magick is a cli tool to manipulate images. In the .opencode/skills/magick/bin folder you'll find the magick.exe file that you can run. Here is the help of magick.exe:
Instructions
- Make sure you use platform independent paths with forward slashes. ie .opencode/skills/magick/bin/magick.exe
- The location of the magick tool is from the project root:
.opencode/skills/magick/bin/magick.exe - Do not use the magick.exe convert option as it is deprecated, use the normal magick.exe instead.
- When asked to crop a section from the image, first get the image dimensions, then approximate the boundingbox of the subject the user wants to crop and run the command with the boundingbox.
- Only invoke the skill once.
Examples
.opencode/skills/magick/bin/magick.exe identify ./GrabFromPDF.png
Crop with -crop x+offset_x+offset_y for example 430x120+50+50
.opencode/skills/magick/bin/magick ./input_file.png -crop 330x550+10+50 +repage ./output_file.png
If you need the command line switches and help run this command:
magick.exe --help
With this skill, when it's invoked the skill gets triggered by the contents of SKILL.md itself in an infinite loop due to the heading # magick skill and the next line mentioning the skill. When I remove magick from both lines it doesn't do an infinite loop.
I think it would be an improvement when you check that you don't trigger on the SKILL.md content.