Skip to content

Commit e19bf3f

Browse files
committed
fix(skill): improve image instructions, url fallbacks.
1 parent f5ae46c commit e19bf3f

File tree

1 file changed

+10
-3
lines changed
  • .agents/skills/add_sensor_component_v1

1 file changed

+10
-3
lines changed

.agents/skills/add_sensor_component_v1/SKILL.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,12 @@ gh api repos/adafruit/<Library_Repo>/contents/examples --jq '.[].name'
155155
# then read the .ino file for the simpletest/basic_test/singleshot example
156156
```
157157

158-
If `gh`/Bash is unavailable, use WebFetch on the raw GitHub URL:
159-
`https://raw.githubusercontent.com/adafruit/<Library_Repo>/main/examples/<example>/<example>.ino` (you may need to access the web version to view default branch andexample related folder structure).
158+
**Fallback routes** (try in order if `gh`/Bash is unavailable):
159+
160+
1. **WebFetch raw GitHub:** `https://raw.githubusercontent.com/adafruit/<Library_Repo>/main/examples/<example>/<example>.ino` (you may need to access the web version (not raw) to view default branch and example related folder structure).
161+
2. **WebFetch learn guide:** `https://learn.adafruit.com/<guide-slug>.md?view=all` — the Arduino
162+
section usually contains example code link showing the exact API (or embedded code if non-markdown version).
163+
3. **Ask the user:** If tools are restricted, ask them to paste the library header and example.
160164

161165
From the example, extract the **exact method signatures** used:
162166
- `begin()` — what arguments, what return type
@@ -179,6 +183,9 @@ gh api repos/adafruit/<Library_Repo>/contents/<Library_Name>.h --jq '.content' |
179183

180184
Or via WebFetch: `https://raw.githubusercontent.com/adafruit/<Library_Repo>/main/<Library_Name>.h`
181185

186+
If GitHub is blocked, the learn guide `.md?view=all` may contain enough API detail from code
187+
snippets. If not, ask the user for the header content.
188+
182189
**Explicitly set every configuration parameter that the library defaults in `begin()`/`_init()`.**
183190
This pins behavior so library updates can't silently change WipperSnapper.
184191

@@ -502,7 +509,7 @@ Requirements:
502509
- **Formats:** jpg, jpeg, gif, png, svg
503510
- **Filename:** `image.<ext>`
504511

505-
You can usually grab the product image from the Adafruit product API (http://www.adafruit.com/api/product/[pid]) and resize it [4:3] and compress it (using compressjpeg.com) to pass CI validation. Ideally pick the straight-on product shot with a plain background, not angled or lifestyle images. Include a small amount of dead space around the product so it doesn't get cropped in the UI (go with existing examples for reference).
512+
You can usually grab the product image url details from the Adafruit product API (http://www.adafruit.com/api/product/<pid>) and resize it [4:3] and compress it (using compressjpeg.com) to pass CI validation. Ideally pick the straight-on product shot with a plain background, not angled or lifestyle images. Include a small amount of dead space around the product so it doesn't get cropped in the UI (go with existing examples for reference).
506513

507514
---
508515

0 commit comments

Comments
 (0)